public abstract class CayenneAction extends AbstractAction
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
alwaysOn |
protected Application |
application |
changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
CayenneAction(String name,
Application application)
Creates a named CayenneAction.
|
CayenneAction(String name,
Application application,
String shortDescription)
Creates a named CayenneAction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
Internally calls
performAction. |
JButton |
buildButton()
Factory method that creates a button hooked up to this action.
|
JCheckBoxMenuItem |
buildCheckBoxMenu()
Factory method that creates a checkbox menu item hooked up to this action.
|
JMenuItem |
buildMenu()
Factory method that creates a menu item hooked up to this action.
|
Icon |
createIcon()
Creates and returns an ImageIcon that can be used for buttons that rely on this
action.
|
boolean |
enableForPath(ConfigurationNode object)
Returns
true if the action is enabled for the specified "project
path" - a path on the project tree to a currently selected object. |
KeyStroke |
getAcceleratorKey()
Returns keyboard shortcut for this action.
|
Application |
getApplication() |
protected Project |
getCurrentProject() |
String |
getIconName()
Returns the name of the icon that should be used for buttons.
|
String |
getKey()
Returns the key under which this action should be stored in the ActionMap.
|
ProjectController |
getProjectController()
Returns current project controller.
|
boolean |
isAlwaysOn()
Returns true if this action is always enabled.
|
abstract void |
performAction(ActionEvent e)
Subclasses must implement this method instead of
actionPerformed to
allow for exception handling. |
void |
setAlwaysOn(boolean alwaysOn)
Sets the alwaysOn.
|
void |
setEnabled(boolean b)
Overrides super implementation to take into account "alwaysOn" flag.
|
void |
setName(String newName)
Changes the name of this action, propagating the change to all widgets using this
action.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListenerprotected boolean alwaysOn
protected Application application
public CayenneAction(String name, Application application)
public CayenneAction(String name, Application application, String shortDescription)
public Application getApplication()
protected Project getCurrentProject()
public void setName(String newName)
public KeyStroke getAcceleratorKey()
null.public String getIconName()
RESOURCE_PATH. Default implementation returns
null.public Icon createIcon()
null if getIconName returns
null.public String getKey()
public abstract void performAction(ActionEvent e)
actionPerformed to
allow for exception handling.public boolean enableForPath(ConfigurationNode object)
true if the action is enabled for the specified "project
path" - a path on the project tree to a currently selected object. Default
implementation simply returns false.public ProjectController getProjectController()
public void actionPerformed(ActionEvent e)
performAction. Traps exceptions that ocurred
during action processing.public JMenuItem buildMenu()
public JCheckBoxMenuItem buildCheckBoxMenu()
public JButton buildButton()
public boolean isAlwaysOn()
public void setAlwaysOn(boolean alwaysOn)
alwaysOn - The alwaysOn to setpublic void setEnabled(boolean b)
setEnabled in interface ActionsetEnabled in class AbstractActionCopyright © 2001–2015 Apache Cayenne. All rights reserved.