public interface ActionProvider
Implementations supporting single file commands (command constants ending with
_SINGLE
) can also be registered in default lookup. If a provider in project
lookup does not enable the action for a given command on the selected file then
the first implementation found in default lookup that is enabled will be used.
ProjectConfiguration
s, the ActionProvider implementation
must check ProjectConfiguration
presence in the action's context Lookup whether the caller
requested a specific configuration, and use it to process the requested action, if found.Modifier and Type | Field and Description |
---|---|
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 moving the project.
|
static String |
COMMAND_PRIME
Standard command for priming / initializing
the project.
|
static String |
COMMAND_PROFILE
Standard command for running the project in profiler
|
static String |
COMMAND_PROFILE_SINGLE
Standard command for running single file in profiler
|
static String |
COMMAND_PROFILE_TEST_SINGLE
Standard command for running one test in profiler
|
static String |
COMMAND_REBUILD
Standard command to do a "clean" (forced) rebuild.
|
static String |
COMMAND_RENAME
Standard command for renaming 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
|
Modifier and Type | Method and Description |
---|---|
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.
|
static final String COMMAND_BUILD
static final String COMMAND_COMPILE_SINGLE
static final String COMMAND_CLEAN
static final String COMMAND_REBUILD
static final String COMMAND_RUN
static final String COMMAND_RUN_SINGLE
static final String COMMAND_TEST
static final String COMMAND_TEST_SINGLE
static final String COMMAND_DEBUG
static final String COMMAND_DEBUG_SINGLE
static final String COMMAND_DEBUG_TEST_SINGLE
static final String COMMAND_DEBUG_STEP_INTO
static final String COMMAND_PROFILE
static final String COMMAND_PROFILE_SINGLE
static final String COMMAND_PROFILE_TEST_SINGLE
static final String COMMAND_DELETE
static final String COMMAND_COPY
static final String COMMAND_MOVE
static final String COMMAND_RENAME
static final String COMMAND_PRIME
String[] getSupportedActions()
ActionProvider.invokeAction(java.lang.String, org.openide.util.Lookup)
ActionProvider.COMMAND_BUILD
,
ActionProvider.COMMAND_CLEAN
,
ActionProvider.COMMAND_REBUILD
void invokeAction(String command, Lookup context) throws IllegalArgumentException
command
- a predefined command name (must be among ActionProvider.getSupportedActions()
)context
- any action context, e.g. for a node selection
(as in ContextAwareAction
)IllegalArgumentException
- if the requested command is not supportedActionProgress
boolean isActionEnabled(String command, Lookup context) throws IllegalArgumentException
command
- a predefined command name (must be among ActionProvider.getSupportedActions()
)context
- any action context, e.g. for a node selection
(as in ContextAwareAction
)IllegalArgumentException
- if the requested command is not supported