|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.core.internal.events.InternalBuilder | +--org.eclipse.core.resources.IncrementalProjectBuilder
The abstract base class for all incremental project builders. This class
provides the infrastructure for
defining a builder and fulfills the contract specified by the
org.eclipse.core.resources.builders
standard extension point.
All builders must subclass this class according to the following guidelines:
build()
setInitializationData
method is called with
any parameter data specified in the declaring plug-in's manifest.
Field Summary | |
static int |
AUTO_BUILD
Build kind constant indicating an automatic build request. |
static int |
FULL_BUILD
Build kind constant indicating a full build request. |
static int |
INCREMENTAL_BUILD
Build kind constant indicating an incremental build request. |
Constructor Summary | |
IncrementalProjectBuilder()
|
Method Summary | |
protected abstract IProject[] |
build(int kind,
Map args,
IProgressMonitor monitor)
Runs this builder on the given changes in the specified manner. |
void |
forgetLastBuiltState()
Requests that this builder forget any state it may be retaining regarding previously built states. |
IResourceDelta |
getDelta(IProject project)
Returns the resource delta recording the changes in the given project since the last time this builder was run. |
IProject |
getProject()
Returns the project for which this builder is defined. |
void |
setInitializationData(IConfigurationElement config,
String propertyName,
Object data)
Sets initialization data for this builder. |
protected void |
startupOnInitialize()
Informs this builder that it is being started by the build management infrastructure. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INCREMENTAL_BUILD
IProject.build(int, java.lang.String, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
,
Constant Field Valuespublic static final int FULL_BUILD
IProject.build(int, java.lang.String, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
,
Constant Field Valuespublic static final int AUTO_BUILD
IProject.build(int, java.lang.String, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
,
Constant Field ValuesConstructor Detail |
public IncrementalProjectBuilder()
Method Detail |
protected abstract IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException
When invoked in response to a call to one of the IProject.build
methods, the resource delta is rooted at the project. When invoked
to do an auto-build, the kind will be AUTO_BUILD
.
Any resource delta acquired is valid only for the duration of the invocation of this method.
After completing a build, this builder may return a list of projects for which it requires a resource delta the next time it is run. This builder's project is implicitly included and need not be specified. The build mechanism will attempt to maintain and compute deltas relative to the identified projects when asked the next time this builder is run. Builders must re-specify the list of interesting projects every time they are run as this is not carried forward beyond the next build. Projects mentioned in return value but which do not exist will be ignored and no delta will be made available for them.
This method is long-running; progress and cancellation are provided
by the given progress monitor. All builders should report their
progress and honor cancel requests in a timely manner.
Cancellation requests should be propagated to the caller by
throwing OperationCanceledException
.
All builders should try to be robust in the face of trouble.
In situations where failing the build by throwing
CoreException
is the only option,
a builder has a choice of how best to communicate the
problem back to the caller. One option is to use the
BUILD_FAILED
status code along with a suitable
message; another is to use a multi-status containing finer-grained
problem diagnoses.
build
in class org.eclipse.core.internal.events.InternalBuilder
kind
- the kind of build being requested. Valid values are
FULL_BUILD
- indicates a full build.INCREMENTAL_BUILD
- indicates an incremental build.AUTO_BUILD
- indicates an automatically triggered
incremental build (auto-building on).args
- a table of builder-specific arguments keyed by argument name
(key type: String
, value type: String
);
null
is equivalent to an empty mapmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
null
if none
CoreException
- if this build fails.IProject.build(int, java.lang.String, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
public final void forgetLastBuiltState()
forgetLastBuiltState
in class org.eclipse.core.internal.events.InternalBuilder
forgetLastBuiltState()
public final IResourceDelta getDelta(IProject project)
null
is returned if
no such delta is available. An empty delta is returned if no changes
have occurred. If null
is returned, clients should assume
that unspecified changes have occurred and take the appropriate action.
The system reserves the right to trim old state in an effort to conserve
space. As such, callers should be prepared to receive null
even if they previously requested a delta for a particular project by
returning that project from a build
call.
A non-null
delta will only be supplied for the given project if
either the result returned from the previous build
included
the project or the project is the one associated with this builder.
If the given project was mentioned in the previous build
and
subsequently deleted, a non-null
delta containing the deletion
will be returned. If the given project was mentioned in the previous build
and was subsequently created, the returned value will be null
.
A valid delta will be returned only when this method is called during a build. The delta returned will be valid only for the duration of the enclosing build execution.
getDelta
in class org.eclipse.core.internal.events.InternalBuilder
null
public final IProject getProject()
getProject
in class org.eclipse.core.internal.events.InternalBuilder
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException
This methods is part of the IExecutableExtension
interface.
Subclasses are free to extend this method to pick up
initialization parameters from the plug-in plug-in manifest
(plugin.xml
) file,
but should be sure to invoke this method on their superclass.
For example, the following method looks for a boolean-valued parameter named "trace":
public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) throws CoreException { super.setInitializationData(cfig, propertyName, data); if (data instanceof Hashtable) { Hashtable args = (Hashtable) data; String traceValue = (String) args.get("trace"); TRACING = (traceValue!=null && traceValue.equals("true")); } }
setInitializationData
in interface IExecutableExtension
config
- the configuration element used to trigger this execution.
It can be queried by the executable extension for specific
configuration propertiespropertyName
- the name of an attribute of the configuration element
used on the createExecutableExtension(String)
call. This
argument can be used in the cases where a single configuration element
is used to define multiple executable extensions.data
- adapter data in the form of a String
,
a Hashtable
, or null
.
CoreException
- if error(s) detected during initialization processingIConfigurationElement.createExecutableExtension(java.lang.String)
protected void startupOnInitialize()
setInitializationData
has been called.
The default implementation should be called by all overriding methods.
startupOnInitialize
in class org.eclipse.core.internal.events.InternalBuilder
setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |