Package org.eclipse.jface.operation
Interface IRunnableContext
-
- All Known Subinterfaces:
ICompareContainer,ILaunchConfigurationDialog,IProgressService,IWizardContainer,IWizardContainer2,IWorkbenchSiteProgressService,IWorkbenchWindow
- All Known Implementing Classes:
ApplicationWindow,CompareEditorInput,HistoryPageCompareEditorInput,PageCompareEditorInput,ParticipantPageCompareEditorInput,ProgressMonitorDialog,SaveableCompareEditorInput,SyncInfoCompareInput,WizardDialog
public interface IRunnableContextInterface for UI components which can execute a long-running operation in the form of anIRunnableWithProgress. The context is responsible for displaying a progress indicator and Cancel button to the end user while the operation is in progress; the context supplies a progress monitor to be used from code running inside the operation. Note that anIRunnableContextis not a runnable itself.For examples of UI components which implement this interface, see
ApplicationWindow,ProgressMonitorDialog, andWizardDialog.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidrun(boolean fork, boolean cancelable, IRunnableWithProgress runnable)Runs the givenIRunnableWithProgressin this context.
-
-
-
Method Detail
-
run
void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedExceptionRuns the given
IRunnableWithProgressin this context. For example, if this is aProgressMonitorDialogthen the runnable is run using this dialog's progress monitor.If
forkisfalse, the current thread is used to run the runnable. Note that ifforkistrue, it is unspecified whether or not this method blocks until the runnable has been run. Implementers should document whether the runnable is run synchronously (blocking) or asynchronously (non-blocking), or if no assumption can be made about the blocking behaviour.- Parameters:
fork-trueif the runnable should be run in a separate thread, andfalseto run in the same threadcancelable-trueto enable the cancelation, andfalseto make the operation uncancellablerunnable- the runnable to run- Throws:
InvocationTargetException- wraps any exception or error which occurs while running the runnableInterruptedException- propagated by the context if the runnable acknowledges cancelation by throwing this exception. This should not be thrown if cancelable isfalse.
-
-