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

public class DefaultActionInfo extends AbstractAction implements ActionInfo
See Also:
  • Method Details

    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class AbstractAction
      Throws:
      CloneNotSupportedException
    • getRedirections

      public Collection<ActionInfo> getRedirections()
      Description copied from interface: ActionInfo
      An 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:
      getRedirections in interface ActionInfo
      Returns:
      the redirections established for this action
    • merge

      public void merge(ActionInfo other)
    • getPlugin

      public PluginServices getPlugin()
      Description copied from interface: ActionInfo
      returns the plugin of the extension asociated to the action.
      Specified by:
      getPlugin in interface ActionInfo
      Returns:
      pluginServices asiciated to the action.
    • getPluginName

      public String getPluginName()
      Description copied from interface: ActionInfo
      Return 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:
      getPluginName in interface ActionInfo
      Returns:
      plugin name
      See Also:
    • getExtension

      public IExtension getExtension()
      Description copied from interface: ActionInfo
      returns the extension asociated to the action. The action delegates the methods isEnabled, isVisible and execute in this extension when these are invoked.
      Specified by:
      getExtension in interface ActionInfo
      Returns:
      IExtension asociated to the action
    • getExtensionName

      public String getExtensionName()
      Description copied from interface: ActionInfo
      Returns 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:
      getExtensionName in interface ActionInfo
      Returns:
      extension name.
      See Also:
    • isVisible

      public boolean isVisible()
      Description copied from interface: ActionInfo
      retrurn 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:
      isVisible in interface ActionInfo
      Returns:
      if the action if visible for the user.
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: ActionInfo
      retrurn 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:
      isEnabled in interface Action
      Specified by:
      isEnabled in interface ActionInfo
      Overrides:
      isEnabled in class AbstractAction
      Returns:
      if the action if visible for the user.
    • execute

      public void execute()
      Description copied from interface: ActionInfo
      Execute 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:
      execute in interface ActionInfo
    • execute

      public void execute(Object[] args)
      Description copied from interface: ActionInfo
      Execute the code asociated to the action. Pass the args to the execute of the asociated extension.
      Specified by:
      execute in interface ActionInfo
      See Also:
    • execute

      public void execute(Object arg)
      Description copied from interface: ActionInfo
      Execute the code asociated to the action. Pass the args to the execute of the asociated extension.
      Specified by:
      execute in interface ActionInfo
      See Also:
    • execute

      public void execute(Map args)
      Specified by:
      execute in interface ActionInfo
    • actionPerformed

      public void actionPerformed(ActionEvent arg0)
      Specified by:
      actionPerformed in interface ActionListener
    • getName

      public String getName()
      Description copied from interface: ActionInfo
      Returns the name of the action. This name is usaed to retrieve the action thwros the manager.
      Specified by:
      getName in interface ActionInfo
      Returns:
      action name
    • getLabel

      public String getLabel()
      Description copied from interface: ActionInfo
      Return a label asociated to the action. This label can be used in buttons, o menus.
      Specified by:
      getLabel in interface ActionInfo
      Returns:
      label of action
    • getCommand

      public String getCommand()
      Description copied from interface: ActionInfo
      Returns the command used for invoking the execute method of the extension asociated to this action.
      Specified by:
      getCommand in interface ActionInfo
      Returns:
      command of action
    • getIconName

      public String getIconName()
      Description copied from interface: ActionInfo
      Returns 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:
      getIconName in interface ActionInfo
      Returns:
      icon name.
    • getIcon

      public ImageIcon getIcon()
      Description copied from interface: ActionInfo
      Return an icon asociated to the action. This icon can be used in buttons, o menus.
      Specified by:
      getIcon in interface ActionInfo
      Returns:
      ImageIcon asociated tho the action
    • getAccelerator

      public String getAccelerator()
      Description copied from interface: ActionInfo
      returns a representation human readable of the accelerator to be used associated to the action.
      Specified by:
      getAccelerator in interface ActionInfo
      Returns:
      String representing the accelerator
    • getKeyStroke

      public KeyStroke getKeyStroke()
      Description copied from interface: ActionInfo
      returns the KeyStroke which represents the accelerator of this action.
      Specified by:
      getKeyStroke in interface ActionInfo
      Returns:
      keystroke asociated to this action
      See Also:
    • getPosition

      public long getPosition()
      Description copied from interface: ActionInfo
      Return the position absolute of the action referred to all actions.
      Specified by:
      getPosition in interface ActionInfo
      Returns:
      the position of the action
    • getTooltip

      public String getTooltip()
      Description copied from interface: ActionInfo
      Return a string that represents a tip asociated whit the action, usually used as tooltip in buttons or menus.
      Specified by:
      getTooltip in interface ActionInfo
      Returns:
      the tip of the action
    • getValue

      public Object getValue(String key)
      Specified by:
      getValue in interface Action
      Overrides:
      getValue in class AbstractAction
    • putValue

      public void putValue(String key, Object newValue)
      Specified by:
      putValue in interface Action
      Overrides:
      putValue in class AbstractAction
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isActive

      public boolean isActive()
      Description copied from interface: ActionInfo
      Return 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:
      isActive in interface ActionInfo
      Returns:
      if the action is active
    • setActive

      public void setActive(boolean active)
      Description copied from interface: ActionInfo
      Set the active state of an ActionInfo. When the active state is set to false, isEnabled, and isVisible returns false.
      Specified by:
      setActive in interface ActionInfo
      Parameters:
      active -