com.tibbo.aggregate.common.action

## Class BasicActionDefinition

- java.lang.Object
- - com.tibbo.aggregate.common.context.AbstractEntityDefinition
  - - com.tibbo.aggregate.common.action.BasicActionDefinition

- All Implemented Interfaces:
    ActionCommandList, ActionDefinition, EntityDefinition, java.lang.Comparable
  Direct Known Subclasses:
    ServerActionDefinition

      public class BasicActionDefinition
      extends AbstractEntityDefinition
      implements ActionDefinition, ActionCommandList

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `concurrent`

    - ### Fields inherited from class com.tibbo.aggregate.common.context.AbstractEntityDefinition

      `immutable`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicActionDefinition(java.lang.String name)`
    `BasicActionDefinition(java.lang.String name, java.lang.Class actionClass)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDropSource(ResourceMask resourceMask)`
    `void` | `addPropertyChangeListener(java.beans.PropertyChangeListener l)`
    `int` | `compareTo(java.lang.Object o)`
    `KeyStroke` | `getAccelerator()` Returns key stroke used to initiate the action in any UI.
    `java.util.List<ActionCommand>` | `getCommands()` List of ActionCommands that can be requested by the source action.
    `java.util.List<ResourceMask>` | `getDropSources()` Returns the drop source context masks.
    `java.lang.Integer` | `getEntityType()`
    `GroupIdentifier` | `getExecutionGroup()` Some category of actions may be applied to groups of objects.
    `java.util.concurrent.locks.ReentrantLock` | `getExecutionLock()` Returns the execution lock
    `Permissions` | `getPermissions()` Returns permissions required to execute action.
    `Action` | `instantiate()` Creates and return an instance of the action
    `boolean` | `isConcurrent()` If false, parallel execution of several action instances is not allowed
    `boolean` | `isDefault()` Returns true if action is a default action in context.
    `boolean` | `isEnabled()` Returns true if action execution is allowed.
    `boolean` | `isHeadless()` Returns true if action supports non-interactive execution.
    `boolean` | `isHidden()` Returns true if action is hidden.
    `protected void` | `registerCommand(ActionCommand cmd)` Action may register several parameters (or states) designated by the RequestIdentifier The action passes through these states sequentially with no repeat.
    `protected void` | `registerCommands()` Override this method to call registerCommand() only inside body of this method.
    `void` | `removePropertyChangeListener(java.beans.PropertyChangeListener l)`
    `void` | `setAccelerator(KeyStroke accelerator)`
    `void` | `setConcurrent(boolean allowConcurrentExecution)`
    `void` | `setDefault(boolean isDefault)` Sets default flag for the action.
    `void` | `setDescription(java.lang.String description)`
    `void` | `setDropSources(java.util.List<ResourceMask> dropSources)`
    `void` | `setEnabled(boolean enabled)` Enables/disables action.
    `void` | `setExecutionGroup(GroupIdentifier groupId)`
    `void` | `setExecutionGroup(java.lang.String base)`
    `void` | `setHelp(java.lang.String help)`
    `void` | `setHidden(boolean hidden)`
    `void` | `setIconId(java.lang.String iconId)`
    `void` | `setName(java.lang.String name)`
    `void` | `setPermissions(Permissions permissions)`
    `protected void` | `unregisterCommand(java.lang.String id)`

    - ### Methods inherited from class com.tibbo.aggregate.common.context.AbstractEntityDefinition

      `getDescription, getGroup, getHelp, getIconId, getIndex, getName, getOwner, isImmutable, setGroup, setImmutable, setIndex, setOwner, toDetailedString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.tibbo.aggregate.common.context.EntityDefinition

      `getDescription, getGroup, getHelp, getIconId, getIndex, getName, getOwner, toDetailedString`

- - ### Field Detail

    - #### concurrent

          public boolean concurrent

  - ### Constructor Detail

    - #### BasicActionDefinition

          public BasicActionDefinition(java.lang.String name)

    - #### BasicActionDefinition

          public BasicActionDefinition(java.lang.String name,
                                       java.lang.Class actionClass)

  - ### Method Detail

    - #### getExecutionGroup

          public GroupIdentifier getExecutionGroup()

      Description copied from interface: `ActionDefinition`
      Some category of actions may be applied to groups of objects. To make system know what actions to group the definition has an execution group. If action can't be grouped, execution group should be null.
      Specified by:
        `getExecutionGroup` in interface `ActionDefinition`

    - #### isEnabled

          public boolean isEnabled()

      Description copied from interface: `ActionDefinition`
      Returns true if action execution is allowed.
      Specified by:
        `isEnabled` in interface `ActionDefinition`

    - #### isHidden

          public boolean isHidden()

      Description copied from interface: `ActionDefinition`
      Returns true if action is hidden.
      Specified by:
        `isHidden` in interface `ActionDefinition`

    - #### getAccelerator

          public KeyStroke getAccelerator()

      Description copied from interface: `ActionDefinition`
      Returns key stroke used to initiate the action in any UI.
      Specified by:
        `getAccelerator` in interface `ActionDefinition`

    - #### getDropSources

          public java.util.List<ResourceMask> getDropSources()

      Description copied from interface: `ActionDefinition`
      Returns the drop source context masks.
      Specified by:
        `getDropSources` in interface `ActionDefinition`

    - #### setIconId

          public void setIconId(java.lang.String iconId)

      Overrides:
        `setIconId` in class `AbstractEntityDefinition`

    - #### setHelp

          public void setHelp(java.lang.String help)

      Overrides:
        `setHelp` in class `AbstractEntityDefinition`

    - #### setDescription

          public void setDescription(java.lang.String description)

      Overrides:
        `setDescription` in class `AbstractEntityDefinition`

    - #### setExecutionGroup

          public void setExecutionGroup(java.lang.String base)

    - #### setExecutionGroup

          public void setExecutionGroup(GroupIdentifier groupId)

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Description copied from interface: `ActionDefinition`
      Enables/disables action.
      Specified by:
        `setEnabled` in interface `ActionDefinition`

    - #### setHidden

          public void setHidden(boolean hidden)

    - #### setAccelerator

          public void setAccelerator(KeyStroke accelerator)

    - #### setDropSources

          public void setDropSources(java.util.List<ResourceMask> dropSources)

    - #### setName

          public void setName(java.lang.String name)

      Overrides:
        `setName` in class `AbstractEntityDefinition`

    - #### isDefault

          public boolean isDefault()

      Description copied from interface: `ActionDefinition`
      Returns true if action is a default action in context.
      Specified by:
        `isDefault` in interface `ActionDefinition`

    - #### setDefault

          public void setDefault(boolean isDefault)

      Description copied from interface: `ActionDefinition`
      Sets default flag for the action.
      Specified by:
        `setDefault` in interface `ActionDefinition`

    - #### isConcurrent

          public boolean isConcurrent()

      Description copied from interface: `ActionDefinition`
      If false, parallel execution of several action instances is not allowed
      Specified by:
        `isConcurrent` in interface `ActionDefinition`

    - #### setConcurrent

          public void setConcurrent(boolean allowConcurrentExecution)

    - #### addDropSource

          public void addDropSource(ResourceMask resourceMask)

    - #### instantiate

          public Action instantiate()

      Description copied from interface: `ActionDefinition`
      Creates and return an instance of the action
      Specified by:
        `instantiate` in interface `ActionDefinition`

    - #### getCommands

          public java.util.List<ActionCommand> getCommands()

      List of ActionCommands that can be requested by the source action.
      Specified by:
        `getCommands` in interface `ActionCommandList`

    - #### registerCommands

          protected void registerCommands()

      Override this method to call registerCommand() only inside body of this method. This guarantees necessary synchronization to be performed

    - #### registerCommand

          protected void registerCommand(ActionCommand cmd)

      Action may register several parameters (or states) designated by the RequestIdentifier The action passes through these states sequentially with no repeat. If the action repeats it's request a caller may suppose that the action want to reenter invalid data and in automatic mode just stop execution Note this if the action should be able to run in both interactive and silent mode. Interactive mode will re-request the user to enter a parameter but silent won't. So the same RequestIdentifier should describe semantically different steps of an action. The preferred way to distinguish the action request id from other types of action is to add action group id followed by a '.' (dot) symbol with the step name, ie. getGroupId() + ".inputParams" Call this method only inside of the body registerParameters() to perform synchronization!

    - #### unregisterCommand

          protected void unregisterCommand(java.lang.String id)

    - #### getExecutionLock

          public java.util.concurrent.locks.ReentrantLock getExecutionLock()

      Description copied from interface: `ActionDefinition`
      Returns the execution lock
      Specified by:
        `getExecutionLock` in interface `ActionDefinition`

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

    - #### addPropertyChangeListener

          public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

    - #### isHeadless

          public boolean isHeadless()

      Description copied from interface: `ActionDefinition`
      Returns true if action supports non-interactive execution.
      Specified by:
        `isHeadless` in interface `ActionDefinition`

    - #### getPermissions

          public Permissions getPermissions()

      Description copied from interface: `ActionDefinition`
      Returns permissions required to execute action.
      Specified by:
        `getPermissions` in interface `ActionDefinition`

    - #### setPermissions

          public void setPermissions(Permissions permissions)

    - #### compareTo

          public int compareTo(java.lang.Object o)

      Specified by:
        `compareTo` in interface `java.lang.Comparable`

    - #### getEntityType

          public java.lang.Integer getEntityType()

      Specified by:
        `getEntityType` in interface `EntityDefinition`
      Overrides:
        `getEntityType` in class `AbstractEntityDefinition`