org.eclipse.xtext.ui.refactoring.ui
Class WorkbenchRunnableAdapter

java.lang.Object
  extended by org.eclipse.xtext.ui.refactoring.ui.WorkbenchRunnableAdapter
All Implemented Interfaces:
org.eclipse.jface.operation.IRunnableWithProgress, org.eclipse.jface.operation.IThreadListener

public class WorkbenchRunnableAdapter
extends java.lang.Object
implements org.eclipse.jface.operation.IRunnableWithProgress, org.eclipse.jface.operation.IThreadListener

Author:
schill - Initial contribution and API Due to visibility problems copied from org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter

Constructor Summary
WorkbenchRunnableAdapter(org.eclipse.core.resources.IWorkspaceRunnable runnable, org.eclipse.core.runtime.jobs.ISchedulingRule rule)
          Runs a workspace runnable with the given lock or null to run with no lock at all.
WorkbenchRunnableAdapter(org.eclipse.core.resources.IWorkspaceRunnable runnable, org.eclipse.core.runtime.jobs.ISchedulingRule rule, boolean transfer)
          Runs a workspace runnable with the given lock or null to run with no lock at all.
 
Method Summary
 org.eclipse.core.runtime.jobs.ISchedulingRule getSchedulingRule()
           
 void run(org.eclipse.core.runtime.IProgressMonitor monitor)
          Runs this operation.
 void threadChange(java.lang.Thread thread)
          Notification that a thread change is occurring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkbenchRunnableAdapter

public WorkbenchRunnableAdapter(org.eclipse.core.resources.IWorkspaceRunnable runnable,
                                org.eclipse.core.runtime.jobs.ISchedulingRule rule)
Runs a workspace runnable with the given lock or null to run with no lock at all.

Parameters:
runnable - the workspace runnable
rule - the scheduling rule

WorkbenchRunnableAdapter

public WorkbenchRunnableAdapter(org.eclipse.core.resources.IWorkspaceRunnable runnable,
                                org.eclipse.core.runtime.jobs.ISchedulingRule rule,
                                boolean transfer)
Runs a workspace runnable with the given lock or null to run with no lock at all.

Parameters:
runnable - the workspace runnable
rule - the scheduling rule
transfer - true if the rule is to be transfered to the model context thread. Otherwise false
Since:
3.1
Method Detail

getSchedulingRule

public org.eclipse.core.runtime.jobs.ISchedulingRule getSchedulingRule()

threadChange

public void threadChange(java.lang.Thread thread)
Notification that a thread change is occurring.

Specified by:
threadChange in interface org.eclipse.jface.operation.IThreadListener
Parameters:
thread - The new thread

run

public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
         throws java.lang.reflect.InvocationTargetException,
                java.lang.InterruptedException
Description copied from interface: org.eclipse.jface.operation.IRunnableWithProgress
Runs this operation. Progress should be reported to the given progress monitor. This method is usually invoked by an IRunnableContext's run method, which supplies the progress monitor. A request to cancel the operation should be honored and acknowledged by throwing InterruptedException.

Specified by:
run in interface org.eclipse.jface.operation.IRunnableWithProgress
Parameters:
monitor - the progress monitor to use to display progress and receive requests for cancelation
Throws:
java.lang.reflect.InvocationTargetException - if the run method must propagate a checked exception, it should wrap it inside an InvocationTargetException; runtime exceptions are automatically wrapped in an InvocationTargetException by the calling context
java.lang.InterruptedException - if the operation detects a request to cancel, using IProgressMonitor.isCanceled(), it should exit by throwing InterruptedException
See Also:
IRunnableContext.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)