public class StyleSet
extends java.lang.Object
Constructor and Description |
---|
StyleSet()
Create a new style set with no properties set.
|
StyleSet(Style... styles)
Create a new style set with the given styles.
|
Modifier and Type | Method and Description |
---|---|
StyleSet |
clone() |
StyleSet |
extend(StyleSet style)
Create a new instance with styles inherited from this one but with new styles
from the given style set.
|
java.lang.Boolean |
getBold()
Get whether this style set is bold.
|
Style |
getColor()
Get the color of the text.
|
java.lang.Boolean |
getItalic()
Get whether this style set is italicized.
|
java.lang.Boolean |
getStrikethrough()
Get whether this style set is stricken through.
|
java.lang.Boolean |
getUnderline()
Get whether this style set is underlined.
|
boolean |
hasEqualFormatting(StyleSet other)
Return where the text formatting of the given style set is different from
that assigned to this one.
|
boolean |
hasFormatting()
Return whether text formatting (bold, italics, underline, strikethrough) is set.
|
boolean |
isBold()
Get whether the text is bold.
|
boolean |
isItalic()
Get whether the text is italicized.
|
boolean |
isStrikethrough()
Get whether the text is stricken through.
|
boolean |
isUnderline()
Get whether the text is underlined.
|
void |
setBold(java.lang.Boolean bold)
Set whether the text is bold.
|
void |
setColor(Style color)
Set the color of the text.
|
void |
setItalic(java.lang.Boolean italic)
Set whether the text is italicized.
|
void |
setStrikethrough(java.lang.Boolean strikethrough)
Set whether the text is stricken through.
|
void |
setUnderline(java.lang.Boolean underline)
Set whether the text is underline.
|
public StyleSet()
public StyleSet(Style... styles)
Style.RESET
will be ignored if provided.
styles
- a list of stylespublic java.lang.Boolean getBold()
public boolean isBold()
public void setBold(java.lang.Boolean bold)
bold
- true, false, or null to unsetpublic java.lang.Boolean getItalic()
public boolean isItalic()
public void setItalic(java.lang.Boolean italic)
italic
- false, or null to unsetpublic java.lang.Boolean getUnderline()
public boolean isUnderline()
public void setUnderline(java.lang.Boolean underline)
underline
- false, or null to unsetpublic java.lang.Boolean getStrikethrough()
public boolean isStrikethrough()
public void setStrikethrough(java.lang.Boolean strikethrough)
strikethrough
- false, or null to unsetpublic Style getColor()
public void setColor(Style color)
color
- the colorpublic boolean hasFormatting()
public boolean hasEqualFormatting(StyleSet other)
other
- the other style setpublic StyleSet extend(StyleSet style)
style
- the style setpublic StyleSet clone()
clone
in class java.lang.Object