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.
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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Standard command to incrementally build the project.static final String
Standard command to clean build products.static final String
Standard command for compiling set of filesstatic final String
Standard command for deleting the project.static final String
Standard command for running the project in debuggerstatic final String
Standard command for running single file in debuggerstatic final String
Standard command for starting app in debugger and stopping at the beginning of app whatever that means.static final String
Standard command for running one test in debuggerstatic final String
Standard command for deleting the project.static final String
Standard command for moving the project.static final String
Standard command for priming / initializing the project.static final String
Standard command for running the project in profilerstatic final String
Standard command for running single file in profilerstatic final String
Standard command for running one test in profilerstatic final String
Standard command to do a "clean" (forced) rebuild.static final String
Standard command for renaming the project.static final String
Standard command for running the projectstatic final String
Standard command for running one filestatic final String
Standard command for running tests on given projectsstatic final String
Standard command for running tests in parallel on given projects sub-modulesstatic final String
Standard command for running one test file -
Method Summary
Modifier and TypeMethodDescriptionString[]
Get a list of all commands which this project supports.void
invokeAction
(String command, org.openide.util.Lookup context) Run a project command.boolean
isActionEnabled
(String command, org.openide.util.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 Details
-
COMMAND_BUILD
-
COMMAND_COMPILE_SINGLE
-
COMMAND_CLEAN
-
COMMAND_REBUILD
-
COMMAND_RUN
-
COMMAND_RUN_SINGLE
-
COMMAND_TEST
-
COMMAND_TEST_SINGLE
-
COMMAND_TEST_PARALLEL
Standard command for running tests in parallel on given projects sub-modules- Since:
- 1.99
- See Also:
-
COMMAND_DEBUG
-
COMMAND_DEBUG_SINGLE
Standard command for running single file in debugger- See Also:
-
COMMAND_DEBUG_TEST_SINGLE
Standard command for running one test in debugger- See Also:
-
COMMAND_DEBUG_STEP_INTO
Standard command for starting app in debugger and stopping at the beginning of app whatever that means.- See Also:
-
COMMAND_PROFILE
Standard command for running the project in profiler- Since:
- 1.43
- See Also:
-
COMMAND_PROFILE_SINGLE
Standard command for running single file in profiler- Since:
- 1.43
- See Also:
-
COMMAND_PROFILE_TEST_SINGLE
Standard command for running one test in profiler- Since:
- 1.43
- See Also:
-
COMMAND_DELETE
-
COMMAND_COPY
-
COMMAND_MOVE
-
COMMAND_RENAME
-
COMMAND_PRIME
Standard command for priming / initializing the project.- Since:
- 1.80
- See Also:
-
-
Method Details
-
getSupportedActions
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:
-
invokeAction
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 amonggetSupportedActions()
)context
- any action context, e.g. for a node selection (as inContextAwareAction
)- Throws:
IllegalArgumentException
- if the requested command is not supported- See Also:
-
isActionEnabled
boolean isActionEnabled(String command, org.openide.util.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 amonggetSupportedActions()
)context
- any action context, e.g. for a node selection (as inContextAwareAction
)- Throws:
IllegalArgumentException
- if the requested command is not supported
-