Class CompareContainer
- All Implemented Interfaces:
ICompareContainer
,IRunnableContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCompareInputChangeListener
(ICompareInput input, ICompareInputChangeListener listener) Register for change events for the given compare input.protected WorkerJob
Return the action bars for the container ornull
if the container does not have an action bars.Return theICompareNavigator
associated with this container ornull
if the container does not have a global navigator.Return the service locator for the container ornull
if the container does not have one.Return the workbench part associated with this container ornull
if there is no part or it is not available.protected String
void
registerContextMenu
(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.void
removeCompareInputChangeListener
(ICompareInput input, ICompareInputChangeListener listener) Remove the change listener from the given compare input.void
run
(boolean fork, boolean cancelable, IRunnableWithProgress runnable) Runs the givenIRunnableWithProgress
in this context.void
runAsynchronously
(IRunnableWithProgress runnable) Queue the given task to be run asynchronously.void
setStatusMessage
(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:ICompareContainer
Set the status message displayed by the container to the given message- Specified by:
setStatusMessage
in interfaceICompareContainer
- Parameters:
message
- the status message
-
addCompareInputChangeListener
public void addCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener) Description copied from interface:ICompareContainer
Register 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:
addCompareInputChangeListener
in interfaceICompareContainer
- Parameters:
input
- the compare inputlistener
- the compare input change listener
-
removeCompareInputChangeListener
public void removeCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener) Description copied from interface:ICompareContainer
Remove the change listener from the given compare input. Removing a listener that is not registered has no effect.- Specified by:
removeCompareInputChangeListener
in interfaceICompareContainer
- Parameters:
input
- the compare inputlistener
- the compare input change listener
-
registerContextMenu
Description copied from interface:ICompareContainer
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. The provided menu should have aIWorkbenchActionConstants.MB_ADDITIONS
separator as this is where the container will add actions.- Specified by:
registerContextMenu
in interfaceICompareContainer
- Parameters:
menu
- the menu being registeredselectionProvider
- the selection provider
-
getServiceLocator
Description copied from interface:ICompareContainer
Return the service locator for the container ornull
if the container does not have one.- Specified by:
getServiceLocator
in interfaceICompareContainer
- Returns:
- the service locator for the container or
null
-
getActionBars
Description copied from interface:ICompareContainer
Return the action bars for the container ornull
if the container does not have an action bars.- Specified by:
getActionBars
in 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:IRunnableContext
Runs the given
IRunnableWithProgress
in this context. For example, if this is aProgressMonitorDialog
then the runnable is run using this dialog's progress monitor.If
fork
isfalse
, the current thread is used to run the runnable. Note that iffork
istrue
, 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:
run
in interfaceIRunnableContext
- Parameters:
fork
-true
if the runnable should be run in a separate thread, andfalse
to run in the same threadcancelable
-true
to enable the cancelation, andfalse
to 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:ICompareContainer
Queue 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:
runAsynchronously
in interfaceICompareContainer
- Parameters:
runnable
- the task to be performed
-
createWorkerJob
-
getWorkerJobName
-
getWorkbenchPart
Description copied from interface:ICompareContainer
Return the workbench part associated with this container ornull
if there is no part or it is not available.- Specified by:
getWorkbenchPart
in interfaceICompareContainer
- Returns:
- the workbench part associated with this container or
null
-