public final class SyncInfoCompareInput extends SaveableCompareEditorInput implements IResourceChangeListener
SyncInfo
editor input used as input to a two-way or three-way
compare viewer. It defines methods for accessing the three sides for the
compare, and a name and image which is used when displaying the three way input
in an editor. This input can alternately be used to show compare results in
a dialog by calling CompareUI.openCompareDialog(org.eclipse.compare.CompareEditorInput)
.
The editor will not update when the elements in the sync info are changed.
Supports saving the local resource that is changed in the editor and will be updated when the local resources is changed.
SyncInfo
DIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGE
Constructor and Description |
---|
SyncInfoCompareInput(ISynchronizePageConfiguration configuration,
SyncInfo info) |
SyncInfoCompareInput(ISynchronizeParticipant participant,
SyncInfo sync)
Creates a compare editor input based on an existing
SyncInfo
from the given participant. |
SyncInfoCompareInput(String description,
SyncInfo sync)
Creates a compare editor input based on an existing
SyncInfo . |
Modifier and Type | Method and Description |
---|---|
boolean |
canRunAsJob()
Return whether this compare editor input can be run as a job.
|
boolean |
equals(Object other) |
protected void |
fireInputChange()
Callback from the resource saveable that is invoked when the resource is
saved so that this input can fire a change event for its input.
|
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class
associated with this object.
|
ICompareNavigator |
getNavigator()
Return the
ICompareNavigator associated with this container or null
if the container does not have a global navigator. |
SyncInfo |
getSyncInfo() |
String |
getToolTipText()
Returns the tool tip text for this editor input.
|
protected void |
handleDispose()
Callback that occurs when the UI associated with this compare editor
input is disposed.
|
int |
hashCode() |
protected ICompareInput |
prepareCompareInput(IProgressMonitor monitor)
Method called from
SaveableCompareEditorInput.prepareInput(IProgressMonitor) to obtain the input. |
void |
resourceChanged(IResourceChangeEvent event)
Note that until the compare editor inputs can be part of the compare editors lifecycle we
can't register as a listener because there is no dispose() method to remove the listener.
|
addCompareInputChangeListener, closeEditor, contentsCreated, createFileElement, createSaveable, findContentViewer, getActiveSaveables, getCompareInput, getImageDescriptor, getSaveable, getSaveables, getTitleImage, isDirty, prepareInput, registerContextMenu, removeCompareInputChangeListener
addPropertyChangeListener, belongsTo, cancelPressed, contributeToToolBar, createContents, createContentViewerSwitchingPane, createDiffViewer, createOutlineContents, createStructureInputPane, exists, findStructureViewer, firePropertyChange, flushLeftViewers, flushRightViewers, flushViewers, getActionBars, getCancelButtonLabel, getCompareConfiguration, getCompareResult, getContainer, getContentViewerDescriptor, getMessage, getName, getOKButtonLabel, getPersistable, getSelectedEdition, getServiceLocator, getStructureViewerDescriptor, getTitle, getWorkbenchPart, isEditionSelectionDialog, isLeftSaveNeeded, isRightSaveNeeded, isSaveNeeded, okPressed, removePropertyChangeListener, run, run, runAsynchronously, save, saveChanges, setContainer, setContentViewerDescriptor, setDirty, setFocus, setFocus2, setHelpContextId, setLeftDirty, setMessage, setRightDirty, setStatusMessage, setStructureViewerDescriptor, setTitle
public SyncInfoCompareInput(String description, SyncInfo sync)
SyncInfo
.description
- a description of the context of this sync info. This
is displayed to the user.sync
- the SyncInfo
used as the base for the compare input.public SyncInfoCompareInput(ISynchronizeParticipant participant, SyncInfo sync)
SyncInfo
from the given participant.participant
- the participant from which the sync info was obtained. The
name of the participant is used as the description which is displayed to the user.sync
- the SyncInfo
used as the base for the compare input.public SyncInfoCompareInput(ISynchronizePageConfiguration configuration, SyncInfo info)
protected void handleDispose()
CompareEditorInput
CompareEditorInput.createContents(Composite)
.
Subclasses can extend this method but ensure that the overridden method
is invoked.handleDispose
in class SaveableCompareEditorInput
public Object getAdapter(Class adapter)
PlatformObject
null
if
no such object can be found.
This implementation of the method declared by IAdaptable
passes the request along to the platform's adapter manager; roughly
Platform.getAdapterManager().getAdapter(this, adapter)
.
Subclasses may override this method (however, if they do so, they
should invoke the method on their superclass to ensure that the
Platform's adapter manager is consulted).
getAdapter
in interface IAdaptable
getAdapter
in class SaveableCompareEditorInput
adapter
- the class to adapt tonull
IAdaptable.getAdapter(Class)
public void resourceChanged(IResourceChangeEvent event)
resourceChanged
in interface IResourceChangeListener
event
- the resource change eventIResourceDelta
protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
SaveableCompareEditorInput
SaveableCompareEditorInput.prepareInput(IProgressMonitor)
to obtain the input. Its purpose
is to ensure that the input is an instance of ICompareInput
.prepareCompareInput
in class SaveableCompareEditorInput
monitor
- a progress monitorInvocationTargetException
InterruptedException
public String getToolTipText()
IEditorInput
getToolTipText
in interface IEditorInput
getToolTipText
in class CompareEditorInput
null
.public SyncInfo getSyncInfo()
public boolean canRunAsJob()
CompareEditorInput
false
is returned since traditionally inputs
were prepared in the foreground (i.e the UI was blocked when the
CompareEditorInput.run(IProgressMonitor)
method (and indirectly the
CompareEditorInput.prepareInput(IProgressMonitor)
method) was invoked. Subclasses
may override.canRunAsJob
in class SaveableCompareEditorInput
public ICompareNavigator getNavigator()
ICompareContainer
ICompareNavigator
associated with this container or null
if the container does not have a global navigator.getNavigator
in interface ICompareContainer
getNavigator
in class CompareEditorInput
ICompareNavigator
associated with this container or null
protected void fireInputChange()
SaveableCompareEditorInput
SaveableCompareEditorInput.createFileElement(IFile)
.fireInputChange
in class SaveableCompareEditorInput
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.