org.eclipse.xtext.builder
Class DerivedResourceCleanerJob

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by org.eclipse.core.runtime.jobs.Job
              extended by org.eclipse.xtext.builder.DerivedResourceCleanerJob
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable

public class DerivedResourceCleanerJob
extends org.eclipse.core.runtime.jobs.Job

Since:
2.1
Author:
Michael Clay - Initial contribution and API
This class is not intended to be subclassed by clients.
This class is not intended to be subclassed by clients.

Field Summary
static java.lang.Object DERIVED_RESOURCE_CLEANER_JOB_FAMILY
           
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Fields inherited from class org.eclipse.core.internal.jobs.InternalJob
manager
 
Constructor Summary
DerivedResourceCleanerJob()
           
 
Method Summary
 boolean belongsTo(java.lang.Object family)
          Returns whether this job belongs to the given family.
protected  org.eclipse.core.runtime.IStatus cleanUpDerivedResources(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.resources.IProject project)
           
protected  void deleteEmptyParent(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.resources.IContainer container)
           
 DerivedResourceMarkers getDerivedResourceMarkers()
           
 void initialize(org.eclipse.core.resources.IProject projectToClean, java.lang.String folderNameToClean)
           
protected  org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
          Executes this job.
 void setDerivedResourceMarkers(DerivedResourceMarkers derivedResourceMarkers)
           
protected  boolean shouldBeProcessed(org.eclipse.core.resources.IProject project)
           
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, cancel, canceling, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

DERIVED_RESOURCE_CLEANER_JOB_FAMILY

public static final java.lang.Object DERIVED_RESOURCE_CLEANER_JOB_FAMILY
Constructor Detail

DerivedResourceCleanerJob

public DerivedResourceCleanerJob()
Method Detail

getDerivedResourceMarkers

public DerivedResourceMarkers getDerivedResourceMarkers()

setDerivedResourceMarkers

@Inject
public void setDerivedResourceMarkers(DerivedResourceMarkers derivedResourceMarkers)

belongsTo

public boolean belongsTo(java.lang.Object family)
Description copied from class: org.eclipse.core.runtime.jobs.Job
Returns whether this job belongs to the given family. Job families are represented as objects that are not interpreted or specified in any way by the job manager. Thus, a job can choose to belong to any number of families.

Clients may override this method. This default implementation always returns false. Overriding implementations must return false for families they do not recognize.

Overrides:
belongsTo in class org.eclipse.core.runtime.jobs.Job
Parameters:
family - the job family identifier
Returns:
true if this job belongs to the given family, and false otherwise.

initialize

public void initialize(org.eclipse.core.resources.IProject projectToClean,
                       java.lang.String folderNameToClean)

run

protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from class: org.eclipse.core.runtime.jobs.Job
Executes this job. Returns the result of the execution.

The provided monitor can be used to report progress and respond to cancellation. If the progress monitor has been canceled, the job should finish its execution at the earliest convenience and return a result status of severity IStatus.CANCEL. The singleton cancel status Status.CANCEL_STATUS can be used for this purpose. The monitor is only valid for the duration of the invocation of this method.

This method must not be called directly by clients. Clients should call schedule, which will in turn cause this method to be called.

Jobs can optionally finish their execution asynchronously (in another thread) by returning a result status of Job.ASYNC_FINISH. Jobs that finish asynchronously must specify the execution thread by calling setThread, and must indicate when they are finished by calling the method done.

Specified by:
run in class org.eclipse.core.runtime.jobs.Job
Parameters:
monitor - the monitor to be used for reporting progress and responding to cancelation. The monitor is never null
Returns:
resulting status of the run. The result must not be null
See Also:
Job.ASYNC_FINISH, Job.done(IStatus)

cleanUpDerivedResources

protected org.eclipse.core.runtime.IStatus cleanUpDerivedResources(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                                   org.eclipse.core.resources.IProject project)
                                                            throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

deleteEmptyParent

protected void deleteEmptyParent(org.eclipse.core.runtime.IProgressMonitor monitor,
                                 org.eclipse.core.resources.IContainer container)
                          throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

shouldBeProcessed

protected boolean shouldBeProcessed(org.eclipse.core.resources.IProject project)