Package org.gvsig.andami.actioninfo.impl
Class DefaultActionInfo
java.lang.Object
javax.swing.AbstractAction
org.gvsig.andami.actioninfo.impl.DefaultActionInfo
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,ActionInfo,org.gvsig.tools.lang.Cloneable
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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_ICONFields inherited from interface org.gvsig.andami.actioninfo.ActionInfo
ACCELERATOR, ACTIVE, EXTENSION, EXTENSION_NAME, ICON_NAME, PLUGIN, PLUGIN_NAME, POSITION, REDIRECTION, REDIRECTIONS, TOOLTIP, VISIBLE -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent arg0) clone()voidexecute()Execute the code asociated to the action.voidExecute the code asociated to the action.voidExecute the code asociated to the action.voidreturns a representation human readable of the accelerator to be used associated to the action.Returns the command used for invoking the execute method of the extension asociated to this action.returns the extension asociated to the action.Returns the extension name of the extension asociated to this action.getIcon()Return an icon asociated to the action.Returns the name of icon asociated to the action.returns the KeyStroke which represents the accelerator of this action.getLabel()Return a label asociated to the action.getName()Returns the name of the action.returns the plugin of the extension asociated to the action.Return the plugin name of the plugin asociated to the action.longReturn the position absolute of the action referred to all actions.An action can redirect the execution of the execute, isVisible and isEnabled methods to other action.Return a string that represents a tip asociated whit the action, usually used as tooltip in buttons or menus.booleanisActive()Return true is the action is active.booleanretrurn if the action is enables.booleanretrurn if the action can be visible in the user interface or not.voidmerge(ActionInfo other) voidvoidsetActive(boolean active) Set the active state of an ActionInfo.toString()Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, removePropertyChangeListener, setEnabled
-
Method Details
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classAbstractAction- Throws:
CloneNotSupportedException
-
getRedirections
Description copied from interface:ActionInfoAn action can redirect the execution of the execute, isVisible and isEnabled methods to other action. Using this method is can be query and set this redirections. The redirect will be established only if the method isEnabled of target action returns true. Otherwise execute methods of initial action.- Specified by:
getRedirectionsin interfaceActionInfo- Returns:
- the redirections established for this action
-
merge
-
getPlugin
Description copied from interface:ActionInforeturns the plugin of the extension asociated to the action.- Specified by:
getPluginin interfaceActionInfo- Returns:
- pluginServices asiciated to the action.
-
getPluginName
Description copied from interface:ActionInfoReturn the plugin name of the plugin asociated to the action. This is a utility method checkins null values. is equivalent to: action.getPlugin().getPluginName()- Specified by:
getPluginNamein interfaceActionInfo- Returns:
- plugin name
- See Also:
-
getExtension
Description copied from interface:ActionInforeturns the extension asociated to the action. The action delegates the methods isEnabled, isVisible and execute in this extension when these are invoked.- Specified by:
getExtensionin interfaceActionInfo- Returns:
- IExtension asociated to the action
-
getExtensionName
Description copied from interface:ActionInfoReturns the extension name of the extension asociated to this action. This a utility method that check null values. Is equivalent to: action.getExtension().getClass().getName()- Specified by:
getExtensionNamein interfaceActionInfo- Returns:
- extension name.
- See Also:
-
isVisible
public boolean isVisible()Description copied from interface:ActionInforetrurn if the action can be visible in the user interface or not. This method call the isVisible of the extension asociated to the action, unless the action is inactive. If has a ExclusiveUIExtension set, then this is invoqued instead of the the isVisible of the extension.- Specified by:
isVisiblein interfaceActionInfo- Returns:
- if the action if visible for the user.
-
isEnabled
public boolean isEnabled()Description copied from interface:ActionInforetrurn if the action is enables. This method call the isEnabled of the extension asociated to the action, unless the action is inactive. This method is used to determine whether it is possible to redirect to this action or not. If has a ExclusiveUIExtension set, then this is invoqued instead of the the isEnabled of the extension.- Specified by:
isEnabledin interfaceAction- Specified by:
isEnabledin interfaceActionInfo- Overrides:
isEnabledin classAbstractAction- Returns:
- if the action if visible for the user.
-
execute
public void execute()Description copied from interface:ActionInfoExecute the code asociated to the action. This method call the execute method of the asociated exetnsion using the command of action as argument. If the action is redirected try to call to the redirected actions.- Specified by:
executein interfaceActionInfo
-
execute
Description copied from interface:ActionInfoExecute the code asociated to the action. Pass the args to the execute of the asociated extension.- Specified by:
executein interfaceActionInfo- See Also:
-
execute
Description copied from interface:ActionInfoExecute the code asociated to the action. Pass the args to the execute of the asociated extension.- Specified by:
executein interfaceActionInfo- See Also:
-
execute
- Specified by:
executein interfaceActionInfo
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
getName
Description copied from interface:ActionInfoReturns the name of the action. This name is usaed to retrieve the action thwros the manager.- Specified by:
getNamein interfaceActionInfo- Returns:
- action name
-
getLabel
Description copied from interface:ActionInfoReturn a label asociated to the action. This label can be used in buttons, o menus.- Specified by:
getLabelin interfaceActionInfo- Returns:
- label of action
-
getCommand
Description copied from interface:ActionInfoReturns the command used for invoking the execute method of the extension asociated to this action.- Specified by:
getCommandin interfaceActionInfo- Returns:
- command of action
-
getIconName
Description copied from interface:ActionInfoReturns the name of icon asociated to the action. This name is used to retrive the icon from the current icon theme of the application.- Specified by:
getIconNamein interfaceActionInfo- Returns:
- icon name.
-
getIcon
Description copied from interface:ActionInfoReturn an icon asociated to the action. This icon can be used in buttons, o menus.- Specified by:
getIconin interfaceActionInfo- Returns:
- ImageIcon asociated tho the action
-
getAccelerator
Description copied from interface:ActionInforeturns a representation human readable of the accelerator to be used associated to the action.- Specified by:
getAcceleratorin interfaceActionInfo- Returns:
- String representing the accelerator
-
getKeyStroke
Description copied from interface:ActionInforeturns the KeyStroke which represents the accelerator of this action.- Specified by:
getKeyStrokein interfaceActionInfo- Returns:
- keystroke asociated to this action
- See Also:
-
getPosition
public long getPosition()Description copied from interface:ActionInfoReturn the position absolute of the action referred to all actions.- Specified by:
getPositionin interfaceActionInfo- Returns:
- the position of the action
-
getTooltip
Description copied from interface:ActionInfoReturn a string that represents a tip asociated whit the action, usually used as tooltip in buttons or menus.- Specified by:
getTooltipin interfaceActionInfo- Returns:
- the tip of the action
-
getValue
- Specified by:
getValuein interfaceAction- Overrides:
getValuein classAbstractAction
-
putValue
- Specified by:
putValuein interfaceAction- Overrides:
putValuein classAbstractAction
-
toString
-
isActive
public boolean isActive()Description copied from interface:ActionInfoReturn true is the action is active. When an action is active the methods isEnable and isVisible call the methods of the extension asociated to this. When is inactive always return false.- Specified by:
isActivein interfaceActionInfo- Returns:
- if the action is active
-
setActive
public void setActive(boolean active) Description copied from interface:ActionInfoSet the active state of an ActionInfo. When the active state is set to false, isEnabled, and isVisible returns false.- Specified by:
setActivein interfaceActionInfo- Parameters:
active-
-