projectviewer.action
Class AddProjectAction

java.lang.Object
  extended by projectviewer.action.Action
      extended by projectviewer.action.AddProjectAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, java.lang.Comparable<Action>, java.util.EventListener

public class AddProjectAction
extends Action

Action that when executed creates a new project.

Since:
3.4.2

Field Summary
static int NO_FLAGS
           
static int NO_IMPORT
           
 
Fields inherited from class projectviewer.action.Action
action, cmItem, viewer
 
Constructor Summary
AddProjectAction(VPTGroup parent)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Creates a new project.
static VPTProject createProject(VPTGroup parent, int flags)
          Creates a new project and opens a dialog for it.
static VPTProject createProject(VPTProject proj, VPTGroup parent, int flags)
          Creates a new project and opens a dialog for it.
 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, compareTo, equals, getMenuItem, setViewer
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_FLAGS

public static final int NO_FLAGS
See Also:
Constant Field Values

NO_IMPORT

public static final int NO_IMPORT
See Also:
Constant Field Values
Constructor Detail

AddProjectAction

public AddProjectAction(VPTGroup parent)
Parameters:
parent - The group under which a project will be added. If null, active node or its parents will be used.
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

createProject

public static VPTProject createProject(VPTProject proj,
                                       VPTGroup parent,
                                       int flags)
Creates a new project and opens a dialog for it. This method does not rely on the active node of the tree. It performs all necessary operations related to the dialog.

This method should not be called from outside Project Viewer. For external api see are similar methods in PVActions.

Parameters:
proj - A new VPTProject object, with some fields set by the caller. May be null.
parent - A parent group. If null, root node assumed.
flags - NO_IMPORT or NO_FLAGS
Returns:
null if user cancelled the dialog.

createProject

public static VPTProject createProject(VPTGroup parent,
                                       int flags)
Creates a new project and opens a dialog for it. This method does not rely on the active node of the tree. It performs all necessary operations related to the dialog.

This method should not be called from outside Project Viewer. For external api see are similar methods in PVActions.

Parameters:
parent - A parent group. If null, root node assumed.
flags - NO_IMPORT or NO_FLAGS
Returns:
null if user cancelled the dialog.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Creates a new project. If parent member is not set, gets it from the currently selected node.


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.