Record Class UnifiedDiffCodeMiningProvider.WhitespaceConfig

java.lang.Object
java.lang.Record
org.eclipse.compare.unifieddiff.internal.UnifiedDiffCodeMiningProvider.WhitespaceConfig
Enclosing class:
UnifiedDiffCodeMiningProvider

public static record UnifiedDiffCodeMiningProvider.WhitespaceConfig(boolean showLeadingSpaces, boolean showEnclosedSpaces, boolean showTrailingSpaces, boolean showLeadingIdeographicSpaces, boolean showEnclosedIdeographicSpaces, boolean showTrailingIdeographicSpaces, boolean showLeadingTabs, boolean showEnclosedTabs, boolean showTrailingTabs, boolean showCarriageReturn, boolean showLineFeed, int alpha, int tabWidth) extends Record
Captures which whitespace characters are shown as visible glyphs, mirroring the settings read by WhitespaceCharacterPainter.

This duplicates the painter's glyph logic on purpose: the painter needs an ITextViewer with its own StyledText, but a code mining only receives the editor's shared GC and draws into it directly, so the painter cannot be reused here. The click-through overlay, which does own a widget, uses the real painter instead. Keep the two in sync when the editor's whitespace rendering changes.

  • Constructor Summary

    Constructors
    Constructor
    Description
    WhitespaceConfig(boolean showLeadingSpaces, boolean showEnclosedSpaces, boolean showTrailingSpaces, boolean showLeadingIdeographicSpaces, boolean showEnclosedIdeographicSpaces, boolean showTrailingIdeographicSpaces, boolean showLeadingTabs, boolean showEnclosedTabs, boolean showTrailingTabs, boolean showCarriageReturn, boolean showLineFeed, int alpha, int tabWidth)
    Creates an instance of a WhitespaceConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the alpha record component.
    applySegment(String fullLine, String rawFullLine, int from, int to)
    Replaces whitespace characters in the segment [from, to) of fullLine with visible glyphs.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the showCarriageReturn record component.
    boolean
    Returns the value of the showEnclosedIdeographicSpaces record component.
    boolean
    Returns the value of the showEnclosedSpaces record component.
    boolean
    Returns the value of the showEnclosedTabs record component.
    boolean
    Returns the value of the showLeadingIdeographicSpaces record component.
    boolean
    Returns the value of the showLeadingSpaces record component.
    boolean
    Returns the value of the showLeadingTabs record component.
    boolean
    Returns the value of the showLineFeed record component.
    boolean
    Returns the value of the showTrailingIdeographicSpaces record component.
    boolean
    Returns the value of the showTrailingSpaces record component.
    boolean
    Returns the value of the showTrailingTabs record component.
    int
    Returns the value of the tabWidth record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WhitespaceConfig

      public WhitespaceConfig(boolean showLeadingSpaces, boolean showEnclosedSpaces, boolean showTrailingSpaces, boolean showLeadingIdeographicSpaces, boolean showEnclosedIdeographicSpaces, boolean showTrailingIdeographicSpaces, boolean showLeadingTabs, boolean showEnclosedTabs, boolean showTrailingTabs, boolean showCarriageReturn, boolean showLineFeed, int alpha, int tabWidth)
      Creates an instance of a WhitespaceConfig record class.
      Parameters:
      showLeadingSpaces - the value for the showLeadingSpaces record component
      showEnclosedSpaces - the value for the showEnclosedSpaces record component
      showTrailingSpaces - the value for the showTrailingSpaces record component
      showLeadingIdeographicSpaces - the value for the showLeadingIdeographicSpaces record component
      showEnclosedIdeographicSpaces - the value for the showEnclosedIdeographicSpaces record component
      showTrailingIdeographicSpaces - the value for the showTrailingIdeographicSpaces record component
      showLeadingTabs - the value for the showLeadingTabs record component
      showEnclosedTabs - the value for the showEnclosedTabs record component
      showTrailingTabs - the value for the showTrailingTabs record component
      showCarriageReturn - the value for the showCarriageReturn record component
      showLineFeed - the value for the showLineFeed record component
      alpha - the value for the alpha record component
      tabWidth - the value for the tabWidth record component
  • Method Details

    • applySegment

      public String applySegment(String fullLine, String rawFullLine, int from, int to)
      Replaces whitespace characters in the segment [from, to) of fullLine with visible glyphs. fullLine is the complete, tab-expanded label line (no newline characters) and is used to determine whether a whitespace character is leading, enclosed, or trailing. rawFullLine is the same line before tabs were expanded; it tells which expanded columns originate from a tab. A tab is drawn as a single tab sign on the first column of its expanded run with the remaining tabWidth - 1 columns left blank, matching WhitespaceCharacterPainter. Returns the segment characters with substitutions applied; its length is always to - from.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • showLeadingSpaces

      public boolean showLeadingSpaces()
      Returns the value of the showLeadingSpaces record component.
      Returns:
      the value of the showLeadingSpaces record component
    • showEnclosedSpaces

      public boolean showEnclosedSpaces()
      Returns the value of the showEnclosedSpaces record component.
      Returns:
      the value of the showEnclosedSpaces record component
    • showTrailingSpaces

      public boolean showTrailingSpaces()
      Returns the value of the showTrailingSpaces record component.
      Returns:
      the value of the showTrailingSpaces record component
    • showLeadingIdeographicSpaces

      public boolean showLeadingIdeographicSpaces()
      Returns the value of the showLeadingIdeographicSpaces record component.
      Returns:
      the value of the showLeadingIdeographicSpaces record component
    • showEnclosedIdeographicSpaces

      public boolean showEnclosedIdeographicSpaces()
      Returns the value of the showEnclosedIdeographicSpaces record component.
      Returns:
      the value of the showEnclosedIdeographicSpaces record component
    • showTrailingIdeographicSpaces

      public boolean showTrailingIdeographicSpaces()
      Returns the value of the showTrailingIdeographicSpaces record component.
      Returns:
      the value of the showTrailingIdeographicSpaces record component
    • showLeadingTabs

      public boolean showLeadingTabs()
      Returns the value of the showLeadingTabs record component.
      Returns:
      the value of the showLeadingTabs record component
    • showEnclosedTabs

      public boolean showEnclosedTabs()
      Returns the value of the showEnclosedTabs record component.
      Returns:
      the value of the showEnclosedTabs record component
    • showTrailingTabs

      public boolean showTrailingTabs()
      Returns the value of the showTrailingTabs record component.
      Returns:
      the value of the showTrailingTabs record component
    • showCarriageReturn

      public boolean showCarriageReturn()
      Returns the value of the showCarriageReturn record component.
      Returns:
      the value of the showCarriageReturn record component
    • showLineFeed

      public boolean showLineFeed()
      Returns the value of the showLineFeed record component.
      Returns:
      the value of the showLineFeed record component
    • alpha

      public int alpha()
      Returns the value of the alpha record component.
      Returns:
      the value of the alpha record component
    • tabWidth

      public int tabWidth()
      Returns the value of the tabWidth record component.
      Returns:
      the value of the tabWidth record component