public abstract class AbstractMDIAction extends javax.swing.AbstractAction implements MDIAction
Modifier and Type | Field and Description |
---|---|
protected MDIApplication |
app
The application.
|
protected MDIActionHandler |
handler
The action handler.
|
Constructor and Description |
---|
AbstractMDIAction()
Defines an AbstractMDIAction object with a default description string and default icon.
|
AbstractMDIAction(MDIApplication app)
Defines an AbstractMDIAction object with a default description string and default icon.
|
AbstractMDIAction(MDIApplication app,
java.lang.String name)
Defines an AbstractMDIAction object with a specified description string and default icon.
|
AbstractMDIAction(MDIApplication app,
java.lang.String name,
javax.swing.Icon icon)
Defines an AbstractMDIAction object with specified description string and icon.
|
AbstractMDIAction(java.lang.String name)
Defines an AbstractMDIAction object with a specified description string and default icon.
|
AbstractMDIAction(java.lang.String name,
javax.swing.Icon icon)
Defines an AbstractMDIAction object with specified description string and icon.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
endAction()
Code to perform after the end of the MDIAction (for example creating a new tab for the MDIApplication, with the result of the MDIAction.
|
void |
executeAction()
Execute the Action.
|
java.lang.Object |
executeAction(boolean inSameThread)
Execute the Action.
|
MDIActionHandler |
getActionHandler()
Return the associated MDIActionHandler, or null if there is none.
|
protected java.lang.String |
getActionName()
Return the action name.
|
java.lang.String |
getLongDescription()
Return the long description of this MDIAction, which is the Action.LONG_DESCRIPTION of
the AbstractAction from which it derives.
|
java.lang.String |
getMessage()
Get the message associated with the action.
|
java.lang.String |
getShortDescription()
Return a short description of the action.
|
abstract void |
run()
Run the action.
|
void |
setActionHandler(MDIActionHandler handler)
Set the MDIActionHandler for this AbstractMDIAction (null by default).
|
void |
setDescription(java.lang.String shortDesc,
java.lang.String longDesc)
Set the short and long description of this MDIAction.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getActionResult
protected MDIActionHandler handler
protected MDIApplication app
public AbstractMDIAction()
public AbstractMDIAction(java.lang.String name)
name
- the Action namepublic AbstractMDIAction(java.lang.String name, javax.swing.Icon icon)
name
- the Action nameicon
- the Action Iconpublic AbstractMDIAction(MDIApplication app)
app
- the applicationpublic AbstractMDIAction(MDIApplication app, java.lang.String name)
app
- the applicationname
- the nameapp
public AbstractMDIAction(MDIApplication app, java.lang.String name, javax.swing.Icon icon)
app
- the applicationname
- the nameicon
- the iconprotected java.lang.String getActionName()
public void setActionHandler(MDIActionHandler handler)
setActionHandler
in interface MDIAction
handler
- the handlerpublic java.lang.String getShortDescription()
getShortDescription
in interface MDIAction
public void setDescription(java.lang.String shortDesc, java.lang.String longDesc)
shortDesc
- the short descriptionlongDesc
- the long descriptionpublic java.lang.String getLongDescription()
getLongDescription
in interface MDIAction
public MDIActionHandler getActionHandler()
getActionHandler
in interface MDIAction
MDIAction.setActionHandler(MDIActionHandler)
public void endAction()
public java.lang.String getMessage()
getLongDescription()
.getMessage
in interface MDIAction
public void actionPerformed(java.awt.event.ActionEvent e)
MDIApplication.executeAction(MDIAction)
.
The Action will ensure that the Plugins ClassLoader will be used for the
execution, to be sure that any additional libraries, only available in the Plugin.actionPerformed
in interface java.awt.event.ActionListener
e
- the Action Eventpublic void executeAction()
actionPerformed(ActionEvent)
public java.lang.Object executeAction(boolean inSameThread)
inSameThread
- true if the execution must be performed in the current threadactionPerformed(ActionEvent)
public abstract void run() throws java.lang.Exception
ThreadQueue
, the
exception will be swallowed by the framework, and presented in an error panel after. Note that this method will be perfoemd in a background Thread.