Package org.eclipse.team.ui
Class PageCompareEditorInput
- java.lang.Object
-
- org.eclipse.core.runtime.PlatformObject
-
- org.eclipse.compare.CompareEditorInput
-
- org.eclipse.team.ui.PageCompareEditorInput
-
- All Implemented Interfaces:
ICompareContainer,IContentChangeListener,IPropertyChangeNotifier,IAdaptable,IRunnableContext,IRunnableWithProgress,IEditorInput
- Direct Known Subclasses:
HistoryPageCompareEditorInput,ParticipantPageCompareEditorInput
public abstract class PageCompareEditorInput extends CompareEditorInput implements IContentChangeListener
Abstract class for hosting a page based structure input view for the purposes of feeding compare viewers.This class is not intended to be subclassed by clients outside of the Team framework.
- Since:
- 3.3
-
-
Field Summary
-
Fields inherited from class org.eclipse.compare.CompareEditorInput
DIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPageCompareEditorInput(CompareConfiguration configuration)Create a page compare editor input.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ICompareInputasCompareInput(ISelection selection)Return a compare input that represents the selection.booleancanRunAsJob()Returns whether this compare editor input can be run as a job.voidcontentChanged(IContentChangeNotifier source)Called whenever the content of the given source has changed.protected abstract IPagecreatePage(CompareViewerPane parent, IToolBarManager toolBarManager)Create the page for this part and return the top level control for the page.protected CompareViewerPanecreateStructureInputPane(Composite parent)Create the pane that will contain the structure input pane (upper left).protected abstract ISelectionProvidergetSelectionProvider()Return the selection provider for the page.protected voidhandleDispose()Callback that occurs when the UI associated with this compare editor input is disposed.protected voidprepareCompareInput(ICompareInput input)Convenience method that callsprepareInput(ICompareInput, CompareConfiguration, IProgressMonitor)with a progress monitor.protected abstract voidprepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor)Prepare the compare input for display in a content viewer.protected voidsetPageDescription(String title)Set the title of the page's page to the given text.-
Methods inherited from class org.eclipse.compare.CompareEditorInput
addCompareInputChangeListener, addPropertyChangeListener, belongsTo, cancelPressed, contentsCreated, contributeToToolBar, createContents, createContentViewerSwitchingPane, createDiffViewer, createOutlineContents, exists, findContentViewer, findStructureViewer, firePropertyChange, flushLeftViewers, flushRightViewers, flushViewers, getActionBars, getAdapter, getCancelButtonLabel, getCompareConfiguration, getCompareResult, getContainer, getContentViewerDescriptor, getImageDescriptor, getMessage, getName, getNavigator, getOKButtonLabel, getPersistable, getSelectedEdition, getServiceLocator, getStructureViewerDescriptor, getTitle, getTitleImage, getToolTipText, getWorkbenchPart, isDirty, isEditionSelectionDialog, isLeftSaveNeeded, isRightSaveNeeded, isSaveNeeded, okPressed, prepareInput, registerContextMenu, removeCompareInputChangeListener, removePropertyChangeListener, run, run, runAsynchronously, save, saveChanges, setContainer, setContentViewerDescriptor, setDirty, setFocus, setFocus2, setHelpContextId, setLeftDirty, setMessage, setRightDirty, setStatusMessage, setStructureViewerDescriptor, setTitle
-
-
-
-
Constructor Detail
-
PageCompareEditorInput
protected PageCompareEditorInput(CompareConfiguration configuration)
Create a page compare editor input.- Parameters:
configuration- the compare configuration
-
-
Method Detail
-
createStructureInputPane
protected CompareViewerPane createStructureInputPane(Composite parent)
Description copied from class:CompareEditorInputCreate the pane that will contain the structure input pane (upper left). By default, aCompareViewerSwitchingPaneis returned. Subclasses may override to provide an alternate pane.- Overrides:
createStructureInputPanein classCompareEditorInput- Parameters:
parent- the parent composite- Returns:
- the structure input pane
-
createPage
protected abstract IPage createPage(CompareViewerPane parent, IToolBarManager toolBarManager)
Create the page for this part and return the top level control for the page.- Parameters:
parent- the parent compositetoolBarManager- the toolbar manager for the page- Returns:
- the top-level control for the page
-
getSelectionProvider
protected abstract 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.- Returns:
- the selection provider for the page
-
setPageDescription
protected void setPageDescription(String title)
Set the title of the page's page to the given text. The title will appear in the header of the pane containing the page.- Parameters:
title- the page's title
-
handleDispose
protected 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 classCompareEditorInput
-
asCompareInput
protected ICompareInput asCompareInput(ISelection selection)
Return 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 implementsICompareInput. Subclasses may override.- Parameters:
selection- the selection- Returns:
- a compare input representing the selection
-
prepareCompareInput
protected final void prepareCompareInput(ICompareInput input)
Convenience method that callsprepareInput(ICompareInput, CompareConfiguration, IProgressMonitor)with a progress monitor.- Parameters:
input- the compare input to be prepared
-
contentChanged
public void contentChanged(IContentChangeNotifier source)
Description copied from interface:IContentChangeListenerCalled whenever the content of the given source has changed.- Specified by:
contentChangedin interfaceIContentChangeListener- Parameters:
source- the source whose contents has changed
-
canRunAsJob
public 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 classCompareEditorInput- Returns:
- whether this compare editor input can be run in the background
-
prepareInput
protected abstract void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor) throws InvocationTargetException
Prepare the compare input for display in a content viewer. This method is called fromprepareCompareInput(ICompareInput)and may be called from a non-UI thread. This method should not be called by others.- Parameters:
input- the inputconfiguration- the compare configurationmonitor- a progress monitor- Throws:
InvocationTargetException
-
-