Package org.eclipse.jface.util
Class SafeRunnable
java.lang.Object
org.eclipse.jface.util.SafeRunnable
- All Implemented Interfaces:
- ISafeRunnable
- Direct Known Subclasses:
- EarlyStartupRunnable
Implements a default implementation of ISafeRunnable. The default
 implementation of 
handleException opens a dialog to show any
 errors as they accumulate.
 This may be executed on any thread.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new instance of SafeRunnable with a default error message.SafeRunnable(String message) Creates a new instance of SafeRunnable with the given error message.
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanFlag to avoid interactive error dialogs during automated testing.static booleangetIgnoreErrors(boolean flag) Deprecated.use getIgnoreErrors()static ISafeRunnableRunnerReturns the safe runnable runner.voidHandles an exception thrown by this runnable'sISafeRunnable.run()method.static voidrun(ISafeRunnable runnable) Runs the given safe runnable using the safe runnable runner.static voidsetIgnoreErrors(boolean flag) Flag to avoid interactive error dialogs during automated testing.static voidsetRunner(ISafeRunnableRunner runner) Sets the safe runnable runner.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.ISafeRunnablerun
- 
Constructor Details- 
SafeRunnablepublic SafeRunnable()Creates a new instance of SafeRunnable with a default error message.
- 
SafeRunnableCreates a new instance of SafeRunnable with the given error message.- Parameters:
- message- the error message to use
 
 
- 
- 
Method Details- 
handleExceptionDescription copied from interface:ISafeRunnableHandles an exception thrown by this runnable'sISafeRunnable.run()method. The processing done here should be specific to the particular use case for this runnable. Generalized exception processing, including logging in the Platform's log, is done by theSafeRunner.All exceptions from the ISafeRunnable.run()method are passed to this method, along with certainErrortypes that are typically caused by programming errors in the untrusted code being run.- Specified by:
- handleExceptionin interface- ISafeRunnable
- Parameters:
- e- an exception which occurred during processing the body of this runnable (i.e., in- ISafeRunnable.run())
- See Also:
 
- 
getIgnoreErrorsDeprecated.use getIgnoreErrors()Flag to avoid interactive error dialogs during automated testing.- Parameters:
- flag- unused
- Returns:
- true if errors should be ignored
 
- 
getIgnoreErrorspublic static boolean getIgnoreErrors()Flag to avoid interactive error dialogs during automated testing.- Returns:
- true if errors should be ignored
- Since:
- 3.0
 
- 
setIgnoreErrorspublic static void setIgnoreErrors(boolean flag) Flag to avoid interactive error dialogs during automated testing.- Parameters:
- flag- set to true if errors should be ignored
 
- 
getRunnerReturns the safe runnable runner.- Returns:
- the safe runnable runner
- Since:
- 3.1
 
- 
setRunnerSets the safe runnable runner.- Parameters:
- runner- the runner to set, or- nullto reset to the default runner
- Since:
- 3.1
 
- 
runRuns the given safe runnable using the safe runnable runner. This is a convenience method, equivalent to:SafeRunnable.getRunner().run(runnable).- Parameters:
- runnable- the runnable to run
- Since:
- 3.1
 
 
-