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
ConstructorsConstructorDescriptionWhitespaceConfig(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 aWhitespaceConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintalpha()Returns the value of thealpharecord component.applySegment(String fullLine, String rawFullLine, int from, int to) Replaces whitespace characters in the segment[from, to)offullLinewith visible glyphs.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theshowCarriageReturnrecord component.booleanReturns the value of theshowEnclosedIdeographicSpacesrecord component.booleanReturns the value of theshowEnclosedSpacesrecord component.booleanReturns the value of theshowEnclosedTabsrecord component.booleanReturns the value of theshowLeadingIdeographicSpacesrecord component.booleanReturns the value of theshowLeadingSpacesrecord component.booleanReturns the value of theshowLeadingTabsrecord component.booleanReturns the value of theshowLineFeedrecord component.booleanReturns the value of theshowTrailingIdeographicSpacesrecord component.booleanReturns the value of theshowTrailingSpacesrecord component.booleanReturns the value of theshowTrailingTabsrecord component.inttabWidth()Returns the value of thetabWidthrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aWhitespaceConfigrecord class.- Parameters:
showLeadingSpaces- the value for theshowLeadingSpacesrecord componentshowEnclosedSpaces- the value for theshowEnclosedSpacesrecord componentshowTrailingSpaces- the value for theshowTrailingSpacesrecord componentshowLeadingIdeographicSpaces- the value for theshowLeadingIdeographicSpacesrecord componentshowEnclosedIdeographicSpaces- the value for theshowEnclosedIdeographicSpacesrecord componentshowTrailingIdeographicSpaces- the value for theshowTrailingIdeographicSpacesrecord componentshowLeadingTabs- the value for theshowLeadingTabsrecord componentshowEnclosedTabs- the value for theshowEnclosedTabsrecord componentshowTrailingTabs- the value for theshowTrailingTabsrecord componentshowCarriageReturn- the value for theshowCarriageReturnrecord componentshowLineFeed- the value for theshowLineFeedrecord componentalpha- the value for thealpharecord componenttabWidth- the value for thetabWidthrecord component
-
-
Method Details
-
applySegment
Replaces whitespace characters in the segment[from, to)offullLinewith visible glyphs.fullLineis the complete, tab-expanded label line (no newline characters) and is used to determine whether a whitespace character is leading, enclosed, or trailing.rawFullLineis 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 remainingtabWidth - 1columns left blank, matchingWhitespaceCharacterPainter. Returns the segment characters with substitutions applied; its length is alwaysto - from. -
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
showLeadingSpaces
public boolean showLeadingSpaces()Returns the value of theshowLeadingSpacesrecord component.- Returns:
- the value of the
showLeadingSpacesrecord component
-
showEnclosedSpaces
public boolean showEnclosedSpaces()Returns the value of theshowEnclosedSpacesrecord component.- Returns:
- the value of the
showEnclosedSpacesrecord component
-
showTrailingSpaces
public boolean showTrailingSpaces()Returns the value of theshowTrailingSpacesrecord component.- Returns:
- the value of the
showTrailingSpacesrecord component
-
showLeadingIdeographicSpaces
public boolean showLeadingIdeographicSpaces()Returns the value of theshowLeadingIdeographicSpacesrecord component.- Returns:
- the value of the
showLeadingIdeographicSpacesrecord component
-
showEnclosedIdeographicSpaces
public boolean showEnclosedIdeographicSpaces()Returns the value of theshowEnclosedIdeographicSpacesrecord component.- Returns:
- the value of the
showEnclosedIdeographicSpacesrecord component
-
showTrailingIdeographicSpaces
public boolean showTrailingIdeographicSpaces()Returns the value of theshowTrailingIdeographicSpacesrecord component.- Returns:
- the value of the
showTrailingIdeographicSpacesrecord component
-
showLeadingTabs
public boolean showLeadingTabs()Returns the value of theshowLeadingTabsrecord component.- Returns:
- the value of the
showLeadingTabsrecord component
-
showEnclosedTabs
public boolean showEnclosedTabs()Returns the value of theshowEnclosedTabsrecord component.- Returns:
- the value of the
showEnclosedTabsrecord component
-
showTrailingTabs
public boolean showTrailingTabs()Returns the value of theshowTrailingTabsrecord component.- Returns:
- the value of the
showTrailingTabsrecord component
-
showCarriageReturn
public boolean showCarriageReturn()Returns the value of theshowCarriageReturnrecord component.- Returns:
- the value of the
showCarriageReturnrecord component
-
showLineFeed
public boolean showLineFeed()Returns the value of theshowLineFeedrecord component.- Returns:
- the value of the
showLineFeedrecord component
-
alpha
public int alpha()Returns the value of thealpharecord component.- Returns:
- the value of the
alpharecord component
-
tabWidth
public int tabWidth()Returns the value of thetabWidthrecord component.- Returns:
- the value of the
tabWidthrecord component
-