Class AbstractEMFCompareEditorInput
- java.lang.Object
-
- org.eclipse.core.runtime.PlatformObject
-
- org.eclipse.compare.CompareEditorInput
-
- org.eclipse.emf.compare.ide.ui.internal.editor.AbstractEMFCompareEditorInput
-
- 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
- Direct Known Subclasses:
ComparisonEditorInput
,ComparisonScopeEditorInput
public abstract class AbstractEMFCompareEditorInput extends org.eclipse.compare.CompareEditorInput
Abstract subclass ofCompareEditorInput
to be use to open CompareEditor with results of EMF Compare.
-
-
Constructor Summary
Constructors Constructor Description AbstractEMFCompareEditorInput(EMFCompareConfiguration configuration, ICompareEditingDomain editingDomain, AdapterFactory adapterFactory)
Constructor that call super with an unmodifiedCompareConfiguration
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cancelPressed()
protected abstract Object
doPrepareInput(org.eclipse.core.runtime.IProgressMonitor monitor)
Runs the compare operation and returns the compare result.protected AdapterFactory
getAdapterFactory()
Returns the adapter factory as given to the constructor.EMFCompareConfiguration
getCompareConfiguration()
protected ICompareEditingDomain
getEditingDomain()
Returns the editing domain as given to the constructor.protected Object
prepareInput(org.eclipse.core.runtime.IProgressMonitor monitor)
-
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
-
-
-
-
Constructor Detail
-
AbstractEMFCompareEditorInput
public AbstractEMFCompareEditorInput(EMFCompareConfiguration configuration, ICompareEditingDomain editingDomain, AdapterFactory adapterFactory)
Constructor that call super with an unmodifiedCompareConfiguration
.- Parameters:
configuration
- the compare configuration as required byCompareEditorInput(CompareConfiguration)
.editingDomain
- the editing domain required to execute merge command. It must not be null.adapterFactory
- the adapter factory that will be used to adapt EObject to displayable elements. It must not be null.- Throws:
NullPointerException
- ifeditingDomain
oradapterFactory
is null.
-
-
Method Detail
-
getAdapterFactory
protected AdapterFactory getAdapterFactory()
Returns the adapter factory as given to the constructor.- Returns:
- the adapter factory, never null.
-
getEditingDomain
protected ICompareEditingDomain getEditingDomain()
Returns the editing domain as given to the constructor.- Returns:
- the editing domain, never null.
-
cancelPressed
public void cancelPressed()
It will undo all operations executed on the command stack until
no more can be undone
.- Overrides:
cancelPressed
in classorg.eclipse.compare.CompareEditorInput
- See Also:
CompareEditorInput.cancelPressed()
-
prepareInput
protected final Object prepareInput(org.eclipse.core.runtime.IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
- Specified by:
prepareInput
in classorg.eclipse.compare.CompareEditorInput
- Throws:
InvocationTargetException
InterruptedException
- See Also:
CompareEditorInput.prepareInput(org.eclipse.core.runtime.IProgressMonitor)
-
getCompareConfiguration
public EMFCompareConfiguration getCompareConfiguration()
- Overrides:
getCompareConfiguration
in classorg.eclipse.compare.CompareEditorInput
- See Also:
CompareEditorInput.getCompareConfiguration()
-
doPrepareInput
protected abstract Object doPrepareInput(org.eclipse.core.runtime.IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
Runs the compare operation and returns the compare result. Ifnull
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 throwingInterruptedException
.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.
- 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 theprepareInput
method must propagate a checked exception, it should wrap it inside anInvocationTargetException
; runtime exceptions are automatically wrapped in anInvocationTargetException
by the calling contextInterruptedException
- if the operation detects a request to cancel, usingIProgressMonitor.isCanceled()
, it should exit by throwingInterruptedException
-
-