Class AbstractKeyboardAction
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.flow.tree.keyboardaction.AbstractKeyboardAction
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractAddTemplate
,AbstractFavoriteActor
,AbstractKeyboardActionWithActor
,AbstractQuickSearchActor
,AbstractSearchActor
,ActionQuickSearch
,QuickAction
public abstract class AbstractKeyboardAction extends AbstractOptionHandler
Ancestor for flow tree actions that are associated with .- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Name
the name of the action.protected BaseShortcut
m_Shortcut
the shortcut.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractKeyboardAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(StateContainer state)
Checks whether the current state is suitable.void
defineOptions()
Adds options to the internal list of options.protected abstract String
doExecute(StateContainer state)
Performs the actual execution of the action.String
execute(StateContainer state)
Executes the action.protected String
getDefaultName()
Returns the default name of the action.protected abstract BaseShortcut
getDefaultShortcut()
Returns the default shortcut of the action.String
getName()
Returns the name of the action.BaseShortcut
getShortcut()
Returns the shortcut of the action.String
nameTipText()
Returns the tip text for this property.protected void
postExecute(StateContainer state, boolean success)
Performs post-execution operations.void
setName(String value)
Sets the name of the action.void
setShortcut(BaseShortcut value)
Sets the shortcut of the action.String
shortcutTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Name
protected String m_Name
the name of the action.
-
m_Shortcut
protected BaseShortcut m_Shortcut
the shortcut.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
getDefaultName
protected String getDefaultName()
Returns the default name of the action.- Returns:
- the default
-
setName
public void setName(String value)
Sets the name of the action.- Parameters:
value
- the name
-
getName
public String getName()
Returns the name of the action.- Returns:
- the name
-
nameTipText
public String nameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultShortcut
protected abstract BaseShortcut getDefaultShortcut()
Returns the default shortcut of the action.- Returns:
- the default
-
setShortcut
public void setShortcut(BaseShortcut value)
Sets the shortcut of the action.- Parameters:
value
- the shortcut
-
getShortcut
public BaseShortcut getShortcut()
Returns the shortcut of the action.- Returns:
- the shortcut
-
shortcutTipText
public String shortcutTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected String check(StateContainer state)
Checks whether the current state is suitable.
Default implementation only ensures that a state has been provided.- Parameters:
state
- the current state- Returns:
- null if OK, otherwise error message
-
doExecute
protected abstract String doExecute(StateContainer state)
Performs the actual execution of the action.- Parameters:
state
- the current state- Returns:
- null if OK, otherwise error message
-
postExecute
protected void postExecute(StateContainer state, boolean success)
Performs post-execution operations.
Default implementation returns the focus to the flow tree.- Parameters:
state
- the current statesuccess
- whether the execution was successful
-
execute
public String execute(StateContainer state)
Executes the action.- Parameters:
state
- the current state- Returns:
- null if OK, otherwise error message
-
-