Class CompareContainer
- All Implemented Interfaces:
ICompareContainer,IRunnableContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener) Register for change events for the given compare input.protected WorkerJobReturn the action bars for the container ornullif the container does not have an action bars.Return theICompareNavigatorassociated with this container ornullif the container does not have a global navigator.Return the service locator for the container ornullif the container does not have one.Return the workbench part associated with this container ornullif there is no part or it is not available.protected StringvoidregisterContextMenu(MenuManager menu, ISelectionProvider selectionProvider) Register the content menu with the container to give the container a chance to add additional items to the context menu such as popup menu object contributions.voidremoveCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener) Remove the change listener from the given compare input.voidrun(boolean fork, boolean cancelable, IRunnableWithProgress runnable) Runs the givenIRunnableWithProgressin this context.voidrunAsynchronously(IRunnableWithProgress runnable) Queue the given task to be run asynchronously.voidsetStatusMessage(String message) Set the status message displayed by the container to the given message
-
Constructor Details
-
CompareContainer
public CompareContainer()
-
-
Method Details
-
setStatusMessage
Description copied from interface:ICompareContainerSet the status message displayed by the container to the given message- Specified by:
setStatusMessagein interfaceICompareContainer- Parameters:
message- the status message
-
addCompareInputChangeListener
public void addCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener) Description copied from interface:ICompareContainerRegister for change events for the given compare input. Although clients can register with the compare input directly, registering through the container allows for deterministic and optimized behavior in some cases. Registering multiple times for the same compare input has no effect.- Specified by:
addCompareInputChangeListenerin interfaceICompareContainer- Parameters:
input- the compare inputlistener- the compare input change listener
-
removeCompareInputChangeListener
public void removeCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener) Description copied from interface:ICompareContainerRemove the change listener from the given compare input. Removing a listener that is not registered has no effect.- Specified by:
removeCompareInputChangeListenerin interfaceICompareContainer- Parameters:
input- the compare inputlistener- the compare input change listener
-
registerContextMenu
Description copied from interface:ICompareContainerRegister the content menu with the container to give the container a chance to add additional items to the context menu such as popup menu object contributions. The provided menu should have aIWorkbenchActionConstants.MB_ADDITIONSseparator as this is where the container will add actions.- Specified by:
registerContextMenuin interfaceICompareContainer- Parameters:
menu- the menu being registeredselectionProvider- the selection provider
-
getServiceLocator
Description copied from interface:ICompareContainerReturn the service locator for the container ornullif the container does not have one.- Specified by:
getServiceLocatorin interfaceICompareContainer- Returns:
- the service locator for the container or
null
-
getActionBars
Description copied from interface:ICompareContainerReturn the action bars for the container ornullif the container does not have an action bars.- Specified by:
getActionBarsin interfaceICompareContainer- Returns:
- the action bars for the container or
null
-
run
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException Description copied from interface:IRunnableContextRuns 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.- Specified by:
runin interfaceIRunnableContext- 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.
-
runAsynchronously
Description copied from interface:ICompareContainerQueue the given task to be run asynchronously. If the given runnable was previously queued to run asynchronously and it has not yet run, the task position will be moved to the end of the queue. If the task that is being queued is currently running, the running task will be canceled and added to the end of the queue.This method should be treated as a request to run the given task asynchronously. However, clients should not assume that the code will be run asynchronously. Depending on the container implementation, a call to this method may or may not block the caller until the task is completed. Also, the task may be executed in a modal or non-modal fashion.
- Specified by:
runAsynchronouslyin interfaceICompareContainer- Parameters:
runnable- the task to be performed
-
createWorkerJob
-
getWorkerJobName
-
getWorkbenchPart
Description copied from interface:ICompareContainerReturn the workbench part associated with this container ornullif there is no part or it is not available.- Specified by:
getWorkbenchPartin interfaceICompareContainer- Returns:
- the workbench part associated with this container or
null
-