|
From: Christopher W. <caw...@us...> - 2006-01-31 20:30:05
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv673/src/org/rubypeople/rdt/internal/ui/actions Modified Files: WorkbenchRunnableAdapter.java Log Message: add a new Ruby Class Wizard (it's not especially useful yet, but it is more obvious than new -> file -> name it with a standard ruby file name/extension) Index: WorkbenchRunnableAdapter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/WorkbenchRunnableAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WorkbenchRunnableAdapter.java 12 Mar 2005 15:32:34 -0000 1.1 --- WorkbenchRunnableAdapter.java 31 Jan 2006 20:29:53 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; + import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; *************** *** 36,39 **** --- 37,41 ---- public class WorkbenchRunnableAdapter implements IRunnableWithProgress { + private boolean fTransfer= false; private IWorkspaceRunnable fWorkspaceRunnable; private ISchedulingRule fRule; *************** *** 53,56 **** --- 55,69 ---- fRule= rule; } + + /** + * Runs a workspace runnable with the given lock or <code>null</code> to run with no lock at all. + * @param transfer <code>true</code> if the rule is to be transfered + * to the model context thread. Otherwise <code>false</code> + */ + public WorkbenchRunnableAdapter(IWorkspaceRunnable runnable, ISchedulingRule rule, boolean transfer) { + fWorkspaceRunnable= runnable; + fRule= rule; + fTransfer= transfer; + } public ISchedulingRule getSchedulingRule() { *************** *** 70,73 **** --- 83,94 ---- } } + + /** + * {@inheritDoc} + */ + public void threadChange(Thread thread) { + if (fTransfer) + Platform.getJobManager().transferRule(fRule, thread); + } public void runAsUserJob(String name, final Object jobFamiliy) { |