Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.io.util
Class ThreadProgressMonitor

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.io.util.ThreadProgressMonitor

public class ThreadProgressMonitor
extends Object

Stores current IProgressMonitors used in a thread. Allows subtasking w/o knowing of the parent task.

Author:
Simon Templer

Constructor Summary
ThreadProgressMonitor()
           
 
Method Summary
static org.eclipse.core.runtime.IProgressMonitor getCurrent()
          Get the monitor currently associated with the thread.
static void register(org.eclipse.core.runtime.IProgressMonitor monitor)
          Register a progress monitor with the current thread.
static void remove(org.eclipse.core.runtime.IProgressMonitor monitor)
          Remove a progress monitor that was previously registered.
static void runWithProgressDialog(org.eclipse.jface.operation.IRunnableWithProgress op, boolean isCancelable)
          Run the given operation in a forked thread with a progress monitor dialog or in the current thread with a sub progress monitor if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadProgressMonitor

public ThreadProgressMonitor()
Method Detail

getCurrent

public static org.eclipse.core.runtime.IProgressMonitor getCurrent()
Get the monitor currently associated with the thread.

Returns:
the progress monitor or null

register

public static void register(org.eclipse.core.runtime.IProgressMonitor monitor)
Register a progress monitor with the current thread. It must be removed using remove(IProgressMonitor).

Parameters:
monitor - the progress monitor

remove

public static void remove(org.eclipse.core.runtime.IProgressMonitor monitor)
Remove a progress monitor that was previously registered. Also removes monitors that have been added after the given one.

Parameters:
monitor - the progress monitor to remove

runWithProgressDialog

public static void runWithProgressDialog(org.eclipse.jface.operation.IRunnableWithProgress op,
                                         boolean isCancelable)
                                  throws Exception
Run the given operation in a forked thread with a progress monitor dialog or in the current thread with a sub progress monitor if possible.

Parameters:
op - the operation to execute
isCancelable - if the operation can be canceled
Throws:
Exception - if any error occurs executing the operation

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d