UNPKG

@eclipse-scout/core

Version:
167 lines 6.42 kB
/// <reference types="jquery" /> import { AbstractLayout, ActionEventMap, ActionKeyStroke, ActionModel, Alignment, DoubleClickSupport, EnumObject, Icon, InitModelOf, KeyStrokeContext, LoadingSupport, TooltipPosition, TooltipSupport, Widget } from '../index'; export type ActionStyle = EnumObject<typeof Action.ActionStyle>; export type KeyStrokeFirePolicy = EnumObject<typeof Action.KeyStrokeFirePolicy>; export type ActionTextPosition = EnumObject<typeof Action.TextPosition>; export declare class Action extends Widget implements ActionModel { model: ActionModel; eventMap: ActionEventMap; self: Action; actionStyle: ActionStyle; compact: boolean; iconId: string; horizontalAlignment: Alignment; keyStroke: string; keyStrokeFirePolicy: KeyStrokeFirePolicy; selected: boolean; preventDoubleClick: boolean; tabbable: boolean; actionKeyStroke: ActionKeyStroke; text: string; textPosition: ActionTextPosition; htmlEnabled: boolean; /** * May be set to true if the action does not fit into the container and is for example moved into an overflow-menu. */ overflown: boolean; textVisible: boolean; toggleAction: boolean; tooltipText: string; showTooltipWhenSelected: boolean; tooltipPosition: TooltipPosition; icon: Icon; $text: JQuery; protected _doubleClickSupport: DoubleClickSupport; protected _compactOrig: boolean; protected _textVisibleOrig: boolean; constructor(); static ActionStyle: { /** * Regular look, also used in overflow menus. */ readonly DEFAULT: 0; /** * Action looks like a button. */ readonly BUTTON: 1; }; static TextPosition: { readonly DEFAULT: "default"; /** * The text will be positioned below the icon. It has no effect if no icon is set. */ readonly BOTTOM: "bottom"; }; static KeyStrokeFirePolicy: { readonly ACCESSIBLE_ONLY: 0; readonly ALWAYS: 1; }; protected _createKeyStrokeContext(): KeyStrokeContext; protected _createLoadingSupport(): LoadingSupport; protected _init(model: InitModelOf<this>): void; protected _render(): void; protected _createLayout(): AbstractLayout; protected _renderProperties(): void; protected _remove(): void; /** @see ActionModel.actionStyle */ setActionStyle(actionStyle: ActionStyle): void; /** @see ActionModel.text */ setText(text: string): void; protected _renderText(): void; protected _removeText(): void; /** @see ActionModel.textPosition */ setTextPosition(textPosition: ActionTextPosition): void; protected _renderTextPosition(): void; /** @see ActionModel.htmlEnabled */ setHtmlEnabled(htmlEnabled: boolean): void; protected _renderHtmlEnabled(): void; /** @see ActionModel.iconId */ setIconId(iconId: string): void; protected _renderIconId(): void; get$Icon(): JQuery; protected _removeIconId(): void; protected _renderEnabled(): void; /** @see ActionModel.tooltipText */ setTooltipText(tooltipText: string): void; protected _renderTooltipText(): void; /** * Returns the text to show as a tooltip, which might be different from the `tooltipText` property. * If this value is falsy, the tooltip is not installed. * * @see _configureTooltip * @see _shouldInstallTooltip */ protected _computeTooltipText(): string; /** * Installs or uninstalls tooltip based on tooltipText, selected and enabledComputed. */ protected _updateTooltip(): void; protected _shouldInstallTooltip(): boolean; /** @see ActionModel.tabbable */ setTabbable(tabbable: boolean): void; protected _renderTabbable(): void; /** @see ActionModel.compact */ setCompact(compact: boolean): void; protected _renderCompact(): void; protected _renderActionStyle(): void; /** @see ActionModel.tooltipPosition */ setTooltipPosition(position: TooltipPosition): void; protected _configureTooltip(): InitModelOf<TooltipSupport>; /** * @returns true if the action has been performed or false if it has not been performed (e.g. when the button is not enabledComputed). */ doAction(): boolean; toggle(): void; /** @see ActionModel.toggleAction */ setToggleAction(toggleAction: boolean): void; isToggleAction(): boolean; _renderToggleAction(): void; /** * @returns true if the action may be executed, false if it should be ignored. */ prepareDoAction(): boolean; protected _doAction(): void; /** @see ActionModel.selected */ setSelected(selected: boolean): void; protected _renderSelected(): void; /** @see ActionModel.keyStroke */ setKeyStroke(keyStroke: string): void; protected _setKeyStroke(keyStroke: string): void; protected _renderKeyStroke(): void; /** @see ActionModel.textVisible */ setTextVisible(textVisible: boolean): void; protected _renderTextVisible(): void; /** @see ActionModel.horizontalAlignment */ setHorizontalAlignment(horizontalAlignment: Alignment): void; protected _createActionKeyStroke(): ActionKeyStroke; /** @see ActionModel.preventDoubleClick */ setPreventDoubleClick(preventDoubleClick: boolean): void; /** * @internal */ _setOverflown(overflown: boolean): void; protected _renderOverflown(): void; protected _allowMouseEvent(event: JQuery.MouseEventBase): boolean; protected _onClick(event: JQuery.ClickEvent): void; /** * Sets the action into compact mode. Can be reversed by calling {@link #undoMakeCompact}. * @see ActionModel.compact */ makeCompact(): void; /** * Undoes the effect of {@link #makeCompact}, i.e. restores the previous compact state. * If {@link #makeCompact} was not called previously, nothing happens. */ undoMakeCompact(): void; /** * If the action has an icon, the text is made invisible. Otherwise, nothing happens. * Can be reversed by calling {@link #undoShrink}. */ shrink(): void; /** * Undoes the effect of {@link #shrink}, i.e. restores the text visibility to the previous state. * If {@link #shrink} was not called previously, nothing happens. */ undoShrink(): void; } //# sourceMappingURL=Action.d.ts.map