public class StyleSettings extends Object
Use this class to customize the font color, highlight color, style attributes (bold, underline, italic, strikethrough), string separators, original sizes, and word separators for text.
Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
StyleSettings styleSettings = new StyleSettings();
styleSettings.setFontColor(Color.GREEN);
styleSettings.setBold(true);
styleSettings.setUnderline(true);
final CompareOptions compareOptions = new CompareOptions();
compareOptions.setInsertedItemStyle(styleSettings);
comparer.compare(resultFile, compareOptions);
}
Comparer,
StyleSettings,
CompareOptions| Modifier and Type | Class and Description |
|---|---|
static class |
StyleSettings.Builder
A
StyleSettings builder. |
| Constructor and Description |
|---|
StyleSettings()
Initializes a new instance of the StyleSettings class.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getEndStringSeparator()
Gets the end string separator.
|
Color |
getFontColor()
Gets the font color.
|
Color |
getHighlightColor()
Gets the highlight color.
|
Size |
getOriginalSize()
Gets the original size of comparing documents.
|
String |
getStartStringSeparator()
Gets the start string separator.
|
char[] |
getWordsSeparators()
Gets the word separator chars.
|
boolean |
isBold()
Gets a flag that indicates whether the text will be bold or not.
|
boolean |
isItalic()
Gets a flag that indicates whether the text will be italic or not.
|
boolean |
isStrikethrough()
Gets a flag that indicates whether the text will be strike through or not.
|
boolean |
isUnderline()
Gets a flag that indicates whether the text will be underlined or not.
|
void |
setBold(boolean value)
Sets a flag that indicates whether the text should be bold or not.
|
void |
setEndStringSeparator(String value)
Sets the end string separator.
|
void |
setFontColor(Color value)
Sets the font color.
|
void |
setHighlightColor(Color value)
Sets the highlight color.
|
void |
setItalic(boolean value)
Sets a flag that indicates whether the text should be italic or not.
|
void |
setOriginalSize(Size value)
Sets the original size of comparing documents.
|
void |
setStartStringSeparator(String value)
Sets the start string separator.
|
void |
setStrikethrough(boolean value)
Sets a flag that indicates whether the text should be strike through or not.
|
void |
setUnderline(boolean value)
Sets a flag that indicates whether the text should be underlined or not.
|
void |
setWordsSeparators(char[] value)
Sets the word separator chars.
|
public StyleSettings()
Initializes a new instance of the StyleSettings class.
public final String getEndStringSeparator()
Gets the end string separator.
public final Color getFontColor()
Gets the font color.
public final Color getHighlightColor()
Gets the highlight color.
public final Size getOriginalSize()
Gets the original size of comparing documents.
public final String getStartStringSeparator()
Gets the start string separator.
public final char[] getWordsSeparators()
Gets the word separator chars.
public final boolean isBold()
Gets a flag that indicates whether the text will be bold or not.
public final boolean isItalic()
Gets a flag that indicates whether the text will be italic or not.
public final boolean isStrikethrough()
Gets a flag that indicates whether the text will be strike through or not.
public final boolean isUnderline()
Gets a flag that indicates whether the text will be underlined or not.
public final void setBold(boolean value)
Sets a flag that indicates whether the text should be bold or not.
value - true if the text should be bold, false otherwise.public final void setEndStringSeparator(String value)
Sets the end string separator.
value - The new end string separator.public final void setFontColor(Color value)
Sets the font color.
value - The new font color.public final void setHighlightColor(Color value)
Sets the highlight color.
value - The new highlight color.public final void setItalic(boolean value)
Sets a flag that indicates whether the text should be italic or not.
value - true if the text should be italic, false otherwise.public final void setOriginalSize(Size value)
Sets the original size of comparing documents.
value - The new original size of comparing documents.public final void setStartStringSeparator(String value)
Sets the start string separator.
value - The new start string separator.public final void setStrikethrough(boolean value)
Sets a flag that indicates whether the text should be strike through or not.
value - true if the text should be strike through, false otherwise.public final void setUnderline(boolean value)
Sets a flag that indicates whether the text should be underlined or not.
value - true if the text should be underlined, false otherwise.public final void setWordsSeparators(char[] value)
Sets the word separator chars.
value - The new word separators.Copyright © 2024. All rights reserved.