Package org.eclipse.team.ui.synchronize
Class SyncInfoCompareInput
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.compare.CompareEditorInput
org.eclipse.team.ui.synchronize.SaveableCompareEditorInput
org.eclipse.team.ui.synchronize.SyncInfoCompareInput
- All Implemented Interfaces:
- EventListener,- ICompareContainer,- IPropertyChangeNotifier,- IResourceChangeListener,- IAdaptable,- IRunnableContext,- IRunnableWithProgress,- IEditorInput,- ISaveablesSource
public final class SyncInfoCompareInput
extends SaveableCompareEditorInput
implements IResourceChangeListener
A 
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.
- Since:
- 3.0
- See Also:
- 
Field SummaryFields inherited from class org.eclipse.compare.CompareEditorInputDIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGEFields inherited from interface org.eclipse.core.resources.IResourceChangeListenerPROPERTY_EVENT_MASK
- 
Constructor SummaryConstructorsConstructorDescriptionSyncInfoCompareInput(String description, SyncInfo sync) Creates a compare editor input based on an existingSyncInfo.SyncInfoCompareInput(ISynchronizePageConfiguration configuration, SyncInfo info) SyncInfoCompareInput(ISynchronizeParticipant participant, SyncInfo sync) Creates a compare editor input based on an existingSyncInfofrom the given participant.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns whether this compare editor input can be run as a job.booleanprotected voidCallback from the resource saveable that is invoked when the resource is saved so that this input can fire a change event for its input.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Return theICompareNavigatorassociated with this container ornullif the container does not have a global navigator.Returns the tool tip text for this editor input.protected voidCallback that occurs when the UI associated with this compare editor input is disposed.inthashCode()protected ICompareInputprepareCompareInput(IProgressMonitor monitor) Method called fromSaveableCompareEditorInput.prepareInput(IProgressMonitor)to obtain the input.voidNote 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.Methods inherited from class org.eclipse.team.ui.synchronize.SaveableCompareEditorInputaddCompareInputChangeListener, closeEditor, contentsCreated, createFileElement, createSaveable, findContentViewer, getActiveSaveables, getCompareInput, getImageDescriptor, getSaveable, getSaveables, getTitleImage, isDirty, prepareInput, registerContextMenu, removeCompareInputChangeListenerMethods inherited from class org.eclipse.compare.CompareEditorInputaddPropertyChangeListener, 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
- 
Constructor Details- 
SyncInfoCompareInputCreates a compare editor input based on an existingSyncInfo.- Parameters:
- description- a description of the context of this sync info. This is displayed to the user.
- sync- the- SyncInfoused as the base for the compare input.
 
- 
SyncInfoCompareInputCreates a compare editor input based on an existingSyncInfofrom the given participant.- Parameters:
- 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- SyncInfoused as the base for the compare input.
- Since:
- 3.1
 
- 
SyncInfoCompareInput
 
- 
- 
Method Details- 
handleDisposeprotected void handleDispose()Description copied from class:CompareEditorInputCallback that occurs when the UI associated with this compare editor input is disposed. This method will only be invoked if the UI has been created (i.e. after the call toCompareEditorInput.createContents(Composite). Subclasses can extend this method but ensure that the overridden method is invoked.- Overrides:
- handleDisposein class- SaveableCompareEditorInput
 
- 
getAdapterDescription copied from class:PlatformObjectReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.This implementation of the method declared by IAdaptablepasses the request along to the platform's adapter manager; roughlyPlatform.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).- Specified by:
- getAdapterin interface- IAdaptable
- Overrides:
- getAdapterin class- SaveableCompareEditorInput
- Type Parameters:
- T- the class type
- Parameters:
- adapter- the class to adapt to
- Returns:
- the adapted object or null
- See Also:
 
- 
resourceChangedNote 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.- Specified by:
- resourceChangedin interface- IResourceChangeListener
- Parameters:
- event- the resource change event
- See Also:
 
- 
prepareCompareInputprotected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException Description copied from class:SaveableCompareEditorInputMethod called fromSaveableCompareEditorInput.prepareInput(IProgressMonitor)to obtain the input. Its purpose is to ensure that the input is an instance ofICompareInput.- Specified by:
- prepareCompareInputin class- SaveableCompareEditorInput
- Parameters:
- monitor- a progress monitor
- Returns:
- the compare input
- Throws:
- InvocationTargetException- if an error occurs
- InterruptedException- if operation is interrupted
 
- 
getToolTipTextDescription copied from interface:IEditorInputReturns the tool tip text for this editor input. This text is used to differentiate between two input with the same name. For instance, MyClass.java in folder X and MyClass.java in folder Y. The format of the text varies between input types.- Specified by:
- getToolTipTextin interface- IEditorInput
- Overrides:
- getToolTipTextin class- CompareEditorInput
- Returns:
- the tool tip text; never null.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
getSyncInfo
- 
canRunAsJobpublic boolean canRunAsJob()Description copied from class:CompareEditorInputReturns whether this compare editor input can be run as a job. By default,falseis returned since traditionally inputs were prepared in the foreground (i.e the UI was blocked when theCompareEditorInput.run(IProgressMonitor)method (and indirectly theCompareEditorInput.prepareInput(IProgressMonitor)method) was invoked. Subclasses may override.- Overrides:
- canRunAsJobin class- SaveableCompareEditorInput
- Returns:
- whether this compare editor input can be run in the background
 
- 
fireInputChangeprotected void fireInputChange()Description copied from class:SaveableCompareEditorInputCallback from the resource saveable that is invoked when the resource is saved so that this input can fire a change event for its input. Subclasses only need this method if the left side of their compare input is an element returned fromSaveableCompareEditorInput.createFileElement(IFile).- Specified by:
- fireInputChangein class- SaveableCompareEditorInput
 
 
-