RETURNTYPE - public abstract class CommonAction<RETURNTYPE> extends Object implements IAction<RETURNTYPE>, Serializable, Comparable<CommonAction<RETURNTYPE>>
| Modifier and Type | Field and Description |
|---|---|
protected IActivable |
enabler |
protected String |
id |
protected String |
imagePath |
protected boolean |
isDefault |
protected boolean |
isEnabled |
protected Object |
keyStroke |
protected String |
longDescription |
protected Parameters |
parameter |
protected Collection<String> |
receiverIDs |
protected String |
shortDescription |
protected boolean |
synchron |
protected static String |
UNNAMED |
CANCELED, MODE_DLG_CANCEL, MODE_DLG_OK, MODE_UNDEFINED| Constructor and Description |
|---|
CommonAction()
The default constructor can be used for hidden actions.
|
CommonAction(String id) |
CommonAction(String id,
boolean isDefault,
boolean isEnabled,
Object keyStroke,
String shortDescription,
String longDescription,
boolean synchron,
IActivable actionEnabler,
Collection<String> receiverIDs)
Constructor
|
CommonAction(String id,
String shortDescription,
String longDescription) |
CommonAction(String id,
String shortDescription,
String longDescription,
IActivable actionEnabler) |
CommonAction(String id,
String shortDescription,
String longDescription,
IActivable enabler,
Collection<String> receiverIDs) |
| Modifier and Type | Method and Description |
|---|---|
RETURNTYPE |
activate()
if the action is asynchron, the result will be mostly null.
|
int |
compareTo(CommonAction<RETURNTYPE> o) |
boolean |
equals(Object obj) |
int |
getActionMode()
action mode. e.g. on dialogs it is usable to define the buttons result type. see
IAction.MODE_DLG_CANCEL,
IAction.MODE_DLG_OK. |
Class[] |
getArgumentTypes()
getArgumentTypes
|
IActivable |
getEnabler() |
String |
getId()
getId
|
String |
getImagePath() |
Object |
getKeyStroke()
Getter getKeyStroke
|
RETURNTYPE |
getLastResult() |
String |
getLongDescription()
getLongDescription
|
Object[] |
getParameter() |
Object |
getParameter(int i) |
Collection<String> |
getReceiverIDs()
the receivers will receive the result of the activation.
|
String |
getShortDescription()
getShortDescription
|
int |
hashCode() |
protected boolean |
isDebugMode()
override this method to enable debugging
|
boolean |
isDefault()
isDefault
|
boolean |
isEnabled()
isEnabled
|
boolean |
isRunning() |
boolean |
isSynchron()
Getter isSynchron
|
Parameters |
parameters() |
protected void |
resetCursor(Object lastCursor)
override this method to handle the mouse cursor
|
void |
run()
run
|
void |
setDefault(boolean isDefault)
setDefault
|
void |
setEnabled(boolean isEnabled)
setEnabled
|
void |
setEnabler(IActivable enabler) |
void |
setImagePath(String imagePath) |
void |
setParameter(Object... parameter) |
protected Object |
setWaitCursor()
override this method to handle the mouse cursor
|
String |
toString() |
protected String id
protected String shortDescription
protected String longDescription
protected boolean isDefault
protected boolean isEnabled
protected boolean synchron
protected Object keyStroke
protected Collection<String> receiverIDs
protected IActivable enabler
protected Parameters parameter
protected String imagePath
protected static final String UNNAMED
public CommonAction()
public CommonAction(String id)
id - unique idpublic CommonAction(String id, String shortDescription, String longDescription)
id - unique idshortDescription - name of the button (representing this action).longDescription - tooltip text of the button (representing this action).public CommonAction(String id, String shortDescription, String longDescription, IActivable actionEnabler)
id - unique idshortDescription - name of the button (representing this action).longDescription - tooltip text of the button (representing this action).instance - for an action enablerpublic CommonAction(String id, String shortDescription, String longDescription, IActivable enabler, Collection<String> receiverIDs)
id - unique idshortDescription - 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 enablingreceiverIDs - ids of visible components to receive the result of this action.public CommonAction(String id, boolean isDefault, boolean isEnabled, Object keyStroke, String shortDescription, String longDescription, boolean synchron, IActivable actionEnabler, Collection<String> receiverIDs)
id - unique idisDefault - whether the button (representing this action) is the default button.isEnabled - whether the button (representing this action) is enabled.keyStroke - button key strokelongDescription - tooltip text of the button (representing this action).shortDescription - name of the button (representing this action).synchron - whether this method is synchron or asynchron.public boolean isEnabled()
isEnabled in interface IAction<RETURNTYPE>IAction.isEnabled()public void setEnabled(boolean isEnabled)
setEnabled in interface IAction<RETURNTYPE>isEnabled - The isEnabled to set.IAction.setEnabled(boolean)public IActivable getEnabler()
public void setEnabler(IActivable enabler)
enabler - The enabler to set.public String getId()
getId in interface IAction<RETURNTYPE>IAction.getId()public String getShortDescription()
getShortDescription in interface IAction<RETURNTYPE>IAction.getShortDescription()public String getLongDescription()
getLongDescription in interface IAction<RETURNTYPE>IAction.getLongDescription()public boolean isDefault()
isDefault in interface IAction<RETURNTYPE>IAction.isDefault()public void setDefault(boolean isDefault)
setDefault in interface IAction<RETURNTYPE>isDefault - whether to set the action as default actionpublic boolean isSynchron()
isSynchron in interface IAction<RETURNTYPE>public void run()
run in interface RunnableRunnable.run()protected boolean isDebugMode()
public RETURNTYPE activate()
activate in interface IAction<RETURNTYPE>IAction.activate()protected Object setWaitCursor()
protected void resetCursor(Object lastCursor)
lastCursor - cursor to be setpublic Collection<String> getReceiverIDs()
IActiongetReceiverIDs in interface IAction<RETURNTYPE>public Parameters parameters()
public Class[] getArgumentTypes()
IActiongetArgumentTypes in interface IAction<RETURNTYPE>IAction.getParameter() and
IAction.setParameter(Object...). default is nullpublic Object[] getParameter()
getParameter in interface IAction<RETURNTYPE>public Object getParameter(int i)
getParameter in interface IAction<RETURNTYPE>public void setParameter(Object... parameter)
setParameter in interface IAction<RETURNTYPE>parameter - The parameter to set.public String getImagePath()
getImagePath in interface IAction<RETURNTYPE>public RETURNTYPE getLastResult()
public Object getKeyStroke()
IActiongetKeyStroke in interface IAction<RETURNTYPE>public void setImagePath(String imagePath)
public int compareTo(CommonAction<RETURNTYPE> o)
compareTo in interface Comparable<CommonAction<RETURNTYPE>>public int getActionMode()
IAction.MODE_DLG_CANCEL,
IAction.MODE_DLG_OK.getActionMode in interface IAction<RETURNTYPE>public boolean isRunning()
isRunning in interface IAction<RETURNTYPE>Copyright © 2012–2018. All rights reserved.