org.netbeans.modules.projectuiapi/1 1.51.1 8

org.netbeans.spi.project.ui.support
Class ProjectSensitiveActions

java.lang.Object
  extended by org.netbeans.spi.project.ui.support.ProjectSensitiveActions

public class ProjectSensitiveActions
extends Object

Factory for creating project-sensitive actions.


Method Summary
static Action projectCommandAction(String command, String namePattern, Icon icon)
          Creates an action sensitive to the set of currently selected projects.
static Action projectSensitiveAction(ProjectActionPerformer performer, String namePattern, Icon icon)
          Creates an action sensitive to the set of currently selected projects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

projectCommandAction

public static Action projectCommandAction(String command,
                                          String namePattern,
                                          Icon icon)
Creates an action sensitive to the set of currently selected projects. When performed the action will call the given command on the ActionProvider of the selected project(s). The action will only be enabled when exactly one project is selected and the command is enabled in the project's action provider.
Shortcuts for actions are shared according to command, i.e. actions based on the same command will have the same shortcut.

Parameters:
command - the command which should be invoked when the action is performed (see e.g. constants in ActionProvider)
namePattern - a pattern which should be used for determining the action's name (label). It takes two parameters a la MessageFormat: {0} - number of selected projects; {1} - name of the first project.
icon - icon of the action (or null)
Returns:
an action sensitive to the current project

projectSensitiveAction

public static Action projectSensitiveAction(ProjectActionPerformer performer,
                                            String namePattern,
                                            Icon icon)
Creates an action sensitive to the set of currently selected projects. When performed the action will call ProjectActionPerformer.perform(org.netbeans.api.project.Project) on the action performer supplied as a parameter. The action will only be enabled when exactly one project is selected and ProjectActionPerformer.enable(org.netbeans.api.project.Project) returns true.
Note that it is not guaranteed that ProjectActionPerformer.enable(org.netbeans.api.project.Project) will be called unless the project selection changes and someone is listening to the action or explicitly asks for some of the action's values.

Parameters:
performer - an action performer.
namePattern - pattern which should be used for determining the action's name (label). It takes two parameters a la MessageFormat: {0} - number of selected projects; {1} - name of the first project.
icon - icon of the action (XXX or null?)
Returns:
an action sensitive to the current project

org.netbeans.modules.projectuiapi/1 1.51.1 8

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.