java.lang.Object | +--org.eclipse.core.internal.events.InternalBuilder | +--org.eclipse.core.resources.IncrementalProjectBuilder | +--com.ibm.lab.soln.resources.nature_builder.ReadmeBuilder
Builder for .readme files. Creates and HTML stub file for each readme file in
a project's readme folder to demonstrate the structure of a builder and how an
IResourceDelta
can be processed to find changes of interest to
a builder.
The builder will proecess files in the current project, and register its intent to process files in any referenced project. This means that even though the builder is not associated to a project, the fact that a project with this builder has a project reference means that the target project will also be processed.
Source includes trace logic that can be enabled or disabled based on the
setting of the traceEnabled
field. The trace logic uses
System.out.println()
statements to create trace entries.
If you want to visualize the flow of build processing,
uncomment these statements before starting a test cycle.
IncrementalProjectBuilder
,
IResourceDelta
Fields inherited from class org.eclipse.core.resources.IncrementalProjectBuilder |
AUTO_BUILD, FULL_BUILD, INCREMENTAL_BUILD |
Constructor Summary | |
ReadmeBuilder()
The required public no-argument constructor. |
Method Summary | |
protected org.eclipse.core.resources.IProject[] |
build(int kind,
java.util.Map args,
org.eclipse.core.runtime.IProgressMonitor monitor)
The build method implementation required for any incremental builder. |
void |
checkBuildType(int kind)
Prints builder kind trace messages to the console |
void |
processDelta(org.eclipse.core.resources.IResourceDelta delta)
The IResourceDelta passed is processed by a
IResourceDeltaVisitor when the delta contains information
about changes in the readme folder. |
void |
processDelta4ReferencedProjects(org.eclipse.core.resources.IProject[] refedProjects)
Attempts to process readme changes in another project where the builder is not registered. |
void |
processFull(org.eclipse.core.resources.IProject iProject)
Performs a FULL_BUILD by visiting all nodes in the resource
tree under readme folder for the specified project. |
void |
processFull4ReferencedProjects(org.eclipse.core.resources.IProject[] refedProjects)
Performs a full buils on any referenced projects. |
void |
setInitializationData(org.eclipse.core.runtime.IConfigurationElement config,
java.lang.String propertyName,
java.lang.Object data)
Finds builder parameters defined in the plugin.xml. |
protected void |
startupOnInitialize()
This method allows a builder to get ready. |
org.eclipse.core.resources.IProject[] |
watchReferecedProjects()
Returns an array of projects that are of interest for the next build. |
Methods inherited from class org.eclipse.core.resources.IncrementalProjectBuilder |
forgetLastBuiltState, getDelta, getProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReadmeBuilder()
Method Detail |
protected org.eclipse.core.resources.IProject[] build(int kind, java.util.Map args, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
FULL_BUILD
,
AUTO_BUILD
, or INCREMENTAL_BUILD
build request.
The processing logic to "build" the .readme files is kept in the
ReadmeVisitor
class and is used for all build types.build
in class org.eclipse.core.resources.IncrementalProjectBuilder
public void checkBuildType(int kind)
public void processDelta(org.eclipse.core.resources.IResourceDelta delta) throws org.eclipse.core.runtime.CoreException
IResourceDelta
passed is processed by a
IResourceDeltaVisitor
when the delta contains information
about changes in the readme folder.
A null delta exists when the project is created.
Multiple visit invocation statements are included for the different
resource visitors provided in this resource programming demonstration package.
You may wish to invoke other visitors to further explore the IResourceDelta
.
IResourceDelta
public void processDelta4ReferencedProjects(org.eclipse.core.resources.IProject[] refedProjects) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
- public void processFull(org.eclipse.core.resources.IProject iProject)
FULL_BUILD
by visiting all nodes in the resource
tree under readme folder for the specified project. The readme folder must
exist.
The ReadmeVisitor
class is used to process the .readme files
when found in the project tree.iProject
- public void processFull4ReferencedProjects(org.eclipse.core.resources.IProject[] refedProjects)
public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config, java.lang.String propertyName, java.lang.Object data) throws org.eclipse.core.runtime.CoreException
System.out.println()
statements are uncommented.setInitializationData
in class org.eclipse.core.resources.IncrementalProjectBuilder
IExecutableExtension.setInitializationData(IConfigurationElement, String, Object)
protected void startupOnInitialize()
startupOnInitialize
in class org.eclipse.core.resources.IncrementalProjectBuilder
IncrementalProjectBuilder.startupOnInitialize()
public org.eclipse.core.resources.IProject[] watchReferecedProjects()