Class UnifiedDiff.Builder

java.lang.Object
org.eclipse.compare.unifieddiff.UnifiedDiff.Builder
Enclosing class:
UnifiedDiff

public static final class UnifiedDiff.Builder extends Object
  • Method Details

    • additionalActions

      public UnifiedDiff.Builder additionalActions(List<Action> actions)
    • ignoreWhitespaceContributorFactory

      public UnifiedDiff.Builder ignoreWhitespaceContributorFactory(UnifiedDiff.IgnoreWhitespaceContributorFactory factory)
    • tokenComparatorFactory

      public UnifiedDiff.Builder tokenComparatorFactory(UnifiedDiff.TokenComparatorFactory factory)
    • ignoreWhiteSpace

      public UnifiedDiff.Builder ignoreWhiteSpace(boolean value)
    • compareFilters

      public UnifiedDiff.Builder compareFilters(ICompareFilter[] filters)
    • compareFilters

      public UnifiedDiff.Builder compareFilters(ICompareFilter[] filters, char editorSide, char sourceSide)
    • toolbarActionText

      public UnifiedDiff.Builder toolbarActionText(UnifiedDiff.ToolbarAction action, String text)
      Overrides the text, including the tooltip text, for an action in a unified diff toolbar.
      Parameters:
      action - the action whose text is overridden
      text - the replacement text
      Returns:
      this builder
    • toolbarActionImage

      public UnifiedDiff.Builder toolbarActionImage(UnifiedDiff.ToolbarAction action, ImageDescriptor image)
      Overrides the image for an action in a unified diff toolbar. Passing null removes the action's default image and displays its text instead.
      Parameters:
      action - the action whose image is overridden
      image - the replacement image, or null to show text
      Returns:
      this builder
    • eventListener

      public UnifiedDiff.Builder eventListener(UnifiedDiffEventListener listener)
      Sets the listener notified when a diff hunk is resolved or an all-diffs toolbar action completes. The listener is invoked on the UI thread once per resolved hunk, or once for an all-diffs action.
      Parameters:
      listener - the listener, or null to receive no events
      Returns:
      this builder
    • foldUnchanged

      public UnifiedDiff.Builder foldUnchanged(int contextLines)
      Collapses unchanged regions between diffs, keeping the given number of context lines (at least one) around each change. A negative value disables folding.

      The folding of the editor is reused, so this has no effect in an editor without folding support, such as the default text editor, or in an editor whose folding the user turned off.

    • open

      public IStatus open()