2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
* The contents of this file are subject to the terms of either the GNU
7
* General Public License Version 2 only ("GPL") or the Common
8
* Development and Distribution License("CDDL") (collectively, the
9
* "License"). You may not use this file except in compliance with the
10
* License. You can obtain a copy of the License at
11
* http://www.netbeans.org/cddl-gplv2.html
12
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
* specific language governing permissions and limitations under the
14
* License. When distributing the software, include this License Header
15
* Notice in each file and include the License file at
16
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17
* particular file as subject to the "Classpath" exception as provided
18
* by Sun in the GPL Version 2 section of the License file that
19
* accompanied this code. If applicable, add the following below the
20
* License Header, with the fields enclosed by brackets [] replaced by
21
* your own identifying information:
22
* "Portions Copyrighted [year] [name of copyright owner]"
26
* The Original Software is NetBeans. The Initial Developer of the Original
27
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
28
* Microsystems, Inc. All Rights Reserved.
30
* If you wish your version of this file to be governed by only the CDDL
31
* or only the GPL Version 2, indicate your decision by adding
32
* "[Contributor] elects to include this software in this distribution
33
* under the [CDDL or GPL Version 2] license." If you do not indicate a
34
* single choice of license, a recipient has the option to distribute
35
* your version of this file under either the CDDL, the GPL Version 2 or
36
* to extend the choice of license to its licensees as provided above.
37
* However, if you add GPL Version 2 code and therefore, elected the GPL
38
* Version 2 license, then the option applies only if the new code is
39
* made subject to such option by the copyright holder.
42
package org.netbeans.spi.project;
44
import org.openide.util.Lookup;
47
* Ability for a project to have various actions (e.g. Build) invoked on it.
48
* Should be registered in a project's lookup and will be used by UI infrastructure.
49
* @see org.netbeans.api.project.Project#getLookup
50
* @see <a href="@org-apache-tools-ant-module@/org/apache/tools/ant/module/api/support/ActionUtils.html"><code>ActionUtils</code></a>
51
* @see <a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/support/ProjectSensitiveActions.html#projectCommandAction(java.lang.String,%20java.lang.String,%20javax.swing.Icon)"><code>ProjectSensitiveActions.projectCommandAction(...)</code></a>
54
public interface ActionProvider {
57
* Standard command to incrementally build the project.
59
String COMMAND_BUILD = "build"; // NOI18N
62
* Standard command for compiling set of files
64
String COMMAND_COMPILE_SINGLE = "compile.single"; // NOI18N
67
* Standard command to clean build products.
69
String COMMAND_CLEAN = "clean"; // NOI18N
72
* Standard command to do a "clean" (forced) rebuild.
74
String COMMAND_REBUILD = "rebuild"; // NOI18N
77
* Standard command for running the project
79
String COMMAND_RUN = "run"; // NOI18N
82
* Standard command for running one file
84
String COMMAND_RUN_SINGLE = "run.single"; // NOI18N
87
* Standard command for running tests on given projects
89
String COMMAND_TEST = "test"; // NOI18N
92
* Standard command for running one test file
94
String COMMAND_TEST_SINGLE = "test.single"; // NOI18N
97
* Standard command for running the project in debugger
99
String COMMAND_DEBUG = "debug"; // NOI18N
102
* Standard command for running single file in debugger
104
String COMMAND_DEBUG_SINGLE = "debug.single"; // NOI18N
107
* Standard command for running one test in debugger
109
String COMMAND_DEBUG_TEST_SINGLE = "debug.test.single"; // NOI18N
112
* Standard command for starting app in debugger and stopping at the
113
* beginning of app whatever that means.
115
String COMMAND_DEBUG_STEP_INTO = "debug.stepinto"; // NOI18N
118
* Standard command for deleting the project.
122
String COMMAND_DELETE = "delete"; // NOI18N
125
* Standard command for deleting the project.
129
String COMMAND_COPY = "copy"; // NOI18N
132
* Standard command for moving the project.
136
String COMMAND_MOVE = "move"; // NOI18N
139
* Standard command for renaming the project.
143
String COMMAND_RENAME = "rename"; // NOI18N
146
* Get a list of all commands which this project supports.
147
* @return a list of command names suitable for {@link #invokeAction}
148
* @see #COMMAND_BUILD
149
* @see #COMMAND_CLEAN
150
* @see #COMMAND_REBUILD
152
String[] getSupportedActions();
155
* Run a project command.
156
* Will be invoked in the event thread.
157
* The context may be ignored by some commands, but some may need it in order
158
* to get e.g. the selected source file to build by itself, etc.
159
* @param command a predefined command name (must be among {@link #getSupportedActions})
160
* @param context any action context, e.g. for a node selection
161
* (as in {@link ContextAwareAction})
162
* @throws IllegalArgumentException if the requested command is not supported
164
void invokeAction(String command, Lookup context) throws IllegalArgumentException;
167
* Tells whether the command can be invoked in given context and thus if
168
* actions representing this command should be enabled or disabled.
169
* The context may be ignored by some commands, but some may need it in order
170
* to get e.g. the selected source file to build by itself, etc.
171
* @param command a predefined command name (must be among {@link #getSupportedActions})
172
* @param context any action context, e.g. for a node selection
173
* (as in {@link ContextAwareAction})
174
* @throws IllegalArgumentException if the requested command is not supported
176
boolean isActionEnabled(String command, Lookup context) throws IllegalArgumentException;