org.eclipse.emf.compare.ide.ui.internal.editor

## Class ComparisonScopeEditorInput

- java.lang.Object
- - org.eclipse.core.runtime.PlatformObject
  - - org.eclipse.compare.CompareEditorInput
    - - org.eclipse.emf.compare.ide.ui.internal.editor.AbstractEMFCompareEditorInput
      - - org.eclipse.emf.compare.ide.ui.internal.editor.ComparisonScopeEditorInput

All Implemented Interfaces:
  org.eclipse.compare.ICompareContainer, org.eclipse.compare.IPropertyChangeNotifier, org.eclipse.core.runtime.IAdaptable, org.eclipse.jface.operation.IRunnableContext, org.eclipse.jface.operation.IRunnableWithProgress, org.eclipse.ui.IEditorInput

    public class ComparisonScopeEditorInput
    extends AbstractEMFCompareEditorInput

CompareEditorInput that will compute the result of the comparison of the given scope with the given comparator.

### Field Summary

### Fields inherited from class org.eclipse.compare.CompareEditorInput

`DIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGE`

### Constructor Summary

Constructors
Constructor and Description
`ComparisonScopeEditorInput(EMFCompareConfiguration configuration, ICompareEditingDomain editingDomain, AdapterFactory adapterFactory, EMFCompare comparator, IComparisonScope scope)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cancelPressed()` It will undo all operations executed on the command stack until `no more can be undone`.
`protected Object` `doPrepareInput(org.eclipse.core.runtime.IProgressMonitor monitor)` Runs the compare operation and returns the compare result.

### Methods inherited from class org.eclipse.emf.compare.ide.ui.internal.editor.AbstractEMFCompareEditorInput

`getAdapterFactory, getCompareConfiguration, getEditingDomain, prepareInput`

### Methods inherited from class org.eclipse.compare.CompareEditorInput

`addCompareInputChangeListener, addPropertyChangeListener, belongsTo, canRunAsJob, contentsCreated, contributeToToolBar, createContents, createContentViewerSwitchingPane, createDiffViewer, createOutlineContents, createStructureInputPane, exists, findContentViewer, findStructureViewer, firePropertyChange, flushLeftViewers, flushRightViewers, flushViewers, getActionBars, getAdapter, getCancelButtonLabel, getCompareResult, getContainer, getContentViewerDescriptor, getImageDescriptor, getMessage, getName, getNavigator, getOKButtonLabel, getPersistable, getSelectedEdition, getServiceLocator, getStructureViewerDescriptor, getTitle, getTitleImage, getToolTipText, getWorkbenchPart, handleDispose, isDirty, isEditionSelectionDialog, isLeftSaveNeeded, isRightSaveNeeded, isSaveNeeded, okPressed, registerContextMenu, removeCompareInputChangeListener, removePropertyChangeListener, run, run, runAsynchronously, save, saveChanges, setContainer, setContentViewerDescriptor, setDirty, setFocus, setFocus2, setHelpContextId, setLeftDirty, setMessage, setRightDirty, setStatusMessage, setStructureViewerDescriptor, setTitle`

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### ComparisonScopeEditorInput

    public ComparisonScopeEditorInput(EMFCompareConfiguration configuration,
                                      ICompareEditingDomain editingDomain,
                                      AdapterFactory adapterFactory,
                                      EMFCompare comparator,
                                      IComparisonScope scope)

Parameters:
  `configuration` -

### Method Detail

#### doPrepareInput

    protected Object doPrepareInput(org.eclipse.core.runtime.IProgressMonitor monitor)
                             throws InvocationTargetException,
                                    InterruptedException

Runs the compare operation and returns the compare result. If `null` is returned no differences were found and no compare editor needs to be opened. Progress should be reported to the given progress monitor. A request to cancel the operation should be honored and acknowledged by throwing `InterruptedException`.

Note: this method is typically called in a modal context thread which doesn't have a Display assigned. Implementors of this method shouldn't therefore allocated any SWT resources in this method.

Specified by:
  `doPrepareInput` in class `AbstractEMFCompareEditorInput`
Parameters:
  `monitor` - the progress monitor to use to display progress and receive requests for cancellation
Returns:
  the result of the compare operation, or `null` if there are no differences
Throws:
  `InvocationTargetException` - if the `prepareInput` method must propagate a checked exception, it should wrap it inside an `InvocationTargetException`; runtime exceptions are automatically wrapped in an `InvocationTargetException` by the calling context
  `InterruptedException` - if the operation detects a request to cancel, using `IProgressMonitor.isCanceled()`, it should exit by throwing `InterruptedException`
See Also:
  `AbstractEMFCompareEditorInput.doPrepareInput(org.eclipse.core.runtime.IProgressMonitor)`

#### cancelPressed

    public void cancelPressed()

It will undo all operations executed on the command stack until `no more can be undone`.

Overrides:
  `cancelPressed` in class `AbstractEMFCompareEditorInput`
See Also:
  `CompareEditorInput.cancelPressed()`