# Class CompareContainer

java.lang.Object
org.eclipse.compare.internal.CompareContainer

All Implemented Interfaces:
  `ICompareContainer, IRunnableContext`

public class CompareContainer extends Object implements ICompareContainer

## Constructor Summary

Constructors
Constructor
Description
`CompareContainer()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener)`
Register for change events for the given compare input.
`protected WorkerJob`
`createWorkerJob()`
`IActionBars`
`getActionBars()`
Return the action bars for the container or `null` if the container does not have an action bars.
`ICompareNavigator`
`getNavigator()`
Return the `ICompareNavigator` associated with this container or `null` if the container does not have a global navigator.
`IServiceLocator`
`getServiceLocator()`
Return the service locator for the container or `null` if the container does not have one.
`IWorkbenchPart`
`getWorkbenchPart()`
Return the workbench part associated with this container or `null` if there is no part or it is not available.
`protected String`
`getWorkerJobName()`
`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 given `IRunnableWithProgress` 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

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CompareContainer

public CompareContainer()

## Method Details

### setStatusMessage

public void setStatusMessage(String message)
Description copied from interface: `ICompareContainer`
Set the status message displayed by the container to the given message

Specified by:
  `setStatusMessage` in interface `ICompareContainer`
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 interface `ICompareContainer`
Parameters:
  `input` - the compare input
  `listener` - 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 interface `ICompareContainer`
Parameters:
  `input` - the compare input
  `listener` - the compare input change listener

### registerContextMenu

public void registerContextMenu(MenuManager menu, ISelectionProvider selectionProvider)
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 a `IWorkbenchActionConstants.MB_ADDITIONS` separator as this is where the container will add actions.

Specified by:
  `registerContextMenu` in interface `ICompareContainer`
Parameters:
  `menu` - the menu being registered
  `selectionProvider` - the selection provider

### getServiceLocator

public IServiceLocator getServiceLocator()
Description copied from interface: `ICompareContainer`
Return the service locator for the container or `null` if the container does not have one.

Specified by:
  `getServiceLocator` in interface `ICompareContainer`
Returns:
  the service locator for the container or `null`

### getActionBars

public IActionBars getActionBars()
Description copied from interface: `ICompareContainer`
Return the action bars for the container or `null` if the container does not have an action bars.

Specified by:
  `getActionBars` in interface `ICompareContainer`
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 a `ProgressMonitorDialog` then the runnable is run using this dialog's progress monitor.

If `fork` is `false`, the current thread is used to run the runnable. Note that if `fork` is `true`, 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 interface `IRunnableContext`
Parameters:
  `fork` - `true` if the runnable should be run in a separate thread, and `false` to run in the same thread
  `cancelable` - `true` to enable the cancelation, and `false` to make the operation uncancellable
  `runnable` - the runnable to run
Throws:
  `InvocationTargetException` - wraps any exception or error which occurs while running the runnable
  `InterruptedException` - propagated by the context if the runnable acknowledges cancelation by throwing this exception. This should not be thrown if cancelable is `false`.

### getNavigator

public ICompareNavigator getNavigator()
Description copied from interface: `ICompareContainer`
Return the `ICompareNavigator` associated with this container or `null` if the container does not have a global navigator.

Specified by:
  `getNavigator` in interface `ICompareContainer`
Returns:
  the `ICompareNavigator` associated with this container or `null`

### runAsynchronously

public void runAsynchronously(IRunnableWithProgress runnable)
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 interface `ICompareContainer`
Parameters:
  `runnable` - the task to be performed

### createWorkerJob

protected WorkerJob createWorkerJob()

### getWorkerJobName

protected String getWorkerJobName()

### getWorkbenchPart

public IWorkbenchPart getWorkbenchPart()
Description copied from interface: `ICompareContainer`
Return the workbench part associated with this container or `null` if there is no part or it is not available.

Specified by:
  `getWorkbenchPart` in interface `ICompareContainer`
Returns:
  the workbench part associated with this container or `null`