Class DomStylesBuilder
- All Implemented Interfaces:
StylesBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbackgroundImage
(SafeUri uri) Sets the background-image CSS property.borderStyle
(Style.BorderStyle value) Sets the border-style CSS property.borderWidth
(double value, Style.Unit unit) Set the border-width css property.bottom
(double value, Style.Unit unit) Set the bottom css property.cursor
(Style.Cursor value) Sets the cursor CSS property.display
(Style.Display value) Sets the display CSS property.void
endStyle()
End the current style attribute.floatprop
(Style.Float value) Set the float css property.fontSize
(double value, Style.Unit unit) Set the font-size css property.fontStyle
(Style.FontStyle value) Sets the font-style CSS property.fontWeight
(Style.FontWeight value) Sets the font-weight CSS property.height
(double value, Style.Unit unit) Set the height css property.left
(double value, Style.Unit unit) Set the left css property.lineHeight
(double value, Style.Unit unit) Set the line-height css property.listStyleType
(Style.ListStyleType value) Sets the list-style-type CSS property.margin
(double value, Style.Unit unit) Set the margin css property.marginBottom
(double value, Style.Unit unit) Set the margin-bottom css property.marginLeft
(double value, Style.Unit unit) Set the margin-left css property.marginRight
(double value, Style.Unit unit) Set the margin-right css property.marginTop
(double value, Style.Unit unit) Set the margin-top css property.opacity
(double value) Set the opacity css property.outlineStyle
(Style.OutlineStyle value) Sets the outline-style CSS property.outlineWidth
(double value, Style.Unit unit) Set the outline-width css property.overflow
(Style.Overflow value) Sets the overflow CSS property.overflowX
(Style.Overflow value) Sets the overflow-x CSS property.overflowY
(Style.Overflow value) Sets the overflow-y CSS property.padding
(double value, Style.Unit unit) Set the padding css property.paddingBottom
(double value, Style.Unit unit) Set the padding-bottom css property.paddingLeft
(double value, Style.Unit unit) Set the padding-left css property.paddingRight
(double value, Style.Unit unit) Set the padding-right css property.paddingTop
(double value, Style.Unit unit) Set the padding-top css property.position
(Style.Position value) Sets the position CSS property.right
(double value, Style.Unit unit) Set the right css property.tableLayout
(Style.TableLayout value) Set the table-layout CSS property.textAlign
(Style.TextAlign value) Set the text-align CSS property.Set the text-decoration CSS property.textIndent
(double value, Style.Unit unit) Set the text-indent CSS property.textJustify
(Style.TextJustify value) Set the text-justify CSS3 property.textOverflow
(Style.TextOverflow value) Set the text-overflow CSS3 property.textTransform
(Style.TextTransform value) Set the text-transform CSS property.(package private) static String
toCamelCaseForm
(String name) Convert a hyphenated or camelCase string to a camelCase string.top
(double value, Style.Unit unit) Set the top css property.trustedBackgroundColor
(String value) Sets the "background-color" style property to the specified color string.trustedBackgroundImage
(String value) Sets the "background-image" style property to the specified value.trustedBorderColor
(String value) Sets the "border-color" style property to the specified color string.trustedColor
(String value) Sets the "color" style property, which controls font color, to the specified color string.trustedOutlineColor
(String value) Sets the "outline-color" style property to the specified color string.trustedProperty
(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.trustedProperty
(String name, String value) Set a style property from a trusted name and a trusted value, i.e., without escaping the name and value.verticalAlign
(double value, Style.Unit unit) Sets the vertical-align CSS property.verticalAlign
(Style.VerticalAlign value) Sets the vertical-align CSS property.visibility
(Style.Visibility value) Sets the visibility CSS property.width
(double value, Style.Unit unit) Set the width css property.zIndex
(int value) Set the z-index css property.
-
Constructor Details
-
DomStylesBuilder
DomStylesBuilder(DomBuilderImpl delegate) Construct a newDomStylesBuilder
.- Parameters:
delegate
- the delegate that builds the style
-
-
Method Details
-
toCamelCaseForm
Convert a hyphenated or camelCase string to a camelCase string.- Parameters:
name
- the hyphenated or camelCase string to convert- Returns:
- the hyphenated string
-
borderStyle
Description copied from interface:StylesBuilder
Sets the border-style CSS property.- Specified by:
borderStyle
in interfaceStylesBuilder
-
borderWidth
Description copied from interface:StylesBuilder
Set the border-width css property.- Specified by:
borderWidth
in interfaceStylesBuilder
-
bottom
Description copied from interface:StylesBuilder
Set the bottom css property.- Specified by:
bottom
in interfaceStylesBuilder
-
cursor
Description copied from interface:StylesBuilder
Sets the cursor CSS property.- Specified by:
cursor
in interfaceStylesBuilder
-
display
Description copied from interface:StylesBuilder
Sets the display CSS property.- Specified by:
display
in interfaceStylesBuilder
-
endStyle
public void endStyle()Description copied from interface:StylesBuilder
End the current style attribute.- Specified by:
endStyle
in interfaceStylesBuilder
-
floatprop
Description copied from interface:StylesBuilder
Set the float css property.- Specified by:
floatprop
in interfaceStylesBuilder
-
fontSize
Description copied from interface:StylesBuilder
Set the font-size css property.- Specified by:
fontSize
in interfaceStylesBuilder
-
fontStyle
Description copied from interface:StylesBuilder
Sets the font-style CSS property.- Specified by:
fontStyle
in interfaceStylesBuilder
-
fontWeight
Description copied from interface:StylesBuilder
Sets the font-weight CSS property.- Specified by:
fontWeight
in interfaceStylesBuilder
-
height
Description copied from interface:StylesBuilder
Set the height css property.- Specified by:
height
in interfaceStylesBuilder
-
left
Description copied from interface:StylesBuilder
Set the left css property.- Specified by:
left
in interfaceStylesBuilder
-
lineHeight
Description copied from interface:StylesBuilder
Set the line-height css property.- Specified by:
lineHeight
in interfaceStylesBuilder
-
listStyleType
Description copied from interface:StylesBuilder
Sets the list-style-type CSS property.- Specified by:
listStyleType
in interfaceStylesBuilder
-
margin
Description copied from interface:StylesBuilder
Set the margin css property.- Specified by:
margin
in interfaceStylesBuilder
-
marginBottom
Description copied from interface:StylesBuilder
Set the margin-bottom css property.- Specified by:
marginBottom
in interfaceStylesBuilder
-
marginLeft
Description copied from interface:StylesBuilder
Set the margin-left css property.- Specified by:
marginLeft
in interfaceStylesBuilder
-
marginRight
Description copied from interface:StylesBuilder
Set the margin-right css property.- Specified by:
marginRight
in interfaceStylesBuilder
-
marginTop
Description copied from interface:StylesBuilder
Set the margin-top css property.- Specified by:
marginTop
in interfaceStylesBuilder
-
opacity
Description copied from interface:StylesBuilder
Set the opacity css property.- Specified by:
opacity
in interfaceStylesBuilder
-
outlineStyle
Description copied from interface:StylesBuilder
Sets the outline-style CSS property.- Specified by:
outlineStyle
in interfaceStylesBuilder
-
outlineWidth
Description copied from interface:StylesBuilder
Set the outline-width css property.- Specified by:
outlineWidth
in interfaceStylesBuilder
-
overflow
Description copied from interface:StylesBuilder
Sets the overflow CSS property.- Specified by:
overflow
in interfaceStylesBuilder
-
overflowX
Description copied from interface:StylesBuilder
Sets the overflow-x CSS property.- Specified by:
overflowX
in interfaceStylesBuilder
-
overflowY
Description copied from interface:StylesBuilder
Sets the overflow-y CSS property.- Specified by:
overflowY
in interfaceStylesBuilder
-
padding
Description copied from interface:StylesBuilder
Set the padding css property.- Specified by:
padding
in interfaceStylesBuilder
-
paddingBottom
Description copied from interface:StylesBuilder
Set the padding-bottom css property.- Specified by:
paddingBottom
in interfaceStylesBuilder
-
paddingLeft
Description copied from interface:StylesBuilder
Set the padding-left css property.- Specified by:
paddingLeft
in interfaceStylesBuilder
-
paddingRight
Description copied from interface:StylesBuilder
Set the padding-right css property.- Specified by:
paddingRight
in interfaceStylesBuilder
-
paddingTop
Description copied from interface:StylesBuilder
Set the padding-top css property.- Specified by:
paddingTop
in interfaceStylesBuilder
-
position
Description copied from interface:StylesBuilder
Sets the position CSS property.- Specified by:
position
in interfaceStylesBuilder
-
right
Description copied from interface:StylesBuilder
Set the right css property.- Specified by:
right
in interfaceStylesBuilder
-
tableLayout
Description copied from interface:StylesBuilder
Set the table-layout CSS property.- Specified by:
tableLayout
in interfaceStylesBuilder
-
textAlign
Description copied from interface:StylesBuilder
Set the text-align CSS property.- Specified by:
textAlign
in interfaceStylesBuilder
-
textDecoration
Description copied from interface:StylesBuilder
Set the text-decoration CSS property.- Specified by:
textDecoration
in interfaceStylesBuilder
-
textIndent
Description copied from interface:StylesBuilder
Set the text-indent CSS property.- Specified by:
textIndent
in interfaceStylesBuilder
-
textJustify
Description copied from interface:StylesBuilder
Set the text-justify CSS3 property.- Specified by:
textJustify
in interfaceStylesBuilder
-
textOverflow
Description copied from interface:StylesBuilder
Set the text-overflow CSS3 property.- Specified by:
textOverflow
in interfaceStylesBuilder
-
textTransform
Description copied from interface:StylesBuilder
Set the text-transform CSS property.- Specified by:
textTransform
in interfaceStylesBuilder
-
top
Description copied from interface:StylesBuilder
Set the top css property.- Specified by:
top
in interfaceStylesBuilder
-
trustedBackgroundColor
Description copied from interface: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
.- Specified by:
trustedBackgroundColor
in interfaceStylesBuilder
- Returns:
- this
StylesBuilder
-
trustedBackgroundImage
Description copied from interface: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
.- Specified by:
trustedBackgroundImage
in interfaceStylesBuilder
- Returns:
- this
StylesBuilder
-
trustedBorderColor
Description copied from interface: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
.- Specified by:
trustedBorderColor
in interfaceStylesBuilder
- Returns:
- this
StylesBuilder
-
trustedColor
Description copied from interface: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
.- Specified by:
trustedColor
in interfaceStylesBuilder
- Returns:
- this
StylesBuilder
-
trustedOutlineColor
Description copied from interface: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
.- Specified by:
trustedOutlineColor
in interfaceStylesBuilder
- Returns:
- this
StylesBuilder
-
trustedProperty
Description copied from interface: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.- Specified by:
trustedProperty
in interfaceStylesBuilder
- Parameters:
unit
- the units of the value- Returns:
- this
StylesBuilder
-
trustedProperty
Description copied from interface: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.- Specified by:
trustedProperty
in interfaceStylesBuilder
- Returns:
- this
StylesBuilder
-
verticalAlign
Description copied from interface:StylesBuilder
Sets the vertical-align CSS property.- Specified by:
verticalAlign
in interfaceStylesBuilder
-
verticalAlign
Description copied from interface:StylesBuilder
Sets the vertical-align CSS property.- Specified by:
verticalAlign
in interfaceStylesBuilder
-
visibility
Description copied from interface:StylesBuilder
Sets the visibility CSS property.- Specified by:
visibility
in interfaceStylesBuilder
-
width
Description copied from interface:StylesBuilder
Set the width css property.- Specified by:
width
in interfaceStylesBuilder
-
zIndex
Description copied from interface:StylesBuilder
Set the z-index css property.- Specified by:
zIndex
in interfaceStylesBuilder
-