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

java.lang.Object
  extended byorg.netbeans.spi.project.ui.support.MainProjectSensitiveActions

public class MainProjectSensitiveActions
extends Object

Factory for creating actions sensitive to the project selected as the main project in the UI.


Method Summary
static Action mainProjectCommandAction(String command, String name, Icon icon)
          Creates an action sensitive to the project currently selected as main in the UI.
static Action mainProjectSensitiveAction(ProjectActionPerformer performer, String name, Icon icon)
          Creates an action sensitive to the project currently selected as main in the UI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mainProjectCommandAction

public static Action mainProjectCommandAction(String command,
                                              String name,
                                              Icon icon)
Creates an action sensitive to the project currently selected as main in the UI. The action will invoke the given command on the main project. The action may be disabled when no project is marked as main, or it may prompt the user to select a main project, etc.

Parameters:
command - the command which should be invoked when the action is performed
name - display name of the action
icon - icon of the action; may be null, in which case the action will not have an icon
Returns:
an action sensitive to the main project

mainProjectSensitiveAction

public static Action mainProjectSensitiveAction(ProjectActionPerformer performer,
                                                String name,
                                                Icon icon)
Creates an action sensitive to the project currently selected as main in the UI. When the action is invoked the supplied ProjectActionPerformer.perform(org.netbeans.api.project.Project) will be called. The ProjectActionPerformer.enable(org.netbeans.api.project.Project) method will be consulted when the main project changes to determine whether the action should or should not be enabled. If no main project is selected the project parameter in the callback will be null.

Parameters:
performer - callback class for enabling and performing the action
name - display name of the action
icon - icon of the action; may be null, in which case the action will not have an icon
Returns:
an action sensitive to the main project

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.