projectviewer.action
Class EditProjectAction

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

public class EditProjectAction
extends Action

Action that when executed creates a new project or edits an existing one.

Version:
$Id: EditProjectAction.java 9220 2007-03-27 03:44:56Z vanza $
Author:
Marcelo Vanzin

Field Summary
 
Fields inherited from class projectviewer.action.Action
action, cmItem, tbButton, viewer
 
Constructor Summary
EditProjectAction()
          Default constructor.
EditProjectAction(boolean forceNew, VPTGroup parent)
          If forceNew is true, creation of new project will be forced.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Creates a new project.
 javax.swing.Icon getIcon()
          Returns the icon to be shown on the toolbar button.
 java.lang.String getText()
          Returns the text to be shown on the button and/or menu item.
 void prepareForNode(VPTNode node)
          Enable action only for the root node.
 
Methods inherited from class projectviewer.action.Action
clone, getButton, getMenuItem, setViewer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditProjectAction

public EditProjectAction()
Default constructor.


EditProjectAction

public EditProjectAction(boolean forceNew,
                         VPTGroup parent)
If forceNew is true, creation of new project will be forced. The default parent is only allowed to be set if forceNew is true.

Method Detail

getText

public java.lang.String getText()
Returns the text to be shown on the button and/or menu item.

Specified by:
getText in class Action

getIcon

public javax.swing.Icon getIcon()
Returns the icon to be shown on the toolbar button. The default implementation returns "null" so that actions that will only be used in the context menu don't need to implement this.

Overrides:
getIcon in class Action

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Creates a new project.


prepareForNode

public void prepareForNode(VPTNode node)
Enable action only for the root node.

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