Interface IUIAction

All Superinterfaces:
IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, ILockUI, IMessageBox, IPropCnr, IUIComp, IUIPanelAnimation, IVSComponentListener, IVSComponentState, IVSFieldListener
All Known Implementing Classes:
AbstractUIAction, EMLItemProp, EUIButton, EUIImage, EUIMenuItem, MLItemProp, UIButton, UIImage, UIMenuItem

public interface IUIAction extends IUIComp, IUIPanelAnimation, ILockUI
Interface implemented by action items.
Author:
Christopher Mindus
  • Method Details

    • getOnUIActionMethod

      Method getOnUIActionMethod()
      Gets the method for the OnUIAction event at runtime. The method can be stored in another instance, e.g. a group holding multiple action items.
      Returns:
      The method for OnUIAction event, null for none.
    • setSelected

      default boolean setSelected(boolean on)
      Sets the selected state of the action. This state is used e.g. for an action to change the image depending on the state. This state is a programmatic state that is also connected to the VirtualSpace action, i.e. the initial state of the component is set according to the VSAction, and if the select state of the VSAction changes, the UI action will follow the same state.

      Note 1: this state is a programmatic state and does not affect the component apart of e.g. displaying a different image depending on the state (and this is supported in the image definition).

      Note 2: Changing the select state in the UI action does NOT affect the VSAction.

      Parameters:
      on - The select state.
      Returns:
      true for state changed, false for no change.
    • isSelected

      default boolean isSelected()
      Returns the selected state of the action. This state is used e.g. for a plain button to change the image depending on the state.

      Note: this state is a programmatic state and does not affect the component apart of e.g. displaying a different image depending on the state (and this is supported in the image definition).

      Returns:
      true if action is selected, false otherwise.
    • getVSAction

      VSAction getVSAction()
      Gets the connected or disconnected VirtualSpace Action.
      Returns:
      The action, or null if no action resolved (connected or disconnected) is present.
    • getVSFocusComponent

      VSComponent getVSFocusComponent()
      Gets the VS component to focus when action is triggered.
      Returns:
      The VS component, or null for none.
    • onVSStateChanged

      default void onVSStateChanged(VSAction action, IVSComponentState.State state, boolean on)
      Called when the action changes state.
      Parameters:
      action - The VS action.
      state - The state change.
      on - New state.
    • setVSActionToComponent

      default void setVSActionToComponent(VSAction action)
      Method called when a VirtualSpace action is resolved or when reconnection is done. Override to provide additional processing.

      By default the following is done:

      1. all states (enabled, read-only and visible),
      2. progress delay, and
      3. and message
      are set from the action to the component.
      Parameters:
      action - The VS action.
    • setVSActionMessageToComponent

      default boolean setVSActionMessageToComponent(VSAction action, boolean clear)
      Sets the VirtualSpace Action's message to this component.
      Parameters:
      action - The VS action.
      clear - Flag to clear the component message if the action hasn't got a message.
      Returns:
      true if changed, false for no change.
    • enterVSProcessing

      boolean enterVSProcessing(VSComponent component)
      Call this method when the VSField or the text will update each other, in order to avoid recursion in event processing.

      Programming note: it is IMPERATIVE that the exitVSProcessing() is called after any kind of call to this routine: surround e.g. with "try-finally" block. If this method returns false the exitVSProcessing() should not be called.

      Parameters:
      component - The VS component.
      Returns:
      true if OK to process, false otherwise.
    • exitVSProcessing

      void exitVSProcessing()
      Call this routine to exit VSField processing routine that was entered using enterVSProcessing(VSComponent).
      Throws:
      InternalError - If the enterVSProcessing(VSComponent) wasn't called.
    • invokeOnUIActionMethod

      default void invokeOnUIActionMethod(GProp<?> trigger, UIComp contextComponent)
      Invoke the action event method.
      Parameters:
      trigger - The trigger property.
      contextComponent - The context component, null for none.
    • invoke

      default boolean invoke()
      Invokes the action. If enabled and not read-only, the action performs the following steps:
      1. Locks the UI (if remote it has already been locked on the client),
      2. Clears its message (if any),
      3. Invokes a potential onVSAction class,
      4. Invokes the connected VSAction if any,
      5. Unlocks the UI if not in a processing lock state.

      A warning message is logged if the action is disabled or read-only.

      Returns:
      true for success, false otherwise.
    • invoke

      default boolean invoke(boolean isRemote, boolean doRequestFocus, UIComp focusComponent)
      Invokes the action. If enabled and not read-only, the action performs the following steps:
      1. Locks the UI (if remote it has already been locked on the client),
      2. Clears its message (if any),
      3. Invokes the connected VSAction,
      4. Unlocks the UI if not in a processing lock state.

      A warning message is logged if the action is disabled or read-only.

      Parameters:
      isRemote - Flag indicating the action is invoked remotely from the Client.
      doRequestFocus - Flag to request focus.
      focusComponent - Component to focus, when action is a menu item in a context menu, null otherwise.
      Returns:
      true for success, false otherwise.
    • invoke

      default boolean invoke(boolean isRemote, boolean doRequestFocus, UIComp focusComponent, boolean fromContextMenu, UIComp contextComponent)
      Invokes the action. If enabled and not read-only, the action performs the following steps:
      1. Locks the UI (if remote it has already been locked on the client),
      2. Clears its message (if any),
      3. Invokes the connected VSAction,
      4. Unlocks the UI if not in a processing lock state.

      A warning message is logged if the action is disabled or read-only.

      Parameters:
      isRemote - Flag indicating the action is invoked remotely from the Client.
      doRequestFocus - Flag to request focus.
      focusComponent - Component to focus, when action is a menu item in a context menu, null otherwise.
      fromContextMenu - Flag indicating this action is invoked from the context menu and the trigger of the action should be the "focusComponent" if non-null.
      contextComponent - The context component causing the event, used for context menus.
      Returns:
      true for success, false otherwise.
    • setVSFocus

      default void setVSFocus(IAppSessionGyro appGyro)
      Called to focus the VS component if defined.