org.topbraidcomposer.core.util
Class ThreadUtil

java.lang.Object
  extended by org.topbraidcomposer.core.util.ThreadUtil

public class ThreadUtil
extends java.lang.Object


Constructor Summary
ThreadUtil()
           
 
Method Summary
static boolean cacheLabels(org.eclipse.core.runtime.IProgressMonitor monitor, java.util.Iterator statements)
          Can be used to populate the Labels cache so that they don't hang while a TableViewer is populated or sorted.
static boolean runCancelable(java.lang.String error, org.eclipse.jface.operation.IRunnableWithProgress runnable)
          Runs a given Runnable in a parallel thread that can be canceled (with a hard stop) in a given progress dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadUtil

public ThreadUtil()
Method Detail

cacheLabels

public static boolean cacheLabels(org.eclipse.core.runtime.IProgressMonitor monitor,
                                  java.util.Iterator statements)
Can be used to populate the Labels cache so that they don't hang while a TableViewer is populated or sorted.

Parameters:
monitor -
statements -
Returns:

runCancelable

public static boolean runCancelable(java.lang.String error,
                                    org.eclipse.jface.operation.IRunnableWithProgress runnable)
Runs a given Runnable in a parallel thread that can be canceled (with a hard stop) in a given progress dialog. Callers must make sure that it is safe to cancel the running thread (this might be problematic for long-running database queries that open cursors).

Parameters:
error - an error message to display in case something goes wrong
runnable - the Runnable that does the actual work
Returns:
true if the thread terminated successfully