KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > resources > ICommand


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.resources;
12
13 import java.util.Map JavaDoc;
14 import org.eclipse.core.runtime.IProgressMonitor;
15
16 /**
17  * A builder command names a builder and supplies a table of
18  * name-value argument pairs.
19  * <p>
20  * Changes to a command will only take effect if the modified command is installed
21  * into a project description via {@link IProjectDescription#setBuildSpec(ICommand[])}.
22  * <p>
23  * This interface is not intended to be implemented by clients.
24  * </p>
25  *
26  * @see IProjectDescription
27  */

28 public interface ICommand {
29
30     /**
31      * Returns a table of the arguments for this command, or <code>null</code>
32      * if there are no arguments. The argument names and values are both strings.
33      *
34      * @return a table of command arguments (key type : <code>String</code>
35      * value type : <code>String</code>), or <code>null</code>
36      * @see #setArguments(Map)
37      */

38     public Map JavaDoc getArguments();
39
40     /**
41      * Returns the name of the builder to run for this command, or
42      * <code>null</code> if the name has not been set.
43      *
44      * @return the name of the builder, or <code>null</code> if not set
45      * @see #setBuilderName(String)
46      */

47     public String JavaDoc getBuilderName();
48
49     /**
50      * Returns whether this build command responds to the given kind of build.
51      * <p>
52      * By default, build commands respond to all kinds of builds.
53      * </p>
54      *
55      * @param kind One of the <tt>*_BUILD</code> constants defined
56      * on <code>IncrementalProjectBuilder</code>
57      * @return <code>true</code> if this build command responds to the specified
58      * kind of build, and <code>false</code> otherwise.
59      * @see #setBuilding(int, boolean)
60      * @since 3.1
61      */

62     public boolean isBuilding(int kind);
63
64     /**
65      * Returns whether this command allows configuring of what kinds of builds
66      * it responds to. By default, commands are only configurable
67      * if the corresponding builder defines the {@link #isConfigurable}
68      * attribute in its builder extension declaration. A command that is not
69      * configurable will always respond to all kinds of builds.
70      *
71      * @return <code>true</code> If this command allows configuration of
72      * what kinds of builds it responds to, and <code>false</code> otherwise.
73      * @see #setBuilding(int, boolean)
74      * @since 3.1
75      */

76     public boolean isConfigurable();
77
78     /**
79      * Sets this command's arguments to be the given table of name-values
80      * pairs, or to <code>null</code> if there are no arguments. The argument
81      * names and values are both strings.
82      * <p>
83      * Individual builders specify their argument expectations.
84      * </p>
85      * <p>
86      * Note that modifications to the arguments of a command
87      * being used in a running builder may affect the run of that builder
88      * but will not affect any subsequent runs. To change a command
89      * permanently you must install the command into the relevant project
90      * build spec using {@link IProjectDescription#setBuildSpec(ICommand[])}.
91      * </p>
92      *
93      * @param args a table of command arguments (keys and values must
94      * both be of type <code>String</code>), or <code>null</code>
95      * @see #getArguments()
96      */

97     public void setArguments(Map JavaDoc args);
98
99     /**
100      * Sets the name of the builder to run for this command.
101      * <p>
102      * The builder name comes from the extension that plugs in
103      * to the standard <code>org.eclipse.core.resources.builders</code>
104      * extension point.
105      * </p>
106      *
107      * @param builderName the name of the builder
108      * @see #getBuilderName()
109      */

110     public void setBuilderName(String JavaDoc builderName);
111
112     /**
113      * Specifies whether this build command responds to the provided kind of build.
114      * <p>
115      * When a command is configured to not respond to a given kind of build, the
116      * builder instance will not be called when a build of that kind is initiated.
117      * </p><p>
118      * This method has no effect if this build command does not allow its
119      * build kinds to be configured.
120      * </p>
121      *
122      * @param kind One of the <tt>*_BUILD</code> constants defined
123      * on <code>IncrementalProjectBuilder</code>
124      * @param value <code>true</code> if this build command responds to the
125      * specified kind of build, and <code>false</code> otherwise.
126      * @see #isBuilding(int)
127      * @see #isConfigurable()
128      * @see IWorkspace#build(int, IProgressMonitor)
129      * @see IProject#build(int, IProgressMonitor)
130      * @since 3.1
131      */

132     public void setBuilding(int kind, boolean value);
133 }
134
Popular Tags