- All Implemented Interfaces:
Method SummaryModifier and TypeMethodDescription
protected ICompareInputReturn a compare input that represents the selection.
CANCELbutton was pressed in a dialog.
voidCalled whenever the content of the given source has changed.Creates the SWT controls that are used to display the result of the compare operation.
protected IPageCreate the page for this part and return the top level control for the page.Returns the label used for the
CANCELbutton when this input is shown in a compare dialog using
CompareUI.openCompareDialog(CompareEditorInput).Returns the label to be used for the
OKbutton when this input is displayed in a dialog.Return the synchronize page configuration for this partReturn the Synchronize participant for this part
protected ISelectionProviderReturn the selection provider for the page.Returns the title image which will be used in the compare editor's title bar.
protected voidCallback that occurs when the UI associated with this compare editor input is disposed.
protected booleanReturn whether the ability to remember the participant in the synchronize view should be presented to the user.
trueif there are unsaved changes in either left or right side.
OKbutton was pressed in a dialog.
protected voidPrepare the compare input for display in a content viewer.
protected ObjectRuns the compare operation and returns the compare result.
voidSaves any unsaved changes.
Methods inherited from class org.eclipse.team.ui.PageCompareEditorInput
canRunAsJob, createStructureInputPane, prepareCompareInput, setPageDescription
Methods inherited from class org.eclipse.compare.CompareEditorInput
addCompareInputChangeListener, addPropertyChangeListener, belongsTo, contentsCreated, contributeToToolBar, createContentViewerSwitchingPane, createDiffViewer, createOutlineContents, exists, findContentViewer, findStructureViewer, firePropertyChange, flushLeftViewers, flushRightViewers, flushViewers, getActionBars, getAdapter, getCompareConfiguration, getCompareResult, getContainer, getContentViewerDescriptor, getImageDescriptor, getMessage, getName, getNavigator, getPersistable, getSelectedEdition, getServiceLocator, getStructureViewerDescriptor, getTitle, getToolTipText, getWorkbenchPart, isDirty, isEditionSelectionDialog, isLeftSaveNeeded, isRightSaveNeeded, registerContextMenu, removeCompareInputChangeListener, removePropertyChangeListener, run, run, runAsynchronously, save, setContainer, setContentViewerDescriptor, setDirty, setFocus, setFocus2, setHelpContextId, setLeftDirty, setMessage, setRightDirty, setStatusMessage, setStructureViewerDescriptor, setTitle
(CompareConfiguration configuration, ISynchronizePageConfiguration pageConfiguration, ISynchronizeParticipant participant)Creates a part for the provided participant. The page configuration is used when creating the participant page and the resulting compare/merge panes will be configured with the provided compare configuration.
configuration- the compare configuration that will be used to create the compare panes
pageConfiguration- the configuration that will be provided to the participant prior to creating the page
participant- the participant whose page will be displayed in this part
prepareInputprotected Object prepareInput
(IProgressMonitor monitor) throws InvocationTargetException, InterruptedExceptionRuns the compare operation and returns the compare result. If
nullis 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
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:
monitor- the progress monitor to use to display progress and receive requests for cancellation
- the result of the compare operation, or
nullif there are no differences
InvocationTargetException- if the
prepareInputmethod must propagate a checked exception, it should wrap it inside an
InvocationTargetException; runtime exceptions are automatically wrapped in an
InvocationTargetExceptionby the calling context
InterruptedException- if the operation detects a request to cancel, using
IProgressMonitor.isCanceled(), it should exit by throwing
getTitleImagepublic Image getTitleImage()Returns the title image which will be used in the compare editor's title bar. Returns the title image which will be used when presenting the compare result. This implementation returns a generic compare icon. Subclasses can override.
handleDisposeprotected void handleDispose()Callback 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 to
CompareEditorInput.createContents(Composite). Subclasses can extend this method but ensure that the overridden method is invoked.
createPageCreate the page for this part and return the top level control for the page.
getSelectionProviderprotected ISelectionProvider getSelectionProvider()Return the selection provider for the page. This method is called after the page is created in order to register a selection listener on the page.
asCompareInputReturn a compare input that represents the selection. This input is used to feed the structure and content viewers. By default, a compare input is returned if the selection is of size 1 and the selected element implements
ICompareInput. Subclasses may override.
prepareInputprotected void prepareInput
(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor) throws InvocationTargetExceptionPrepare the compare input for display in a content viewer. This method is called from
PageCompareEditorInput.prepareCompareInput(ICompareInput)and may be called from a non-UI thread. This method should not be called by others.
isSaveNeededpublic boolean isSaveNeeded()Returns
trueif there are unsaved changes in either left or right side. The value returned is the value of the
DIRTY_STATEproperty of this input object. Returns
trueif left or right side has unsaved changes Subclasses don't have to override if the functionality provided by
saveChangesSaves any unsaved changes. Subclasses must override to save any changes. This implementation tries to flush changes in all viewers by calling
contentChangedpublic void contentChanged
(IContentChangeNotifier source)Description copied from interface:
IContentChangeListenerCalled whenever the content of the given source has changed.
getPageConfigurationpublic ISynchronizePageConfiguration getPageConfiguration()Return the synchronize page configuration for this part
- Returns the pageConfiguration.
getParticipantpublic ISynchronizeParticipant getParticipant()Return the Synchronize participant for this part
- Returns the participant.
createContentsCreates the SWT controls that are used to display the result of the compare operation. Creates the SWT Controls and sets up the wiring between the individual panes. This implementation creates all four panes but makes only the necessary ones visible. Finally it feeds the compare result into the top left structure viewer and the content viewer.
Subclasses may override if they need to change the layout or wiring between panes.
isOfferToRememberParticipantprotected boolean isOfferToRememberParticipant()Return whether the ability to remember the participant in the synchronize view should be presented to the user. By default,
trueis returned. Subclasses may override.
- whether the ability to remember the participant in the synchronize view should be presented to the user
okPressedpublic boolean okPressed()The
OKbutton was pressed in a dialog. If one or both of the sides of the input is editable then any changes will be saved. If the input is for edition selection (see
CompareEditorInput.isEditionSelectionDialog()), it is up to subclasses to override this method in order to perform the appropriate operation on the selected edition.
cancelPressedpublic void cancelPressed()The
CANCELbutton was pressed in a dialog. By default, nothing is done. Subclasses may override.
getOKButtonLabelpublic String getOKButtonLabel()Returns the label to be used for the
OKbutton when this input is displayed in a dialog. By default, different labels are used depending on whether the input is editable or is for edition selection (see
getCancelButtonLabelpublic String getCancelButtonLabel()Returns the label used for the
CANCELbutton when this input is shown in a compare dialog using