class DomStylesBuilder extends java.lang.Object implements StylesBuilder
Constructor and Description |
---|
DomStylesBuilder(DomBuilderImpl delegate)
Construct a new
DomStylesBuilder . |
Modifier and Type | Method and Description |
---|---|
StylesBuilder |
backgroundImage(SafeUri uri)
Sets the background-image CSS property.
|
StylesBuilder |
borderStyle(Style.BorderStyle value)
Sets the border-style CSS property.
|
StylesBuilder |
borderWidth(double value,
Style.Unit unit)
Set the border-width css property.
|
StylesBuilder |
bottom(double value,
Style.Unit unit)
Set the bottom css property.
|
StylesBuilder |
cursor(Style.Cursor value)
Sets the cursor CSS property.
|
StylesBuilder |
display(Style.Display value)
Sets the display CSS property.
|
void |
endStyle()
End the current style attribute.
|
StylesBuilder |
floatprop(Style.Float value)
Set the float css property.
|
StylesBuilder |
fontSize(double value,
Style.Unit unit)
Set the font-size css property.
|
StylesBuilder |
fontStyle(Style.FontStyle value)
Sets the font-style CSS property.
|
StylesBuilder |
fontWeight(Style.FontWeight value)
Sets the font-weight CSS property.
|
StylesBuilder |
height(double value,
Style.Unit unit)
Set the height css property.
|
StylesBuilder |
left(double value,
Style.Unit unit)
Set the left css property.
|
StylesBuilder |
lineHeight(double value,
Style.Unit unit)
Set the line-height css property.
|
StylesBuilder |
listStyleType(Style.ListStyleType value)
Sets the list-style-type CSS property.
|
StylesBuilder |
margin(double value,
Style.Unit unit)
Set the margin css property.
|
StylesBuilder |
marginBottom(double value,
Style.Unit unit)
Set the margin-bottom css property.
|
StylesBuilder |
marginLeft(double value,
Style.Unit unit)
Set the margin-left css property.
|
StylesBuilder |
marginRight(double value,
Style.Unit unit)
Set the margin-right css property.
|
StylesBuilder |
marginTop(double value,
Style.Unit unit)
Set the margin-top css property.
|
StylesBuilder |
opacity(double value)
Set the opacity css property.
|
StylesBuilder |
outlineStyle(Style.OutlineStyle value)
Sets the outline-style CSS property.
|
StylesBuilder |
outlineWidth(double value,
Style.Unit unit)
Set the outline-width css property.
|
StylesBuilder |
overflow(Style.Overflow value)
Sets the overflow CSS property.
|
StylesBuilder |
overflowX(Style.Overflow value)
Sets the overflow-x CSS property.
|
StylesBuilder |
overflowY(Style.Overflow value)
Sets the overflow-y CSS property.
|
StylesBuilder |
padding(double value,
Style.Unit unit)
Set the padding css property.
|
StylesBuilder |
paddingBottom(double value,
Style.Unit unit)
Set the padding-bottom css property.
|
StylesBuilder |
paddingLeft(double value,
Style.Unit unit)
Set the padding-left css property.
|
StylesBuilder |
paddingRight(double value,
Style.Unit unit)
Set the padding-right css property.
|
StylesBuilder |
paddingTop(double value,
Style.Unit unit)
Set the padding-top css property.
|
StylesBuilder |
position(Style.Position value)
Sets the position CSS property.
|
StylesBuilder |
right(double value,
Style.Unit unit)
Set the right css property.
|
StylesBuilder |
tableLayout(Style.TableLayout value)
Set the table-layout CSS property.
|
StylesBuilder |
textAlign(Style.TextAlign value)
Set the text-align CSS property.
|
StylesBuilder |
textDecoration(Style.TextDecoration value)
Set the text-decoration CSS property.
|
StylesBuilder |
textIndent(double value,
Style.Unit unit)
Set the text-indent CSS property.
|
StylesBuilder |
textJustify(Style.TextJustify value)
Set the text-justify CSS3 property.
|
StylesBuilder |
textOverflow(Style.TextOverflow value)
Set the text-overflow CSS3 property.
|
StylesBuilder |
textTransform(Style.TextTransform value)
Set the text-transform CSS property.
|
(package private) static java.lang.String |
toCamelCaseForm(java.lang.String name)
Convert a hyphenated or camelCase string to a camelCase string.
|
StylesBuilder |
top(double value,
Style.Unit unit)
Set the top css property.
|
StylesBuilder |
trustedBackgroundColor(java.lang.String value)
Sets the "background-color" style property to the specified color string.
|
StylesBuilder |
trustedBackgroundImage(java.lang.String value)
Sets the "background-image" style property to the specified value.
|
StylesBuilder |
trustedBorderColor(java.lang.String value)
Sets the "border-color" style property to the specified color string.
|
StylesBuilder |
trustedColor(java.lang.String value)
Sets the "color" style property, which controls font color, to the
specified color string.
|
StylesBuilder |
trustedOutlineColor(java.lang.String value)
Sets the "outline-color" style property to the specified color string.
|
StylesBuilder |
trustedProperty(java.lang.String name,
double value,
Style.Unit unit)
Set a style property from a trusted name and a trusted value, i.e., without
escaping the name and value.
|
StylesBuilder |
trustedProperty(java.lang.String name,
java.lang.String value)
Set a style property from a trusted name and a trusted value, i.e., without
escaping the name and value.
|
StylesBuilder |
verticalAlign(double value,
Style.Unit unit)
Sets the vertical-align CSS property.
|
StylesBuilder |
verticalAlign(Style.VerticalAlign value)
Sets the vertical-align CSS property.
|
StylesBuilder |
visibility(Style.Visibility value)
Sets the visibility CSS property.
|
StylesBuilder |
width(double value,
Style.Unit unit)
Set the width css property.
|
StylesBuilder |
zIndex(int value)
Set the z-index css property.
|
DomStylesBuilder(DomBuilderImpl delegate)
DomStylesBuilder
.delegate
- the delegate that builds the stylestatic java.lang.String toCamelCaseForm(java.lang.String name)
name
- the hyphenated or camelCase string to convertpublic StylesBuilder backgroundImage(SafeUri uri)
StylesBuilder
backgroundImage
in interface StylesBuilder
uri
- the URI of the background imageStylesBuilder
StylesBuilder.trustedBackgroundImage(String)
public StylesBuilder borderStyle(Style.BorderStyle value)
StylesBuilder
borderStyle
in interface StylesBuilder
public StylesBuilder borderWidth(double value, Style.Unit unit)
StylesBuilder
borderWidth
in interface StylesBuilder
public StylesBuilder bottom(double value, Style.Unit unit)
StylesBuilder
bottom
in interface StylesBuilder
public StylesBuilder cursor(Style.Cursor value)
StylesBuilder
cursor
in interface StylesBuilder
public StylesBuilder display(Style.Display value)
StylesBuilder
display
in interface StylesBuilder
public void endStyle()
StylesBuilder
endStyle
in interface StylesBuilder
public StylesBuilder floatprop(Style.Float value)
StylesBuilder
floatprop
in interface StylesBuilder
public StylesBuilder fontSize(double value, Style.Unit unit)
StylesBuilder
fontSize
in interface StylesBuilder
public StylesBuilder fontStyle(Style.FontStyle value)
StylesBuilder
fontStyle
in interface StylesBuilder
public StylesBuilder fontWeight(Style.FontWeight value)
StylesBuilder
fontWeight
in interface StylesBuilder
public StylesBuilder height(double value, Style.Unit unit)
StylesBuilder
height
in interface StylesBuilder
public StylesBuilder left(double value, Style.Unit unit)
StylesBuilder
left
in interface StylesBuilder
public StylesBuilder lineHeight(double value, Style.Unit unit)
StylesBuilder
lineHeight
in interface StylesBuilder
public StylesBuilder listStyleType(Style.ListStyleType value)
StylesBuilder
listStyleType
in interface StylesBuilder
public StylesBuilder margin(double value, Style.Unit unit)
StylesBuilder
margin
in interface StylesBuilder
public StylesBuilder marginBottom(double value, Style.Unit unit)
StylesBuilder
marginBottom
in interface StylesBuilder
public StylesBuilder marginLeft(double value, Style.Unit unit)
StylesBuilder
marginLeft
in interface StylesBuilder
public StylesBuilder marginRight(double value, Style.Unit unit)
StylesBuilder
marginRight
in interface StylesBuilder
public StylesBuilder marginTop(double value, Style.Unit unit)
StylesBuilder
marginTop
in interface StylesBuilder
public StylesBuilder opacity(double value)
StylesBuilder
opacity
in interface StylesBuilder
public StylesBuilder outlineStyle(Style.OutlineStyle value)
StylesBuilder
outlineStyle
in interface StylesBuilder
public StylesBuilder outlineWidth(double value, Style.Unit unit)
StylesBuilder
outlineWidth
in interface StylesBuilder
public StylesBuilder overflow(Style.Overflow value)
StylesBuilder
overflow
in interface StylesBuilder
public StylesBuilder overflowX(Style.Overflow value)
StylesBuilder
overflowX
in interface StylesBuilder
public StylesBuilder overflowY(Style.Overflow value)
StylesBuilder
overflowY
in interface StylesBuilder
public StylesBuilder padding(double value, Style.Unit unit)
StylesBuilder
padding
in interface StylesBuilder
public StylesBuilder paddingBottom(double value, Style.Unit unit)
StylesBuilder
paddingBottom
in interface StylesBuilder
public StylesBuilder paddingLeft(double value, Style.Unit unit)
StylesBuilder
paddingLeft
in interface StylesBuilder
public StylesBuilder paddingRight(double value, Style.Unit unit)
StylesBuilder
paddingRight
in interface StylesBuilder
public StylesBuilder paddingTop(double value, Style.Unit unit)
StylesBuilder
paddingTop
in interface StylesBuilder
public StylesBuilder position(Style.Position value)
StylesBuilder
position
in interface StylesBuilder
public StylesBuilder right(double value, Style.Unit unit)
StylesBuilder
right
in interface StylesBuilder
public StylesBuilder tableLayout(Style.TableLayout value)
StylesBuilder
tableLayout
in interface StylesBuilder
public StylesBuilder textAlign(Style.TextAlign value)
StylesBuilder
textAlign
in interface StylesBuilder
public StylesBuilder textDecoration(Style.TextDecoration value)
StylesBuilder
textDecoration
in interface StylesBuilder
public StylesBuilder textIndent(double value, Style.Unit unit)
StylesBuilder
textIndent
in interface StylesBuilder
public StylesBuilder textJustify(Style.TextJustify value)
StylesBuilder
textJustify
in interface StylesBuilder
public StylesBuilder textOverflow(Style.TextOverflow value)
StylesBuilder
textOverflow
in interface StylesBuilder
public StylesBuilder textTransform(Style.TextTransform value)
StylesBuilder
textTransform
in interface StylesBuilder
public StylesBuilder top(double value, Style.Unit unit)
StylesBuilder
top
in interface StylesBuilder
public StylesBuilder trustedBackgroundColor(java.lang.String value)
StylesBuilder
Sets the "background-color" style property to the specified color string. Does not check or escape the color string. The calling code should be carefully reviewed to ensure that the provided color string won't cause a security issue if included in a style attribute.
For details and constraints, see
SafeStyles
.
trustedBackgroundColor
in interface StylesBuilder
StylesBuilder
public StylesBuilder trustedBackgroundImage(java.lang.String value)
StylesBuilder
Sets the "background-image" style property to the specified value. Does not check or escape the value. The calling code should be carefully reviewed to ensure that the provided value string won't cause a security issue if included in a style attribute.
For details and constraints, see
SafeStyles
.
trustedBackgroundImage
in interface StylesBuilder
StylesBuilder
public StylesBuilder trustedBorderColor(java.lang.String value)
StylesBuilder
Sets the "border-color" style property to the specified color string. Does not check or escape the color string. The calling code should be carefully reviewed to ensure that the provided color string won't cause a security issue if included in a style attribute.
For details and constraints, see
SafeStyles
.
trustedBorderColor
in interface StylesBuilder
StylesBuilder
public StylesBuilder trustedColor(java.lang.String value)
StylesBuilder
Sets the "color" style property, which controls font color, to the specified color string. Does not check or escape the color string. The calling code should be carefully reviewed to ensure that the provided color string won't cause a security issue if included in a style attribute.
For details and constraints, see
SafeStyles
.
trustedColor
in interface StylesBuilder
StylesBuilder
public StylesBuilder trustedOutlineColor(java.lang.String value)
StylesBuilder
Sets the "outline-color" style property to the specified color string. Does not check or escape the color string. The calling code should be carefully reviewed to ensure that the provided color string won't cause a security issue if included in a style attribute.
For details and constraints, see
SafeStyles
.
trustedOutlineColor
in interface StylesBuilder
StylesBuilder
public StylesBuilder trustedProperty(java.lang.String name, double value, Style.Unit unit)
StylesBuilder
Set a style property from a trusted name and a trusted value, i.e., without
escaping the name and value. No checks are performed. The calling code
should be carefully reviewed to ensure the argument will satisfy the
SafeStyles
contract when they are
composed into the form: "<name>:<value>;".
SafeStyles may never contain literal angle brackets. Otherwise, it could be
unsafe to place a SafeStyles into a <style> tag (where it can't be
HTML escaped). For example, if the SafeStyles containing "
font: 'foo <style><script>evil</script>
'" is
used in a style sheet in a <style> tag, this could then break out of
the style context into HTML.
trustedProperty
in interface StylesBuilder
unit
- the units of the valueStylesBuilder
public StylesBuilder trustedProperty(java.lang.String name, java.lang.String value)
StylesBuilder
Set a style property from a trusted name and a trusted value, i.e., without
escaping the name and value. No checks are performed. The calling code
should be carefully reviewed to ensure the argument will satisfy the
SafeStyles
contract when they are
composed into the form: "<name>:<value>;".
SafeStyles may never contain literal angle brackets. Otherwise, it could be
unsafe to place a SafeStyles into a <style> tag (where it can't be
HTML escaped). For example, if the SafeStyles containing "
font: 'foo <style><script>evil</script>
'" is
used in a style sheet in a <style> tag, this could then break out of
the style context into HTML.
trustedProperty
in interface StylesBuilder
StylesBuilder
public StylesBuilder verticalAlign(double value, Style.Unit unit)
StylesBuilder
verticalAlign
in interface StylesBuilder
public StylesBuilder verticalAlign(Style.VerticalAlign value)
StylesBuilder
verticalAlign
in interface StylesBuilder
public StylesBuilder visibility(Style.Visibility value)
StylesBuilder
visibility
in interface StylesBuilder
public StylesBuilder width(double value, Style.Unit unit)
StylesBuilder
width
in interface StylesBuilder
public StylesBuilder zIndex(int value)
StylesBuilder
zIndex
in interface StylesBuilder