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
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 Modifier and Type Field Description static String
DIRTY_STATE
The name of the "dirty" property
-
Constructor Summary
Constructors Constructor Description ThreeSideTextMergeEditorInput(org.eclipse.compare.CompareConfiguration compareConfiguration, IThreeSideTextMergeInput mergeInput)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
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.boolean
exists()
ThreeSideTextMergeViewer
findContentViewer(com._1c.g5.v8.dt.internal.compare.ui.mergeviewer.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.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.<T> T
getAdapter(Class<T> adapter)
org.eclipse.compare.CompareConfiguration
getCompareConfiguration()
Returns the compare configuration.org.eclipse.compare.ICompareContainer
getContainer()
Returns the container of this input.org.eclipse.jface.resource.ImageDescriptor
getImageDescriptor()
IThreeSideTextMergeInput
getMergeInput()
Returns the merge viewer input.String
getName()
org.eclipse.ui.IPersistableElement
getPersistable()
String
getToolTipText()
boolean
isDirty()
Checks whether there are unsaved changes.void
removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
void
saveChanges(org.eclipse.core.runtime.IProgressMonitor monitor)
Saves any unsaved changes.void
setContainer(org.eclipse.compare.ICompareContainer compareContainer)
Sets the compare container of this input to the given container.protected void
setDirty(boolean dirty)
Sets the dirty state of this input to the given value and sends out aPropertyChangeEvent
if the new value differs from the old value.
-
-
-
Field Detail
-
DIRTY_STATE
public static final String DIRTY_STATE
The name of the "dirty" property- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThreeSideTextMergeEditorInput
public ThreeSideTextMergeEditorInput(org.eclipse.compare.CompareConfiguration compareConfiguration, IThreeSideTextMergeInput mergeInput)
Constructor.- Parameters:
compareConfiguration
- the compare configuration, can not benull
mergeInput
- the merge viewer input, can not benull
-
-
Method Detail
-
getAdapter
public <T> T getAdapter(Class<T> adapter)
- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.eclipse.ui.IEditorInput
-
getImageDescriptor
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
- Specified by:
getImageDescriptor
in interfaceorg.eclipse.ui.IEditorInput
-
getName
public String getName()
- Specified by:
getName
in interfaceorg.eclipse.ui.IEditorInput
-
getPersistable
public org.eclipse.ui.IPersistableElement getPersistable()
- Specified by:
getPersistable
in interfaceorg.eclipse.ui.IEditorInput
-
getToolTipText
public String getToolTipText()
- Specified by:
getToolTipText
in interfaceorg.eclipse.ui.IEditorInput
-
addPropertyChangeListener
public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfaceorg.eclipse.compare.IPropertyChangeNotifier
-
removePropertyChangeListener
public void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfaceorg.eclipse.compare.IPropertyChangeNotifier
-
findContentViewer
public ThreeSideTextMergeViewer findContentViewer(com._1c.g5.v8.dt.internal.compare.ui.mergeviewer.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 benull
parent
- the parent control under which the viewer must be created, can not benull
serviceLocator
- 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
public IThreeSideTextMergeInput getMergeInput()
Returns the merge viewer input.- Returns:
- the merge viewer input, never
null
-
isDirty
public boolean isDirty()
Checks whether there are unsaved changes.- Returns:
true
if there are unsaved changes andfalse
otherwise
-
getContainer
public final org.eclipse.compare.ICompareContainer getContainer()
Returns the container of this input.- Returns:
- the container of this input or
null
if 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 aPropertyChangeEvent
if the new value differs from the old value.- Parameters:
dirty
- the dirty state for this merge input
-
-