org.eclipse.cdt.internal.ui.actions
Class WorkbenchRunnableAdapter

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter
All Implemented Interfaces:
org.eclipse.jface.operation.IRunnableWithProgress

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

An IRunnableWithProgress that adapts and IWorkspaceRunnable so that is can be executed inside IRunnableContext. OperationCanceledException thrown by the adapted runnable are caught and re-thrown as a InterruptedException.


Constructor Summary
WorkbenchRunnableAdapter(org.eclipse.core.resources.IWorkspaceRunnable runnable)
          Runs a workspace runnable with the workspace lock.
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.
 
Method Summary
 org.eclipse.core.runtime.jobs.ISchedulingRule getSchedulingRule()
           
 void run(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void runAsUserJob(java.lang.String name, java.lang.Object jobFamiliy)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkbenchRunnableAdapter

public WorkbenchRunnableAdapter(org.eclipse.core.resources.IWorkspaceRunnable runnable)
Runs a workspace runnable with the workspace lock.


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.

Method Detail

getSchedulingRule

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

run

public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
         throws java.lang.reflect.InvocationTargetException,
                java.lang.InterruptedException
Specified by:
run in interface org.eclipse.jface.operation.IRunnableWithProgress
Throws:
java.lang.reflect.InvocationTargetException
java.lang.InterruptedException

runAsUserJob

public void runAsUserJob(java.lang.String name,
                         java.lang.Object jobFamiliy)