Interface IAction<RETURNTYPE>

All Superinterfaces:
Runnable
All Known Implementing Classes:
CommonAction

public interface IAction<RETURNTYPE> extends Runnable
provides all informations to start an action (through Runnable) and to handle a graphical user interface of type button etc.
Version:
$Revision: 1.0 $
Author:
ts 13.11.2008
  • Field Details

    • CANCELED

      static final String CANCELED
      See Also:
    • MODE_UNDEFINED

      static final int MODE_UNDEFINED
      dialog return value - no dialog handling will be done
      See Also:
    • MODE_DLG_CANCEL

      static final int MODE_DLG_CANCEL
      dialog return value: dialog will be closed, and IDialogConstants.CANCEL_ID will be returned
      See Also:
    • MODE_DLG_OK

      static final int MODE_DLG_OK
      dialog return value: dialog will be closed, and IDialogConstants.OK_ID will be returned
      See Also:
  • Method Details

    • isEnabled

      boolean isEnabled()
      Getter isEnabled
      Returns:
      Returns the isEnabled.
    • setEnabled

      void setEnabled(boolean isEnabled)
      Setter isEnabled
      Parameters:
      isEnabled - The isEnabled to set.
    • getKeyStroke

      Object getKeyStroke()
      Getter getKeyStroke
      Returns:
      Returns the keyStroke.
    • getId

      String getId()
      Getter getId
      Returns:
      Returns the id.
    • getShortDescription

      String getShortDescription()
      Getter getShortDescription
      Returns:
      Returns the shortDescription.
    • getLongDescription

      String getLongDescription()
      Getter getLongDescription
      Returns:
      Returns the longDescription.
    • getImagePath

      String getImagePath()
      Returns:
      image
    • isDefault

      boolean isDefault()
      Getter isDefault
      Returns:
      Returns the isDefault.
    • setDefault

      void setDefault(boolean isDefault)
      setDefault
      Parameters:
      isDefault - whether to set the action as default action
    • isSynchron

      boolean isSynchron()
      Getter isSynchron
      Returns:
      Returns the synchron.
    • action

      RETURNTYPE action() throws Exception
      The action to be started
      Returns:
      result of the action. use CANCELED to define for buttons, the action was canceled.
      Throws:
      Exception
    • activate

      RETURNTYPE activate()
      starts this action.
      Returns:
      the result
    • getReceiverIDs

      Collection<String> getReceiverIDs()
      the receivers will receive the result of the activation.
      Returns:
      list of ids of receiver fields (IComponentDescriptor)
    • getArgumentTypes

      Class[] getArgumentTypes()
      getArgumentTypes
      Returns:
      optional definition of argument types to check getParameter() and setParameter(Object...). default is null
    • getParameter

      Object[] getParameter()
      Returns:
      optional call arguments for action.
    • getParameter

      Object getParameter(int i)
    • setParameter

      IAction<RETURNTYPE> setParameter(Object... parameter)
      Parameters:
      parameter - call arguments
    • getActionMode

      int getActionMode()
      action mode. e.g. on dialogs it is usable to define the buttons result type. see MODE_DLG_CANCEL, MODE_DLG_OK.
      Returns:
      action mode
    • isRunning

      boolean isRunning()
    • doFor

      static int doFor(Collection<?> forCollection, IAction<?> doAction)
      starts the given action for all items of the given collection - as first action parameter.
      Parameters:
      forCollection - to iterate
      doAction - to do
      Returns:
      iteration size