Package jmri.util.swing
Class JmriAbstractAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.util.swing.JmriAbstractAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
AboutAction
,AbstractRosterItemAction
,AnalogClockAction
,CabSignalAction
,ChangePasswordAction
,CheckForUpdateAction
,ConsistToolAction
,CopyRosterGroupAction
,CreateRosterGroupAction
,CtcEditorAction
,CtcRunAction
,DecoderIndexCreateAction
,DecoderPro3Action
,DecoderProAction
,DeleteRosterGroupAction
,DeleteRosterItemAction
,DemoSerialPortAction
,DualDecoderToolAction
,FirstTimeStartUpWizardAction
,FullBackupExportAction
,InstallDecoderURLAction
,InstallFromURL
,JmriNamedPaneAction
,LccProAction
,LccProFrameAction
,LcdClockAction
,LicenseAction
,LoadDefaultXmlThrottlesLayoutAction
,LoginAction
,LogoutAction
,NixieClockAction
,PanelProAction
,PanelProAction
,PaneProgDp3Action
,PragotronClockAction
,PrintListAction
,PrintRosterAction
,QuitAction
,RecreateRosterAction
,RefreshAction
,RenameRosterGroupAction
,ReportContextAction
,RestartAction
,RosterFrameAction
,RosterGroupTableAction
,RunJythonScript
,SampleToolsMenuItem
,SimpleClockAction
,SimpleProgAction
,SimpleTurnoutCtrlAction
,SpeedometerAction
,SpeedProfileAction
,SystemConsoleAction
,TabbedPreferencesAction
,ThrottleCreationAction
,ThrottlesListAction
,TimeTableAction
,UpdateDecoderDefinitionAction
,WebServerAction
,WhereUsedAction
,WhereUsedAction
,WiThrottleCreationAction
,XmlFileCheckAction
,XmlFileValidateAction
,Z21serverCreationAction
public abstract class JmriAbstractAction extends javax.swing.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 EitheractionPerformed(java.awt.event.ActionEvent)
ormakePanel()
must be overridden by extending classes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) JmriPanel
cache
protected java.lang.Object
context
protected WindowInterface.Hint
hint
protected WindowInterface
wi
-
Constructor Summary
Constructors Constructor Description JmriAbstractAction(java.lang.String name)
Original constructor for compatibility with older menus.JmriAbstractAction(java.lang.String s, javax.swing.Icon i, WindowInterface wi)
JmriAbstractAction(java.lang.String name, WindowInterface wi)
Enhanced constructor for placing the pane in various GUIs.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
void
dispose()
abstract JmriPanel
makePanel()
void
setContext(java.lang.Object context)
Set the context for this action.JmriAbstractAction
setHint(WindowInterface.Hint hint)
void
setName(java.lang.String name)
void
setParameter(java.lang.String parameter, java.lang.Object value)
void
setParameter(java.lang.String parameter, java.lang.String value)
void
setWindowInterface(WindowInterface wi)
java.lang.String
toString()
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
hint
protected WindowInterface.Hint hint
-
wi
protected WindowInterface wi
-
context
protected java.lang.Object context
-
-
Constructor Detail
-
JmriAbstractAction
public JmriAbstractAction(java.lang.String name, WindowInterface wi)
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
public JmriAbstractAction(java.lang.String s, javax.swing.Icon i, WindowInterface wi)
-
JmriAbstractAction
public JmriAbstractAction(java.lang.String name)
Original constructor for compatibility with older menus. Assumes SDI GUI.- Parameters:
name
- the name for the action; a value of null is ignored
-
-
Method Detail
-
setContext
public void setContext(java.lang.Object context)
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
public void setWindowInterface(WindowInterface wi)
-
setName
public void setName(java.lang.String name)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setHint
public JmriAbstractAction setHint(WindowInterface.Hint hint)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
dispose
public void dispose()
-
setParameter
public void setParameter(java.lang.String parameter, java.lang.String value)
-
setParameter
public void setParameter(java.lang.String parameter, java.lang.Object value)
-
-