Class CommonAction<RETURNTYPE>

java.lang.Object
de.tsl2.nano.action.CommonAction<RETURNTYPE>
Type Parameters:
RETURNTYPE -
All Implemented Interfaces:
IAction<RETURNTYPE>, Serializable, Comparable<CommonAction<RETURNTYPE>>, Runnable

public abstract class CommonAction<RETURNTYPE> extends Object implements IAction<RETURNTYPE>, Serializable, Comparable<CommonAction<RETURNTYPE>>
Version:
$Revision$
Author:
Thomas Schneider
See Also:
  • Field Details

    • id

      protected String id
    • shortDescription

      protected String shortDescription
    • longDescription

      protected String longDescription
    • isDefault

      protected boolean isDefault
    • isEnabled

      protected boolean isEnabled
    • synchron

      protected boolean synchron
    • keyStroke

      protected Object keyStroke
    • receiverIDs

      protected Collection<String> receiverIDs
    • enabler

      protected IActivable enabler
    • parameter

      protected Parameters parameter
    • imagePath

      protected String imagePath
    • UNNAMED

      protected static final String UNNAMED
      See Also:
    • function

      protected transient Function<?,RETURNTYPE> function
      while a function is not really serializeable/changeable/deserializeable, this function should only be used, where the action should not be deserialized!

      NOTE: technically it is possible to serialize the function, e.g.: (Runnable & Serializable) () -> doSomething;. but it is not changable inside a readable xml serialization like in simple-xml.

  • Constructor Details

    • CommonAction

      public CommonAction()
      The default constructor can be used for hidden actions. This are action, not connected to a user interface like a button.
    • CommonAction

      public CommonAction(String id)
      Parameters:
      id - unique id
    • CommonAction

      public CommonAction(String id, Function<?,RETURNTYPE> function)
    • CommonAction

      public CommonAction(String id, String shortDescription, String longDescription)
      Parameters:
      id - unique id
      shortDescription - name of the button (representing this action).
      longDescription - tooltip text of the button (representing this action).
    • CommonAction

      public CommonAction(String id, String shortDescription, String longDescription, Function<?,RETURNTYPE> function)
    • CommonAction

      public CommonAction(String id, String shortDescription, String longDescription, IActivable actionEnabler, Function<?,RETURNTYPE> function)
      Parameters:
      id - unique id
      shortDescription - name of the button (representing this action).
      longDescription - tooltip text of the button (representing this action).
      instance - for an action enabler
    • CommonAction

      public CommonAction(String id, String shortDescription, String longDescription, IActivable enabler, Collection<String> receiverIDs, Function<?,RETURNTYPE> function)
      Parameters:
      id - unique id
      shortDescription - name of the button (representing this action).
      longDescription - tooltip text of the button (representing this action).
      enabler - is able to to functional checks for button enabling
      receiverIDs - ids of visible components to receive the result of this action.
    • CommonAction

      public CommonAction(String id, boolean isDefault, boolean isEnabled, Object keyStroke, String shortDescription, String longDescription, boolean synchron, IActivable actionEnabler, Collection<String> receiverIDs, Function<?,RETURNTYPE> function)
      Constructor
      Parameters:
      id - unique id
      isDefault - whether the button (representing this action) is the default button.
      isEnabled - whether the button (representing this action) is enabled.
      keyStroke - button key stroke
      longDescription - tooltip text of the button (representing this action).
      shortDescription - name of the button (representing this action).
      synchron - whether this method is synchron or asynchron.
      function -
  • Method Details