Class MergeSourceViewer

java.lang.Object
org.eclipse.compare.internal.MergeSourceViewer
All Implemented Interfaces:
IOperationHistoryListener, IAdaptable, IMenuListener, ITextListener, ISelectionChangedListener

Wraps a JFace SourceViewer and add some convenience methods.
  • Field Details

  • Constructor Details

  • Method Details

    • rememberDocument

      public void rememberDocument(IDocument doc)
    • getRememberedDocument

      public IDocument getRememberedDocument()
    • hideSaveAction

      public void hideSaveAction()
    • setFont

      public void setFont(Font font)
    • setBackgroundColor

      public void setBackgroundColor(Color color)
    • setForegroundColor

      public void setForegroundColor(Color color)
    • setEnabled

      public void setEnabled(boolean enabled)
    • getEnabled

      public boolean getEnabled()
    • setRegion

      public void setRegion(Position region)
    • getRegion

      public Position getRegion()
    • isControlOkToUse

      public boolean isControlOkToUse()
    • setSelection

      public void setSelection(Position position)
    • setLineBackground

      public void setLineBackground(Position position, Color c)
    • resetLineBackground

      public void resetLineBackground()
    • getLineCount

      public int getLineCount()
    • getViewportLines

      public int getViewportLines()
    • getViewportHeight

      public int getViewportHeight()
    • getDocumentRegionOffset

      public int getDocumentRegionOffset()
    • getVerticalScrollOffset

      public int getVerticalScrollOffset()
    • getLineRange

      public Point getLineRange(Position p, Point region)
    • vscroll

      public void vscroll(int line)
    • addAction

      public void addAction(String actionId, MergeViewerAction action)
    • getAction

      public IAction getAction(String actionId)
    • createAction

      protected IAction createAction(String actionId)
    • selectionChanged

      public void selectionChanged(SelectionChangedEvent event)
      Description copied from interface: ISelectionChangedListener
      Notifies that the selection has changed.
      Specified by:
      selectionChanged in interface ISelectionChangedListener
      Parameters:
      event - event object describing the change
    • textChanged

      public void textChanged(TextEvent event)
      Description copied from interface: ITextListener
      The visual representation of a text viewer this listener is registered with has been changed.
      Specified by:
      textChanged in interface ITextListener
      Parameters:
      event - the description of the change
    • dispose

      public void dispose()
      The viewer is no longer part of the UI, it's a wrapper only. The disposal doesn't take place while releasing the editor pane's children. The method have to be called it manually. The wrapped viewer is disposed as a regular viewer, while disposing the UI.
    • updateActions

      public void updateActions()
      update all actions independent of their type
    • configure

      public void configure(SourceViewerConfiguration configuration)
    • setBounds

      public void setBounds(int x, int y, int width, int height)
      specific implementation to support a vertical ruler
    • handlePropertyChangeEvent

      protected void handlePropertyChangeEvent(PropertyChangeEvent event)
      handle show/hide line numbers from editor preferences
    • addTextAction

      public void addTextAction(IAction textEditorPropertyAction)
    • removeTextAction

      public boolean removeTextAction(IAction textEditorPropertyAction)
    • addAction

      public void addAction(String id, IAction action)
    • historyNotification

      public void historyNotification(OperationHistoryEvent event)
      Description copied from interface: IOperationHistoryListener
      Something of note has happened in the IOperationHistory. Listeners should check the supplied event for details.
      Specified by:
      historyNotification in interface IOperationHistoryListener
      Parameters:
      event - the OperationHistoryEvent that describes the particular notification.
    • getSourceViewer

      public SourceViewer getSourceViewer()
      Returns:
      the wrapped viewer
    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Description copied from interface: IAdaptable
      Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

      Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean) rather than invoking it directly.

      Specified by:
      getAdapter in interface IAdaptable
      Type Parameters:
      T - the class type
      Parameters:
      adapter - the adapter class to look up
      Returns:
      a object of the given class, or null if this object does not have an adapter for the given class