Class TextFallbackMergeViewer
- All Implemented Interfaces:
org.eclipse.compare.contentmergeviewer.IFlushable,org.eclipse.compare.internal.IFlushable2,org.eclipse.compare.IPropertyChangeNotifier,org.eclipse.core.runtime.IAdaptable,org.eclipse.jface.viewers.IInputProvider,org.eclipse.jface.viewers.IInputSelectionProvider,org.eclipse.jface.viewers.ISelectionProvider
-
Field Summary
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY -
Constructor Summary
ConstructorsConstructorDescriptionTextFallbackMergeViewer(org.eclipse.swt.widgets.Composite parent, EMFCompareConfiguration configuration) Creates an instance under the given parent using the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) protected org.eclipse.jface.text.source.SourceViewercreateSourceViewer(org.eclipse.swt.widgets.Composite parent, int textOrientation) protected voidcreateToolItems(org.eclipse.jface.action.ToolBarManager tbm) protected EMFCompareConfigurationgetInput()getTitle()protected voidhandleDispose(org.eclipse.swt.events.DisposeEvent event) voidListens to editing domain changes on theevent bus.protected voidhandlePropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent event) protected booleanprotected booleanvoidremovePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) voidsetContentProvider(org.eclipse.jface.viewers.IContentProvider contentProvider) voidprotected voidsetLeftDirty(boolean dirty) protected voidsetRightDirty(boolean dirty) protected voidMethods inherited from class org.eclipse.compare.contentmergeviewer.TextMergeViewer
configureTextViewer, copy, createCenterControl, createControls, createIgnoreWhitespaceContributor, createTokenComparator, doSave, findInsertionPosition, flushContent, getAdapter, getCenterWidth, getContents, getDocumentPartitioner, getDocumentPartitioning, getEditorInput, handleCompareInputChange, handleResizeAncestor, handleResizeLeftRight, handleSetFocus, invalidateTextPresentation, isEditorBacked, setActionsActivated, setBackgroundColor, setEditable, setForegroundColor, setupDocument, updateContent, updateHeaderMethods inherited from class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
buildControl, flush, flushLeft, flushRight, getCenterControl, getControl, getResourceBundle, getSelection, getToolBarManager, hookControl, inputChanged, internalIsLeftDirty, internalIsRightDirty, isAncestorVisible, isLeftEditable, isRightEditable, isThreeWay, refresh, save, setConfirmSave, setSelectionMethods inherited from class org.eclipse.jface.viewers.ContentViewer
getContentProvider, getLabelProvider, handleLabelProviderChanged, labelProviderChanged, setLabelProviderMethods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
-
Constructor Details
-
TextFallbackMergeViewer
public TextFallbackMergeViewer(org.eclipse.swt.widgets.Composite parent, EMFCompareConfiguration configuration) Creates an instance under the given parent using the given configuration.- Parameters:
parent- the parent composite under which to create this viewer.configuration- the EMF compare configuration used by this viewer.
-
-
Method Details
-
handleEditingDomainChange
Listens to editing domain changes on theevent bus.- Parameters:
event- the editing domain change event.
-
addPropertyChangeListener
public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) This implementation subverts calls to
superso that nothing can actually listen to underlying state changes to the dirty state of this viewer's source viewers. It manages its ownlistenersandinforms listeners of the dirty statebased on changes tocommand stack state.- Specified by:
addPropertyChangeListenerin interfaceorg.eclipse.compare.IPropertyChangeNotifier- Overrides:
addPropertyChangeListenerin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.removePropertyChangeListener(IPropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) This implementation subverts calls to
superso that nothing can actually listen to underlying state changes to the dirty state of this viewer's source viewers. It manages its ownlisteners.- Specified by:
removePropertyChangeListenerin interfaceorg.eclipse.compare.IPropertyChangeNotifier- Overrides:
removePropertyChangeListenerin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.removePropertyChangeListener(IPropertyChangeListener)
-
isLeftDirty
protected boolean isLeftDirty()This implementation returns the
stateof thecommand stackwhen the command stack isupdating the dirty state.- Overrides:
isLeftDirtyin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.isLeftDirty()
-
setLeftDirty
protected void setLeftDirty(boolean dirty) This implementation
updates the headerbecause the labelincludes a dirty state indication.- Overrides:
setLeftDirtyin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.setLeftDirty(boolean)
-
isRightDirty
protected boolean isRightDirty()This implementation returns the
stateof thecommand stackwhen the command stack isupdating the dirty state.- Overrides:
isRightDirtyin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.isRightDirty()
-
setRightDirty
protected void setRightDirty(boolean dirty) This implementation
updates the headerbecause the labelincludes a dirty state indication.- Overrides:
setRightDirtyin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.setRightDirty(boolean)
-
createToolItems
protected void createToolItems(org.eclipse.jface.action.ToolBarManager tbm) This implementation also creates a
preview actionthat's useful for showing the saved contents of resource in their current state of modification.- Overrides:
createToolItemsin classorg.eclipse.compare.contentmergeviewer.TextMergeViewer- See Also:
-
TextMergeViewer.createToolItems(ToolBarManager)
-
updateToolItems
protected void updateToolItems()This implementation also updates the
preview action.- Overrides:
updateToolItemsin classorg.eclipse.compare.contentmergeviewer.TextMergeViewer- See Also:
-
TextMergeViewer.updateToolItems()
-
getCompareConfiguration
This implementation assumes the configuration must be an
EMFCompareConfiguration, returning it as such.- Overrides:
getCompareConfigurationin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.getCompareConfiguration()
-
setContentProvider
public void setContentProvider(org.eclipse.jface.viewers.IContentProvider contentProvider) This specialized implementation
ignorescontent provider changes except when explicitly set in theconstructorand when this implementation ishandling mirror changes.- Overrides:
setContentProviderin classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.setContentProvider(IContentProvider)
-
setInput
This implementation is specialized to
adaptthe input and toselectthe objects of the input.- Overrides:
setInputin classorg.eclipse.jface.viewers.ContentViewer- See Also:
-
ContentViewer.setInput(Object)
-
createSourceViewer
protected org.eclipse.jface.text.source.SourceViewer createSourceViewer(org.eclipse.swt.widgets.Composite parent, int textOrientation) This implementation simply delegates to
superbut it is used to record theancesorViewer,leftViewer, andrightViewerwhich are needed insetInput(Object)toselectobjects.- Overrides:
createSourceViewerin classorg.eclipse.compare.contentmergeviewer.TextMergeViewer- See Also:
-
TextMergeViewer.createSourceViewer(Composite, int)
-
getInput
This class' specialized
setInputmethod transforms the real input, so it's important that we return theoriginalInputwhen that isn'tnull.- Specified by:
getInputin interfaceorg.eclipse.jface.viewers.IInputProvider- Overrides:
getInputin classorg.eclipse.jface.viewers.ContentViewer- See Also:
-
setInput(Object)ContentViewer.getInput()
-
handleDispose
protected void handleDispose(org.eclipse.swt.events.DisposeEvent event) - Overrides:
handleDisposein classorg.eclipse.compare.contentmergeviewer.TextMergeViewer- See Also:
-
TextMergeViewer.handleDispose(org.eclipse.swt.events.DisposeEvent)
-
handlePropertyChangeEvent
protected void handlePropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent event) This implementation uses the
mirror managerto subvertsuper'shandling of mirror state changes so that it can handle the state change in a better way than does the base class.- Overrides:
handlePropertyChangeEventin classorg.eclipse.compare.contentmergeviewer.TextMergeViewer- See Also:
-
TextMergeViewer.handlePropertyChangeEvent(PropertyChangeEvent)
-
getTitle
- Overrides:
getTitlein classorg.eclipse.compare.contentmergeviewer.ContentMergeViewer- See Also:
-
ContentMergeViewer.getTitle()
-
getOriginalInput
-
getEffectiveInput
-