Class ThreeSideTextMergeEditorInput
java.lang.Object
com._1c.g5.v8.dt.compare.ui.mergeviewer.ThreeSideTextMergeEditorInput
- All Implemented Interfaces:
org.eclipse.compare.IPropertyChangeNotifier,org.eclipse.core.runtime.IAdaptable,org.eclipse.ui.IEditorInput
- Direct Known Subclasses:
BslModuleThreeSideMergeEditorInput
public class ThreeSideTextMergeEditorInput
extends Object
implements org.eclipse.ui.IEditorInput, org.eclipse.compare.IPropertyChangeNotifier
A text merge operations which can present its results in a special editor.
A ThreeSideTextMergeEditorInput defines methods for the following sequence steps:
- creating a UI for displaying the text and initializing the some widgets with the compare/merge result,
- tracking the dirty state of the text in case of merge,
- saving the merge changes.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThreeSideTextMergeEditorInput(org.eclipse.compare.CompareConfiguration compareConfiguration, IThreeSideTextMergeInput mergeInput) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) createMergeViewerPanel(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.services.IServiceLocator serviceLocator) Creates the merge viewer panel that is used to display the result of the merge operations.booleanexists()findContentViewer(ThreeSideTextMergeViewerRegistry.ViewerDescriptor newViewerDescriptor, org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.services.IServiceLocator serviceLocator) Finds and creates the text merge viewer for the given viewer descriptor under the given parent control.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) org.eclipse.compare.CompareConfigurationReturns the compare configuration.final org.eclipse.compare.ICompareContainerReturns the container of this input.org.eclipse.jface.resource.ImageDescriptorReturns the merge viewer input.getName()org.eclipse.ui.IPersistableElementbooleanisDirty()Checks whether there are unsaved changes.voidremovePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) voidsaveChanges(org.eclipse.core.runtime.IProgressMonitor monitor) Saves any unsaved changes.voidsetContainer(org.eclipse.compare.ICompareContainer compareContainer) Sets the compare container of this input to the given container.protected voidsetDirty(boolean dirty) Sets the dirty state of this input to the given value and sends out aPropertyChangeEventif the new value differs from the old value.
-
Field Details
-
DIRTY_STATE
The name of the "dirty" property- See Also:
-
-
Constructor Details
-
ThreeSideTextMergeEditorInput
public ThreeSideTextMergeEditorInput(org.eclipse.compare.CompareConfiguration compareConfiguration, IThreeSideTextMergeInput mergeInput) Constructor.- Parameters:
compareConfiguration- the compare configuration, can not benullmergeInput- the merge viewer input, can not benull
-
-
Method Details
-
getAdapter
- Specified by:
getAdapterin interfaceorg.eclipse.core.runtime.IAdaptable
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.eclipse.ui.IEditorInput
-
getImageDescriptor
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()- Specified by:
getImageDescriptorin interfaceorg.eclipse.ui.IEditorInput
-
getName
- Specified by:
getNamein interfaceorg.eclipse.ui.IEditorInput
-
getPersistable
public org.eclipse.ui.IPersistableElement getPersistable()- Specified by:
getPersistablein interfaceorg.eclipse.ui.IEditorInput
-
getToolTipText
- Specified by:
getToolTipTextin interfaceorg.eclipse.ui.IEditorInput
-
addPropertyChangeListener
public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) - Specified by:
addPropertyChangeListenerin interfaceorg.eclipse.compare.IPropertyChangeNotifier
-
removePropertyChangeListener
public void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) - Specified by:
removePropertyChangeListenerin interfaceorg.eclipse.compare.IPropertyChangeNotifier
-
findContentViewer
public ThreeSideTextMergeViewer findContentViewer(ThreeSideTextMergeViewerRegistry.ViewerDescriptor newViewerDescriptor, org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.services.IServiceLocator serviceLocator) Finds and creates the text merge viewer for the given viewer descriptor under the given parent control.- Parameters:
newViewerDescriptor- the viewer descriptor the merge viewer created for, can not benullparent- the parent control under which the viewer must be created, can not benullserviceLocator- the service locator, can not benull- Returns:
- a newly created text merge viewer, never
null
-
createMergeViewerPanel
public ThreeSideTextMergeViewerPanel createMergeViewerPanel(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.services.IServiceLocator serviceLocator) Creates the merge viewer panel that is used to display the result of the merge operations.- Parameters:
parent- the parent control under which the panel must be createdserviceLocator- the service locator, can not benull- Returns:
- a newly created merge viewer panel, never
null
-
saveChanges
public void saveChanges(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Saves any unsaved changes.- Parameters:
monitor- the progress monitor that the implementation of save may use to show progress, may benull- Throws:
org.eclipse.core.runtime.CoreException- if the save process fails
-
fireInputChange
public 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. -
getMergeInput
Returns the merge viewer input.- Returns:
- the merge viewer input, never
null
-
isDirty
public boolean isDirty()Checks whether there are unsaved changes.- Returns:
trueif there are unsaved changes andfalseotherwise
-
getContainer
public final org.eclipse.compare.ICompareContainer getContainer()Returns the container of this input.- Returns:
- the container of this input or
nullif there is no container set
-
setContainer
public void setContainer(org.eclipse.compare.ICompareContainer compareContainer) Sets the compare container of this input to the given container.- Parameters:
compareContainer- the compare container, cann not benull
-
getCompareConfiguration
public org.eclipse.compare.CompareConfiguration getCompareConfiguration()Returns the compare configuration.- Returns:
- the compare configuration, never
null
-
setDirty
protected void setDirty(boolean dirty) Sets the dirty state of this input to the given value and sends out aPropertyChangeEventif the new value differs from the old value.- Parameters:
dirty- the dirty state for this merge input
-