Package com.iizix.api

Class BaseEvent<PROP_OR_INTERFACE>

java.lang.Object
com.iizix.api.BaseEvent<PROP_OR_INTERFACE>
All Implemented Interfaces:
IMessageBox
Direct Known Subclasses:
UIBaseEvent, VSBaseEvent

public abstract class BaseEvent<PROP_OR_INTERFACE> extends Object implements IMessageBox
Base event for all events in the API.
Author:
Christopher Mindus
  • Field Details

    • source

      protected final PROP_OR_INTERFACE source
      The property that is the source of the event.
  • Constructor Details

  • Method Details

    • getTime

      public long getTime()
      Gets the event creation time.
      Returns:
      Time in milliseconds since 1/1 1970.
      See Also:
    • getSource

      public PROP_OR_INTERFACE getSource()
      Gets the property that is the source of the event.
    • toString

      public String toString()
      Returns a string representation of this event and its parameters and values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this event.
    • paramString

      protected String paramString()
      Gets the parameter string.
    • getVirtualSpace

      public abstract VirtualSpace getVirtualSpace()
      Gets the VirtualSpace of the event source component.
      Returns:
      The VirtualSpace associated with the source component of this event.
    • getAppSessionGyro

      public IAppSessionGyro getAppSessionGyro()
      Gets the Application Session Gyro instance.
      Returns:
      The instance.
    • getField

      public VSField getField(@VSRef String path) throws NotFoundException
      Gets the field with the specified path.
      Parameters:
      path - The path to the field in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The field, never null.
      Throws:
      NotFoundException - If the field is not found.
    • getFieldNull

      public VSField getFieldNull(@VSRef String path)
      Gets the field with the specified path.

      It is preferable to use getField(String) instead of this method if the field always should be present because it will throw and log errors.

      Parameters:
      path - The path to the field in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The field, null if not found.
    • getField2

      public VSField getField2(@FullVSRef String fullVSRef) throws NotFoundException
      Gets the field with the specified full VS reference path.
      Parameters:
      fullVSRef - The full VS reference to the field in the VirtualSpace, as "module:/vs/path".
      Returns:
      The field, never null.
      Throws:
      NotFoundException - If the field is not found.
    • getFieldNull2

      public VSField getFieldNull2(@FullVSRef String fullVSRef)
      Gets the field with the specified full VS reference path.

      It is preferable to use getField2(String) instead of this method if the field always should be present because it will throw and log errors.

      Parameters:
      fullVSRef - The full VS reference to the field in the VirtualSpace, as "module:/vs/path".
      Returns:
      The field, null if not found.
    • getTable

      public VSTable getTable(@VSRef String path) throws NotFoundException
      Gets the table with the specified path.
      Parameters:
      path - The path to the table in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The table, never null.
      Throws:
      NotFoundException - If the table is not found.
    • getTableNull

      public VSTable getTableNull(@VSRef String path)
      Gets the table with the specified path.

      It is preferable to use getTable(String) instead of this method if the table always should be present because it will throw and log errors.

      Parameters:
      path - The path to the table in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The table, null if not found.
    • getTable2

      public VSTable getTable2(@FullVSRef String fullVSRef) throws NotFoundException
      Gets the table with the specified full VS reference path.
      Parameters:
      fullVSRef - The full VS reference to the table in the VirtualSpace, as "module:/vs/path".
      Returns:
      The table, never null.
      Throws:
      NotFoundException - If the table is not found.
    • getTableNull2

      public VSTable getTableNull2(@FullVSRef String fullVSRef)
      Gets the table with the specified full VS reference path.

      It is preferable to use getTable2(String) instead of this method if the table always should be present because it will throw and log errors.

      Parameters:
      fullVSRef - The full VS reference to the table in the VirtualSpace, as "module:/vs/path".
      Returns:
      The table, null if not found.
    • getAction

      public VSAction getAction(@VSRef String path) throws NotFoundException
      Gets the action with the specified path.
      Parameters:
      path - The path to the action in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The action, never null.
      Throws:
      NotFoundException - If the action is not found.
    • getActionNull

      public VSAction getActionNull(@VSRef String path)
      Gets the action with the specified path.

      It is preferable to use getAction(String) instead of this method if the action always should be present because it will throw and log errors.

      Parameters:
      path - The path to the action in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The action, null if not found.
    • getAction2

      public VSAction getAction2(@FullVSRef String fullVSRef) throws NotFoundException
      Gets the action with the specified full VS reference path.
      Parameters:
      fullVSRef - The full VS reference to the action in the VirtualSpace, as "module:/vs/path".
      Returns:
      The action, never null.
      Throws:
      NotFoundException - If the action is not found.
    • getActionNull2

      public VSAction getActionNull2(@FullVSRef String fullVSRef)
      Gets the action with the specified full VS reference path.

      It is preferable to use getAction2(String) instead of this method if the action always should be present because it will throw and log errors.

      Parameters:
      fullVSRef - The full VS reference to the action in the VirtualSpace, as "module:/vs/path".
      Returns:
      The action, null if not found.
    • getGroup

      public VSGroup getGroup(@VSRef String path) throws NotFoundException
      Gets the group with the specified path.
      Parameters:
      path - The path to the group in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The group, never null.
      Throws:
      NotFoundException - If the action is not found.
    • getGroupNull

      public VSGroup getGroupNull(@VSRef String path)
      Gets the group with the specified path.

      It is preferable to use getGroup(String) instead of this method if the action always should be present because it will throw and log errors.

      Parameters:
      path - The path to the group in the VirtualSpace, cannot start with '/' or contain ':'.
      Returns:
      The action, null if not found.
    • getGroup2

      public VSGroup getGroup2(@FullVSRef String fullVSRef) throws NotFoundException
      Gets the group with the specified full VS reference path.
      Parameters:
      fullVSRef - The full VS reference to the group in the VirtualSpace, as "module:/vs/path".
      Returns:
      The group, never null.
      Throws:
      NotFoundException - If the group is not found.
    • getGroupNull2

      public VSGroup getGroupNull2(@FullVSRef String fullVSRef)
      Gets the group with the specified full VS reference path.

      It is preferable to use getGroup2(String) instead of this method if the group always should be present because it will throw and log errors.

      Parameters:
      fullVSRef - The full VS reference to the group in the VirtualSpace, as "module:/vs/path".
      Returns:
      The group, null if not found.
    • getVSComponent

      public <COMP extends IVSComponent> COMP getVSComponent(@VSRef String path, Class<COMP> clazz) throws NotFoundException
      Gets the VS component with the specified path.
      Parameters:
      path - The path to the VS component in the VirtualSpace, cannot start with '/' or contain ':'.
      clazz - The requested VS component class.
      Returns:
      The component, never null or wrong class.
      Throws:
      NotFoundException - If the field is not found or wrong class.
    • getVSComponentNull

      public <COMP extends IVSComponent> COMP getVSComponentNull(@VSRef String path, Class<COMP> clazz)
      Gets the VS component with the specified path.
      Parameters:
      path - The path to the VS component in the VirtualSpace, cannot start with '/' or contain ':'.
      clazz - The requested VS component class.
      Returns:
      The component, null if not found or wrong class.
    • getVSComponent2

      public <COMP extends IVSComponent> COMP getVSComponent2(@FullVSRef String fullVSRef, Class<COMP> clazz) throws NotFoundException
      Gets the VS component with the specified full reference path.
      Parameters:
      fullVSRef - The full reference path to the VS component in the VirtualSpace, as "module:/vs/path".
      clazz - The requested VS component class.
      Returns:
      The component, never null or wrong class.
      Throws:
      NotFoundException - If the component is not found or wrong class.
    • getVSComponentNull2

      public <COMP extends IVSComponent> COMP getVSComponentNull2(@FullVSRef String fullVSRef, Class<COMP> clazz)
      Gets the VS component with the specified full reference path.
      Parameters:
      fullVSRef - The full reference path to the VS component in the VirtualSpace, as "module:/vs/path".
      clazz - The requested VS component class.
      Returns:
      The component, null if not found or wrong class.
    • getVirtualizedVirtualSpace

      public VirtualSpace getVirtualizedVirtualSpace(@FullVSRef String path)
      Gets a virtualized VirtualSpace for the application session. The VirtualSpace to get MUST already have been virtualized prior to this call.
      Parameters:
      path - The path of the VirtualSpace name relative the parent of the current VirtualSpace. This path can be e.g. just a plain name for a direct sibling of this VirtualSpace, a folder based path such as "folder/virtualSpaceB" or a full reference path as "module:/vs/[folderPath/]virtualSpace".
      Returns:
      The VirtualSpace for the path in question.
      Throws:
      NotFoundException - If the VirtualSpace is not found within the virtualized VirtualSpaces.
      IllegalStateException - If the current VirtualSpace is disposed or the application session gyro is not found.
      IllegalArgumentException - If path is invalid.
    • messageBox

      public void messageBox(IMessageBoxReply reply, IMessageBox.Icon icon, KString title, KString message, KString... buttons)
      Displays a message box with the specified title and message for the application session. The message box will be displayed on all client sessions.

      The callback is done in the application worker thread.

      Specified by:
      messageBox in interface IMessageBox
      Parameters:
      reply - The reply callback that is called when the user chooses a button or session is closed, null for none.
      icon - Icon to display, see the {link Icon} enumeration.
      title - The title string, must be non-null.
      message - The message to display, must be non-null.
      buttons - The strings for the buttons to display, if none, just an OK button is displayed. This array of buttons defined the index value returned by this method.
      Throws:
      NullPointerException - If icon or message is null, or if any of the elements in buttons array is null.
      IllegalStateException - If the application session is disposed of.