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)
StylesBuilderbackgroundImage in interface StylesBuilderuri - the URI of the background imageStylesBuilderStylesBuilder.trustedBackgroundImage(String)public StylesBuilder borderStyle(Style.BorderStyle value)
StylesBuilderborderStyle in interface StylesBuilderpublic StylesBuilder borderWidth(double value, Style.Unit unit)
StylesBuilderborderWidth in interface StylesBuilderpublic StylesBuilder bottom(double value, Style.Unit unit)
StylesBuilderbottom in interface StylesBuilderpublic StylesBuilder cursor(Style.Cursor value)
StylesBuildercursor in interface StylesBuilderpublic StylesBuilder display(Style.Display value)
StylesBuilderdisplay in interface StylesBuilderpublic void endStyle()
StylesBuilderendStyle in interface StylesBuilderpublic StylesBuilder floatprop(Style.Float value)
StylesBuilderfloatprop in interface StylesBuilderpublic StylesBuilder fontSize(double value, Style.Unit unit)
StylesBuilderfontSize in interface StylesBuilderpublic StylesBuilder fontStyle(Style.FontStyle value)
StylesBuilderfontStyle in interface StylesBuilderpublic StylesBuilder fontWeight(Style.FontWeight value)
StylesBuilderfontWeight in interface StylesBuilderpublic StylesBuilder height(double value, Style.Unit unit)
StylesBuilderheight in interface StylesBuilderpublic StylesBuilder left(double value, Style.Unit unit)
StylesBuilderleft in interface StylesBuilderpublic StylesBuilder lineHeight(double value, Style.Unit unit)
StylesBuilderlineHeight in interface StylesBuilderpublic StylesBuilder listStyleType(Style.ListStyleType value)
StylesBuilderlistStyleType in interface StylesBuilderpublic StylesBuilder margin(double value, Style.Unit unit)
StylesBuildermargin in interface StylesBuilderpublic StylesBuilder marginBottom(double value, Style.Unit unit)
StylesBuildermarginBottom in interface StylesBuilderpublic StylesBuilder marginLeft(double value, Style.Unit unit)
StylesBuildermarginLeft in interface StylesBuilderpublic StylesBuilder marginRight(double value, Style.Unit unit)
StylesBuildermarginRight in interface StylesBuilderpublic StylesBuilder marginTop(double value, Style.Unit unit)
StylesBuildermarginTop in interface StylesBuilderpublic StylesBuilder opacity(double value)
StylesBuilderopacity in interface StylesBuilderpublic StylesBuilder outlineStyle(Style.OutlineStyle value)
StylesBuilderoutlineStyle in interface StylesBuilderpublic StylesBuilder outlineWidth(double value, Style.Unit unit)
StylesBuilderoutlineWidth in interface StylesBuilderpublic StylesBuilder overflow(Style.Overflow value)
StylesBuilderoverflow in interface StylesBuilderpublic StylesBuilder overflowX(Style.Overflow value)
StylesBuilderoverflowX in interface StylesBuilderpublic StylesBuilder overflowY(Style.Overflow value)
StylesBuilderoverflowY in interface StylesBuilderpublic StylesBuilder padding(double value, Style.Unit unit)
StylesBuilderpadding in interface StylesBuilderpublic StylesBuilder paddingBottom(double value, Style.Unit unit)
StylesBuilderpaddingBottom in interface StylesBuilderpublic StylesBuilder paddingLeft(double value, Style.Unit unit)
StylesBuilderpaddingLeft in interface StylesBuilderpublic StylesBuilder paddingRight(double value, Style.Unit unit)
StylesBuilderpaddingRight in interface StylesBuilderpublic StylesBuilder paddingTop(double value, Style.Unit unit)
StylesBuilderpaddingTop in interface StylesBuilderpublic StylesBuilder position(Style.Position value)
StylesBuilderposition in interface StylesBuilderpublic StylesBuilder right(double value, Style.Unit unit)
StylesBuilderright in interface StylesBuilderpublic StylesBuilder tableLayout(Style.TableLayout value)
StylesBuildertableLayout in interface StylesBuilderpublic StylesBuilder textAlign(Style.TextAlign value)
StylesBuildertextAlign in interface StylesBuilderpublic StylesBuilder textDecoration(Style.TextDecoration value)
StylesBuildertextDecoration in interface StylesBuilderpublic StylesBuilder textIndent(double value, Style.Unit unit)
StylesBuildertextIndent in interface StylesBuilderpublic StylesBuilder textJustify(Style.TextJustify value)
StylesBuildertextJustify in interface StylesBuilderpublic StylesBuilder textOverflow(Style.TextOverflow value)
StylesBuildertextOverflow in interface StylesBuilderpublic StylesBuilder textTransform(Style.TextTransform value)
StylesBuildertextTransform in interface StylesBuilderpublic StylesBuilder top(double value, Style.Unit unit)
StylesBuildertop in interface StylesBuilderpublic StylesBuilder trustedBackgroundColor(java.lang.String value)
StylesBuilderSets 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 StylesBuilderStylesBuilderpublic StylesBuilder trustedBackgroundImage(java.lang.String value)
StylesBuilderSets 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 StylesBuilderStylesBuilderpublic StylesBuilder trustedBorderColor(java.lang.String value)
StylesBuilderSets 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 StylesBuilderStylesBuilderpublic StylesBuilder trustedColor(java.lang.String value)
StylesBuilderSets 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 StylesBuilderStylesBuilderpublic StylesBuilder trustedOutlineColor(java.lang.String value)
StylesBuilderSets 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 StylesBuilderStylesBuilderpublic 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 StylesBuilderunit - the units of the valueStylesBuilderpublic 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 StylesBuilderStylesBuilderpublic StylesBuilder verticalAlign(double value, Style.Unit unit)
StylesBuilderverticalAlign in interface StylesBuilderpublic StylesBuilder verticalAlign(Style.VerticalAlign value)
StylesBuilderverticalAlign in interface StylesBuilderpublic StylesBuilder visibility(Style.Visibility value)
StylesBuildervisibility in interface StylesBuilderpublic StylesBuilder width(double value, Style.Unit unit)
StylesBuilderwidth in interface StylesBuilderpublic StylesBuilder zIndex(int value)
StylesBuilderzIndex in interface StylesBuilder