public class ProjectSensitiveActions extends Object
Modifier and Type | Method and Description |
---|---|
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.
|
public static Action projectCommandAction(String command, String namePattern, Icon icon)
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.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)public static Action projectSensitiveAction(ProjectActionPerformer performer, String namePattern, Icon icon)
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.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.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?)