java.lang.Objectorg.eclipse.core.internal.events.InternalBuilder
org.eclipse.core.resources.IncrementalProjectBuilder
com.ibm.jdg2e.resources.extensions.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, un-comment these
statements before starting a test cycle.
IncrementalProjectBuilder,
IResourceDelta| Field Summary |
| Fields inherited from class org.eclipse.core.resources.IncrementalProjectBuilder |
AUTO_BUILD, CLEAN_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 |
protected void |
clean(org.eclipse.core.runtime.IProgressMonitor monitor)
|
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 builds 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, hasBeenBuilt, isInterrupted, needRebuild |
| 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.
org.eclipse.core.runtime.CoreExceptionInternalBuilder.build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)public void checkBuildType(int kind)
kind -
protected void clean(org.eclipse.core.runtime.IProgressMonitor monitor)
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
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.
delta -
org.eclipse.core.runtime.CoreExceptionIResourceDelta
public void processDelta4ReferencedProjects(org.eclipse.core.resources.IProject[] refedProjects)
throws org.eclipse.core.runtime.CoreException
refedProjects -
org.eclipse.core.runtime.CoreExceptionpublic 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.
Either an IResourceProxyVisitor or IResourceVisitor
can be used, both are created but only one is invoked.
By example you can see it does not take much more work to use an
IResourceProxyVisitor and the visitor will run faster.
The ReadmeVisitor logic is used to actually
process the .readme files found in the project tree.
iProject - public void processFull4ReferencedProjects(org.eclipse.core.resources.IProject[] refedProjects)
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.
org.eclipse.core.runtime.CoreExceptionIExecutableExtension.setInitializationData(IConfigurationElement,
String, Object)protected void startupOnInitialize()
InternalBuilder.startupOnInitialize()public org.eclipse.core.resources.IProject[] watchReferecedProjects()