Class DomStylesBuilder
- java.lang.Object
-
- com.google.gwt.dom.builder.client.DomStylesBuilder
-
- All Implemented Interfaces:
StylesBuilder
class DomStylesBuilder extends java.lang.Object implements StylesBuilder
Builds the style object.
-
-
Constructor Summary
Constructors Constructor Description DomStylesBuilder(DomBuilderImpl delegate)Construct a newDomStylesBuilder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StylesBuilderbackgroundImage(SafeUri uri)Sets the background-image CSS property.StylesBuilderborderStyle(Style.BorderStyle value)Sets the border-style CSS property.StylesBuilderborderWidth(double value, Style.Unit unit)Set the border-width css property.StylesBuilderbottom(double value, Style.Unit unit)Set the bottom css property.StylesBuildercursor(Style.Cursor value)Sets the cursor CSS property.StylesBuilderdisplay(Style.Display value)Sets the display CSS property.voidendStyle()End the current style attribute.StylesBuilderfloatprop(Style.Float value)Set the float css property.StylesBuilderfontSize(double value, Style.Unit unit)Set the font-size css property.StylesBuilderfontStyle(Style.FontStyle value)Sets the font-style CSS property.StylesBuilderfontWeight(Style.FontWeight value)Sets the font-weight CSS property.StylesBuilderheight(double value, Style.Unit unit)Set the height css property.StylesBuilderleft(double value, Style.Unit unit)Set the left css property.StylesBuilderlineHeight(double value, Style.Unit unit)Set the line-height css property.StylesBuilderlistStyleType(Style.ListStyleType value)Sets the list-style-type CSS property.StylesBuildermargin(double value, Style.Unit unit)Set the margin css property.StylesBuildermarginBottom(double value, Style.Unit unit)Set the margin-bottom css property.StylesBuildermarginLeft(double value, Style.Unit unit)Set the margin-left css property.StylesBuildermarginRight(double value, Style.Unit unit)Set the margin-right css property.StylesBuildermarginTop(double value, Style.Unit unit)Set the margin-top css property.StylesBuilderopacity(double value)Set the opacity css property.StylesBuilderoutlineStyle(Style.OutlineStyle value)Sets the outline-style CSS property.StylesBuilderoutlineWidth(double value, Style.Unit unit)Set the outline-width css property.StylesBuilderoverflow(Style.Overflow value)Sets the overflow CSS property.StylesBuilderoverflowX(Style.Overflow value)Sets the overflow-x CSS property.StylesBuilderoverflowY(Style.Overflow value)Sets the overflow-y CSS property.StylesBuilderpadding(double value, Style.Unit unit)Set the padding css property.StylesBuilderpaddingBottom(double value, Style.Unit unit)Set the padding-bottom css property.StylesBuilderpaddingLeft(double value, Style.Unit unit)Set the padding-left css property.StylesBuilderpaddingRight(double value, Style.Unit unit)Set the padding-right css property.StylesBuilderpaddingTop(double value, Style.Unit unit)Set the padding-top css property.StylesBuilderposition(Style.Position value)Sets the position CSS property.StylesBuilderright(double value, Style.Unit unit)Set the right css property.StylesBuildertableLayout(Style.TableLayout value)Set the table-layout CSS property.StylesBuildertextAlign(Style.TextAlign value)Set the text-align CSS property.StylesBuildertextDecoration(Style.TextDecoration value)Set the text-decoration CSS property.StylesBuildertextIndent(double value, Style.Unit unit)Set the text-indent CSS property.StylesBuildertextJustify(Style.TextJustify value)Set the text-justify CSS3 property.StylesBuildertextOverflow(Style.TextOverflow value)Set the text-overflow CSS3 property.StylesBuildertextTransform(Style.TextTransform value)Set the text-transform CSS property.(package private) static java.lang.StringtoCamelCaseForm(java.lang.String name)Convert a hyphenated or camelCase string to a camelCase string.StylesBuildertop(double value, Style.Unit unit)Set the top css property.StylesBuildertrustedBackgroundColor(java.lang.String value)Sets the "background-color" style property to the specified color string.StylesBuildertrustedBackgroundImage(java.lang.String value)Sets the "background-image" style property to the specified value.StylesBuildertrustedBorderColor(java.lang.String value)Sets the "border-color" style property to the specified color string.StylesBuildertrustedColor(java.lang.String value)Sets the "color" style property, which controls font color, to the specified color string.StylesBuildertrustedOutlineColor(java.lang.String value)Sets the "outline-color" style property to the specified color string.StylesBuildertrustedProperty(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.StylesBuildertrustedProperty(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.StylesBuilderverticalAlign(double value, Style.Unit unit)Sets the vertical-align CSS property.StylesBuilderverticalAlign(Style.VerticalAlign value)Sets the vertical-align CSS property.StylesBuildervisibility(Style.Visibility value)Sets the visibility CSS property.StylesBuilderwidth(double value, Style.Unit unit)Set the width css property.StylesBuilderzIndex(int value)Set the z-index css property.
-
-
-
Constructor Detail
-
DomStylesBuilder
DomStylesBuilder(DomBuilderImpl delegate)
Construct a newDomStylesBuilder.- Parameters:
delegate- the delegate that builds the style
-
-
Method Detail
-
toCamelCaseForm
static java.lang.String toCamelCaseForm(java.lang.String name)
Convert a hyphenated or camelCase string to a camelCase string.- Parameters:
name- the hyphenated or camelCase string to convert- Returns:
- the hyphenated string
-
backgroundImage
public StylesBuilder backgroundImage(SafeUri uri)
Description copied from interface:StylesBuilderSets the background-image CSS property.- Specified by:
backgroundImagein interfaceStylesBuilder- Parameters:
uri- the URI of the background image- Returns:
- this
StylesBuilder - See Also:
StylesBuilder.trustedBackgroundImage(String)
-
borderStyle
public StylesBuilder borderStyle(Style.BorderStyle value)
Description copied from interface:StylesBuilderSets the border-style CSS property.- Specified by:
borderStylein interfaceStylesBuilder
-
borderWidth
public StylesBuilder borderWidth(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the border-width css property.- Specified by:
borderWidthin interfaceStylesBuilder
-
bottom
public StylesBuilder bottom(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the bottom css property.- Specified by:
bottomin interfaceStylesBuilder
-
cursor
public StylesBuilder cursor(Style.Cursor value)
Description copied from interface:StylesBuilderSets the cursor CSS property.- Specified by:
cursorin interfaceStylesBuilder
-
display
public StylesBuilder display(Style.Display value)
Description copied from interface:StylesBuilderSets the display CSS property.- Specified by:
displayin interfaceStylesBuilder
-
endStyle
public void endStyle()
Description copied from interface:StylesBuilderEnd the current style attribute.- Specified by:
endStylein interfaceStylesBuilder
-
floatprop
public StylesBuilder floatprop(Style.Float value)
Description copied from interface:StylesBuilderSet the float css property.- Specified by:
floatpropin interfaceStylesBuilder
-
fontSize
public StylesBuilder fontSize(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the font-size css property.- Specified by:
fontSizein interfaceStylesBuilder
-
fontStyle
public StylesBuilder fontStyle(Style.FontStyle value)
Description copied from interface:StylesBuilderSets the font-style CSS property.- Specified by:
fontStylein interfaceStylesBuilder
-
fontWeight
public StylesBuilder fontWeight(Style.FontWeight value)
Description copied from interface:StylesBuilderSets the font-weight CSS property.- Specified by:
fontWeightin interfaceStylesBuilder
-
height
public StylesBuilder height(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the height css property.- Specified by:
heightin interfaceStylesBuilder
-
left
public StylesBuilder left(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the left css property.- Specified by:
leftin interfaceStylesBuilder
-
lineHeight
public StylesBuilder lineHeight(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the line-height css property.- Specified by:
lineHeightin interfaceStylesBuilder
-
listStyleType
public StylesBuilder listStyleType(Style.ListStyleType value)
Description copied from interface:StylesBuilderSets the list-style-type CSS property.- Specified by:
listStyleTypein interfaceStylesBuilder
-
margin
public StylesBuilder margin(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the margin css property.- Specified by:
marginin interfaceStylesBuilder
-
marginBottom
public StylesBuilder marginBottom(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the margin-bottom css property.- Specified by:
marginBottomin interfaceStylesBuilder
-
marginLeft
public StylesBuilder marginLeft(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the margin-left css property.- Specified by:
marginLeftin interfaceStylesBuilder
-
marginRight
public StylesBuilder marginRight(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the margin-right css property.- Specified by:
marginRightin interfaceStylesBuilder
-
marginTop
public StylesBuilder marginTop(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the margin-top css property.- Specified by:
marginTopin interfaceStylesBuilder
-
opacity
public StylesBuilder opacity(double value)
Description copied from interface:StylesBuilderSet the opacity css property.- Specified by:
opacityin interfaceStylesBuilder
-
outlineStyle
public StylesBuilder outlineStyle(Style.OutlineStyle value)
Description copied from interface:StylesBuilderSets the outline-style CSS property.- Specified by:
outlineStylein interfaceStylesBuilder
-
outlineWidth
public StylesBuilder outlineWidth(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the outline-width css property.- Specified by:
outlineWidthin interfaceStylesBuilder
-
overflow
public StylesBuilder overflow(Style.Overflow value)
Description copied from interface:StylesBuilderSets the overflow CSS property.- Specified by:
overflowin interfaceStylesBuilder
-
overflowX
public StylesBuilder overflowX(Style.Overflow value)
Description copied from interface:StylesBuilderSets the overflow-x CSS property.- Specified by:
overflowXin interfaceStylesBuilder
-
overflowY
public StylesBuilder overflowY(Style.Overflow value)
Description copied from interface:StylesBuilderSets the overflow-y CSS property.- Specified by:
overflowYin interfaceStylesBuilder
-
padding
public StylesBuilder padding(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the padding css property.- Specified by:
paddingin interfaceStylesBuilder
-
paddingBottom
public StylesBuilder paddingBottom(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the padding-bottom css property.- Specified by:
paddingBottomin interfaceStylesBuilder
-
paddingLeft
public StylesBuilder paddingLeft(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the padding-left css property.- Specified by:
paddingLeftin interfaceStylesBuilder
-
paddingRight
public StylesBuilder paddingRight(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the padding-right css property.- Specified by:
paddingRightin interfaceStylesBuilder
-
paddingTop
public StylesBuilder paddingTop(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the padding-top css property.- Specified by:
paddingTopin interfaceStylesBuilder
-
position
public StylesBuilder position(Style.Position value)
Description copied from interface:StylesBuilderSets the position CSS property.- Specified by:
positionin interfaceStylesBuilder
-
right
public StylesBuilder right(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the right css property.- Specified by:
rightin interfaceStylesBuilder
-
tableLayout
public StylesBuilder tableLayout(Style.TableLayout value)
Description copied from interface:StylesBuilderSet the table-layout CSS property.- Specified by:
tableLayoutin interfaceStylesBuilder
-
textAlign
public StylesBuilder textAlign(Style.TextAlign value)
Description copied from interface:StylesBuilderSet the text-align CSS property.- Specified by:
textAlignin interfaceStylesBuilder
-
textDecoration
public StylesBuilder textDecoration(Style.TextDecoration value)
Description copied from interface:StylesBuilderSet the text-decoration CSS property.- Specified by:
textDecorationin interfaceStylesBuilder
-
textIndent
public StylesBuilder textIndent(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the text-indent CSS property.- Specified by:
textIndentin interfaceStylesBuilder
-
textJustify
public StylesBuilder textJustify(Style.TextJustify value)
Description copied from interface:StylesBuilderSet the text-justify CSS3 property.- Specified by:
textJustifyin interfaceStylesBuilder
-
textOverflow
public StylesBuilder textOverflow(Style.TextOverflow value)
Description copied from interface:StylesBuilderSet the text-overflow CSS3 property.- Specified by:
textOverflowin interfaceStylesBuilder
-
textTransform
public StylesBuilder textTransform(Style.TextTransform value)
Description copied from interface:StylesBuilderSet the text-transform CSS property.- Specified by:
textTransformin interfaceStylesBuilder
-
top
public StylesBuilder top(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the top css property.- Specified by:
topin interfaceStylesBuilder
-
trustedBackgroundColor
public StylesBuilder trustedBackgroundColor(java.lang.String value)
Description copied from interface: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.- Specified by:
trustedBackgroundColorin interfaceStylesBuilder- Returns:
- this
StylesBuilder
-
trustedBackgroundImage
public StylesBuilder trustedBackgroundImage(java.lang.String value)
Description copied from interface: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.- Specified by:
trustedBackgroundImagein interfaceStylesBuilder- Returns:
- this
StylesBuilder
-
trustedBorderColor
public StylesBuilder trustedBorderColor(java.lang.String value)
Description copied from interface: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.- Specified by:
trustedBorderColorin interfaceStylesBuilder- Returns:
- this
StylesBuilder
-
trustedColor
public StylesBuilder trustedColor(java.lang.String value)
Description copied from interface: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.- Specified by:
trustedColorin interfaceStylesBuilder- Returns:
- this
StylesBuilder
-
trustedOutlineColor
public StylesBuilder trustedOutlineColor(java.lang.String value)
Description copied from interface: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.- Specified by:
trustedOutlineColorin interfaceStylesBuilder- Returns:
- this
StylesBuilder
-
trustedProperty
public StylesBuilder trustedProperty(java.lang.String name, double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet 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
SafeStylescontract 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:
trustedPropertyin interfaceStylesBuilderunit- the units of the value- Returns:
- this
StylesBuilder
-
trustedProperty
public StylesBuilder trustedProperty(java.lang.String name, java.lang.String value)
Description copied from interface:StylesBuilderSet 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
SafeStylescontract 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:
trustedPropertyin interfaceStylesBuilder- Returns:
- this
StylesBuilder
-
verticalAlign
public StylesBuilder verticalAlign(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSets the vertical-align CSS property.- Specified by:
verticalAlignin interfaceStylesBuilder
-
verticalAlign
public StylesBuilder verticalAlign(Style.VerticalAlign value)
Description copied from interface:StylesBuilderSets the vertical-align CSS property.- Specified by:
verticalAlignin interfaceStylesBuilder
-
visibility
public StylesBuilder visibility(Style.Visibility value)
Description copied from interface:StylesBuilderSets the visibility CSS property.- Specified by:
visibilityin interfaceStylesBuilder
-
width
public StylesBuilder width(double value, Style.Unit unit)
Description copied from interface:StylesBuilderSet the width css property.- Specified by:
widthin interfaceStylesBuilder
-
zIndex
public StylesBuilder zIndex(int value)
Description copied from interface:StylesBuilderSet the z-index css property.- Specified by:
zIndexin interfaceStylesBuilder
-
-