站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

ActionProvider (NetBeans Project API) - NetBeans API Javadoc 5.0.0

 

org.netbeans.spi.project
Interface ActionProvider


public interface ActionProvider

Ability for a project to have various actions (e.g. Build) invoked on it. Should be registered in a project's lookup and will be used by UI infrastructure.

See Also:
Project.getLookup(), ActionUtils

Field Summary
static String COMMAND_BUILD
          Standard command to incrementally build the project.
static String COMMAND_CLEAN
          Standard command to clean build products.
static String COMMAND_COMPILE_SINGLE
          Standard command for compiling set of files
static String COMMAND_COPY
          Standard command for deleting the project.
static String COMMAND_DEBUG
          Standard command for running the project in debugger
static String COMMAND_DEBUG_SINGLE
          Standard command for running single file in debugger
static String COMMAND_DEBUG_STEP_INTO
          Standard command for starting app in debugger and stopping at the beginning of app whatever that means.
static String COMMAND_DEBUG_TEST_SINGLE
          Standard command for running one test in debugger
static String COMMAND_DELETE
          Standard command for deleting the project.
static String COMMAND_MOVE
          Standard command for deleting the project.
static String COMMAND_REBUILD
          Standard command to do a "clean" (forced) rebuild.
static String COMMAND_RENAME
          Standard command for deleting the project.
static String COMMAND_RUN
          Standard command for running the project
static String COMMAND_RUN_SINGLE
          Standard command for running one file
static String COMMAND_TEST
          Standard command for running tests on given projects
static String COMMAND_TEST_SINGLE
          Standard command for running one test file
 
Method Summary
 String[] getSupportedActions()
          Get a list of all commands which this project supports.
 void invokeAction(String command, Lookup context)
          Run a project command.
 boolean isActionEnabled(String command, Lookup context)
          Tells whether the command can be invoked in given context and thus if actions representing this command should be enabled or disabled.
 

Field Detail

COMMAND_BUILD

public static final String COMMAND_BUILD
Standard command to incrementally build the project.

See Also:
Constant Field Values

COMMAND_COMPILE_SINGLE

public static final String COMMAND_COMPILE_SINGLE
Standard command for compiling set of files

See Also:
Constant Field Values

COMMAND_CLEAN

public static final String COMMAND_CLEAN
Standard command to clean build products.

See Also:
Constant Field Values

COMMAND_REBUILD

public static final String COMMAND_REBUILD
Standard command to do a "clean" (forced) rebuild.

See Also:
Constant Field Values

COMMAND_RUN

public static final String COMMAND_RUN
Standard command for running the project

See Also:
Constant Field Values

COMMAND_RUN_SINGLE

public static final String COMMAND_RUN_SINGLE
Standard command for running one file

See Also:
Constant Field Values

COMMAND_TEST

public static final String COMMAND_TEST
Standard command for running tests on given projects

See Also:
Constant Field Values

COMMAND_TEST_SINGLE

public static final String COMMAND_TEST_SINGLE
Standard command for running one test file

See Also:
Constant Field Values

COMMAND_DEBUG

public static final String COMMAND_DEBUG
Standard command for running the project in debugger

See Also:
Constant Field Values

COMMAND_DEBUG_SINGLE

public static final String COMMAND_DEBUG_SINGLE
Standard command for running single file in debugger

See Also:
Constant Field Values

COMMAND_DEBUG_TEST_SINGLE

public static final String COMMAND_DEBUG_TEST_SINGLE
Standard command for running one test in debugger

See Also:
Constant Field Values

COMMAND_DEBUG_STEP_INTO

public static final String COMMAND_DEBUG_STEP_INTO
Standard command for starting app in debugger and stopping at the beginning of app whatever that means.

See Also:
Constant Field Values

COMMAND_DELETE

public static final String COMMAND_DELETE
Standard command for deleting the project.

Since:
1.6
See Also:
Constant Field Values

COMMAND_COPY

public static final String COMMAND_COPY
Standard command for deleting the project.

Since:
1.7
See Also:
Constant Field Values

COMMAND_MOVE

public static final String COMMAND_MOVE
Standard command for deleting the project.

Since:
1.7
See Also:
Constant Field Values

COMMAND_RENAME

public static final String COMMAND_RENAME
Standard command for deleting the project.

Since:
1.7
See Also:
Constant Field Values
Method Detail

getSupportedActions

public String[] getSupportedActions()
Get a list of all commands which this project supports.

Returns:
a list of command names suitable for invokeAction(java.lang.String, org.openide.util.Lookup)
See Also:
COMMAND_BUILD, COMMAND_CLEAN, COMMAND_REBUILD

invokeAction

public void invokeAction(String command,
                         Lookup context)
                  throws IllegalArgumentException
Run a project command. Will be invoked in the event thread. The context may be ignored by some commands, but some may need it in order to get e.g. the selected source file to build by itself, etc.

Parameters:
command - a predefined command name (must be among getSupportedActions())
context - any action context, e.g. for a node selection (as in ContextAwareAction)
Throws:
IllegalArgumentException - if the requested command is not supported

isActionEnabled

public boolean isActionEnabled(String command,
                               Lookup context)
                        throws IllegalArgumentException
Tells whether the command can be invoked in given context and thus if actions representing this command should be enabled or disabled. The context may be ignored by some commands, but some may need it in order to get e.g. the selected source file to build by itself, etc.

Parameters:
command - a predefined command name (must be among getSupportedActions())
context - any action context, e.g. for a node selection (as in ContextAwareAction)
Throws:
IllegalArgumentException - if the requested command is not supported

 

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