projectviewer.action
Class ActionSeparator

java.lang.Object
  extended byprojectviewer.action.Action
      extended byprojectviewer.action.ActionSeparator
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener

public class ActionSeparator
extends Action

Small hack to enable a separator to be shown when some other action is also shown.

Version:
$Id: ActionSeparator.java 7059 2006-09-17 20:58:10Z ezust $
Author:
Marcelo Vanzin

Field Summary
 
Fields inherited from class projectviewer.action.Action
action, cmItem, tbButton, viewer
 
Constructor Summary
ActionSeparator()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Does nothing.
 javax.swing.JComponent getMenuItem()
          Returns a separator.
 java.lang.String getText()
          Returns null.
 void prepareForNode(VPTNode node)
          Shows the separator if the linked action is visible or null and only a single node is selected.
 void setLinkedAction(Action linked)
          Sets the linked action.
 void setLinkedActions(java.util.List actions)
          Set a list of actions that will define whether the separator is shown; it will be show iff all the actions in the list are visible.
 
Methods inherited from class projectviewer.action.Action
clone, getButton, getIcon, setViewer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionSeparator

public ActionSeparator()
Method Detail

setLinkedAction

public void setLinkedAction(Action linked)
Sets the linked action. The separator will be shown if and only if the component returned by getMenuItem() is visible, i.e., the "isVisible()" method returns true.


setLinkedActions

public void setLinkedActions(java.util.List actions)
Set a list of actions that will define whether the separator is shown; it will be show iff all the actions in the list are visible.


getText

public java.lang.String getText()
Returns null. There's no text in this separator.

Specified by:
getText in class Action

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Does nothing.


prepareForNode

public void prepareForNode(VPTNode node)
Shows the separator if the linked action is visible or null and only a single node is selected.

Overrides:
prepareForNode in class Action
Parameters:
node - The selected node, or "null" if multiple nodes are selected.

getMenuItem

public javax.swing.JComponent getMenuItem()
Returns a separator.

Overrides:
getMenuItem in class Action