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 Details

  • Constructor Details

    • ThreeSideTextMergeEditorInput

      public ThreeSideTextMergeEditorInput(org.eclipse.compare.CompareConfiguration compareConfiguration, IThreeSideTextMergeInput mergeInput)
      Constructor.
      Parameters:
      compareConfiguration - the compare configuration, can not be null
      mergeInput - the merge viewer input, can not be null
  • Method Details

    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Specified by:
      getAdapter in interface org.eclipse.core.runtime.IAdaptable
    • exists

      public boolean exists()
      Specified by:
      exists in interface org.eclipse.ui.IEditorInput
    • getImageDescriptor

      public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
      Specified by:
      getImageDescriptor in interface org.eclipse.ui.IEditorInput
    • getName

      public String getName()
      Specified by:
      getName in interface org.eclipse.ui.IEditorInput
    • getPersistable

      public org.eclipse.ui.IPersistableElement getPersistable()
      Specified by:
      getPersistable in interface org.eclipse.ui.IEditorInput
    • getToolTipText

      public String getToolTipText()
      Specified by:
      getToolTipText in interface org.eclipse.ui.IEditorInput
    • addPropertyChangeListener

      public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
      Specified by:
      addPropertyChangeListener in interface org.eclipse.compare.IPropertyChangeNotifier
    • removePropertyChangeListener

      public void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
      Specified by:
      removePropertyChangeListener in interface org.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 be null
      parent - the parent control under which the viewer must be created, can not be null
      serviceLocator - the service locator, can not be null
      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 created
      serviceLocator - the service locator, can not be null
      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 be null
      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 and false 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 be null
    • 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 a PropertyChangeEvent if the new value differs from the old value.
      Parameters:
      dirty - the dirty state for this merge input