Package jmri.util.swing
Class JmriAbstractAction
java.lang.Object
javax.swing.AbstractAction
jmri.util.swing.JmriAbstractAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
AboutAction
,AboutAction
,AbstractRosterItemAction
,CabSignalAction
,CheckForUpdateAction
,ConsistToolAction
,CopyRosterGroupAction
,CreateRosterGroupAction
,CtcEditorAction
,CtcRunAction
,DecoderIndexCreateAction
,DecoderPro3Action
,DecoderProAction
,DeleteRosterGroupAction
,DeleteRosterItemAction
,DualDecoderToolAction
,FirstTimeStartUpWizardAction
,FullBackupExportAction
,InstallDecoderURLAction
,InstallFromURL
,JmriNamedPaneAction
,LicenseAction
,LoadDefaultXmlThrottlesLayoutAction
,PanelProAction
,PanelProAction
,PaneProgDp3Action
,PrintListAction
,PrintRosterAction
,QuitAction
,RecreateRosterAction
,RenameRosterGroupAction
,ReportContextAction
,RestartAction
,RosterFrameAction
,RosterGroupTableAction
,RunJythonScript
,SimpleProgAction
,SimpleTurnoutCtrlAction
,SpeedometerAction
,SpeedProfileAction
,SystemConsoleAction
,TabbedPreferencesAction
,ThrottleCreationAction
,TimeTableAction
,UpdateDecoderDefinitionAction
,WebServerAction
,WhereUsedAction
,WiThrottleCreationAction
,XmlFileCheckAction
,XmlFileValidateAction
public abstract class JmriAbstractAction extends AbstractAction
Abstract base for actions that will work with multiple JMRI GUIs.
An opaque Object can be passed as a context, but null is also possible.
NOTE Either
actionPerformed(java.awt.event.ActionEvent)
or makePanel()
must be overridden
by extending classes.- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description (package private) JmriPanel
cache
protected Object
context
protected WindowInterface.Hint
hint
protected WindowInterface
wi
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
Constructors Constructor Description JmriAbstractAction(String name)
Original constructor for compatibility with older menus.JmriAbstractAction(String s, Icon i, WindowInterface wi)
JmriAbstractAction(String name, WindowInterface wi)
Enhanced constructor for placing the pane in various GUIs. -
Method Summary
Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
dispose()
abstract JmriPanel
makePanel()
void
setContext(Object context)
Set the context for this action.JmriAbstractAction
setHint(WindowInterface.Hint hint)
void
setName(String name)
void
setParameter(String parameter, Object value)
void
setParameter(String parameter, String value)
void
setWindowInterface(WindowInterface wi)
String
toString()
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
Constructor Details
-
JmriAbstractAction
Enhanced constructor for placing the pane in various GUIs.- Parameters:
name
- the name for the action; a value of null is ignoredwi
- the window interface controlling how this action is displayed
-
JmriAbstractAction
-
JmriAbstractAction
Original constructor for compatibility with older menus. Assumes SDI GUI.- Parameters:
name
- the name for the action; a value of null is ignored
-
-
Method Details
-
setContext
Set the context for this action. The context can be any object that an overriding class may need to complete an action. It is defined here to provide a common API for passing these objects in.- Parameters:
context
- the context object- Since:
- 2.9.4
-
setWindowInterface
-
setName
-
toString
-
setHint
-
actionPerformed
-
dispose
-
setParameter
-
setParameter
-
makePanel
-