public static final class Properties.Builder extends Object implements PropertiesOrBuilder
setLetterSpacingPx(int)
sets the
letter-spacing property to the given length expressed in pixels. Some
methods are simply named set, because they expect a single parameter of
type enum, and the name of the enum tells which property is being set.
For example, set(TextAlignValue.CENTER)
sets the value of the
text-align property to 'center'.
All these methods are called typesafe setters.
Typesafe setters will fail with an illegal argument exception if the given value is illegal according to the CSS specification. For example, passing -2 to the border-width setter will fail because it is specified that a border-width cannot be negative.
Some typesafe setters may set vendor-specific properties under the hood to fix browser compatibility issues. This behavior is undocumented and subject to change.
Typesafe setters won't allow you to set all existing CSS properties to
all possible values.
In some cases, you may have no other choice than calling
set(String, String)
. This method does not perform any kind of
verification (besides grammar check). It is recommended that you only call
it if there is no typesafe setter that would do the job.
Note: as in CSS the order in which properties are set DOES matter sometimes. For example, setting the property margin after margin-top is different from setting the property margin-top after margin.
public Properties.Builder copyFrom(Properties properties)
public Properties.Builder copyFrom(String propertiesString)
IllegalArgumentException
- if the input string is not a
grammatically-correct sequence of semicolon-separated name:value CSS
propertiespublic Properties.Builder set(String name, String value)
It is recommended that you only call this method if there is no typesafe setter that would do the job.
IllegalArgumentException
- if the given name is not a valid CSS
identifier; if the given value is a grammatically-valid CSS
expressionpublic Properties.Builder setBackground(Color backgroundColor, BackgroundLayer... layers)
public Properties.Builder setBackground(BackgroundLayer... layers)
public Properties.Builder setListStyleImage(Image image)
public Properties.Builder setHeightPx(int px)
public Properties.Builder setHeightPct(double heightPct)
public Properties.Builder setWidthPx(int px)
public Properties.Builder setWidthPct(double pct)
public Properties.Builder setMinHeightPx(int px)
public Properties.Builder setMinHeightPct(double pct)
public Properties.Builder setMinWidthPx(int px)
public Properties.Builder setMinWidthPct(double pct)
public Properties.Builder setMaxHeightPx(int px)
public Properties.Builder setMaxHeightPct(double pct)
public Properties.Builder setMaxWidthPx(int px)
public Properties.Builder setMaxWidthPct(double pct)
public Properties.Builder setTopPx(int px)
public Properties.Builder setTopPct(double pct)
public Properties.Builder setRightPx(int px)
public Properties.Builder setRightPct(double pct)
public Properties.Builder setBottomPx(int px)
public Properties.Builder setBottomPct(double pct)
public Properties.Builder setLeftPx(int px)
public Properties.Builder setLeftPct(double pct)
public Properties.Builder setOutline(int widthPx, Color color, OutlineStyleValue style)
public Properties.Builder setOutlineWidthPx(int px)
public Properties.Builder setOutlineColor(Color color)
public Properties.Builder setColor(Color color)
public Properties.Builder setMarginPx(int px)
public Properties.Builder setMarginPx(int vPx, int hPx)
public Properties.Builder setMarginPx(int topPx, int rightPx, int bottomPx, int leftPx)
public Properties.Builder setMarginTopPct(double pct)
public Properties.Builder setMarginTopPx(int px)
public Properties.Builder setMarginRightPct(double pct)
public Properties.Builder setMarginRightPx(int px)
public Properties.Builder setMarginBottomPct(double pct)
public Properties.Builder setMarginBottomPx(int px)
public Properties.Builder setMarginLeftPct(double pct)
public Properties.Builder setMarginLeftPx(int px)
public Properties.Builder setPaddingPx(int px)
public Properties.Builder setPaddingPx(int vPx, int hPx)
public Properties.Builder setPaddingPx(int topPx, int rightPx, int bottomPx, int leftPx)
public Properties.Builder setPaddingTopPx(int px)
public Properties.Builder setPaddingTopPct(double pct)
public Properties.Builder setPaddingRightPx(int px)
public Properties.Builder setPaddingRightPct(double pct)
public Properties.Builder setPaddingBottomPx(int px)
public Properties.Builder setPaddingBottomPct(double pct)
public Properties.Builder setPaddingLeftPx(int px)
public Properties.Builder setPaddingLeftPct(double pct)
public Properties.Builder setBorderWidthPx(int px)
public Properties.Builder setBorderWidthPx(int vPx, int hPx)
public Properties.Builder setBorderWidthPx(int topPx, int rightPx, int bottomPx, int leftPx)
public Properties.Builder setBorderTopWidthPx(int px)
public Properties.Builder setBorderRightWidthPx(int px)
public Properties.Builder setBorderBottomWidthPx(int px)
public Properties.Builder setBorderLeftWidthPx(int px)
public Properties.Builder setBorderColor(Color color)
public Properties.Builder setBorderColor(Color vColor, Color hColor)
public Properties.Builder setBorderColor(Color topColor, Color rightColor, Color bottomColor, Color leftColor)
public Properties.Builder setBorderTopColor(Color color)
public Properties.Builder setBorderRightColor(Color color)
public Properties.Builder setBorderBottomColor(Color color)
public Properties.Builder setBorderLeftColor(Color color)
public Properties.Builder set(BorderStyleValue value)
public Properties.Builder set(BorderStyleValue vValue, BorderStyleValue hValue)
public Properties.Builder set(BorderStyleValue topValue, BorderStyleValue rightValue, BorderStyleValue bottomValue, BorderStyleValue leftValue)
public Properties.Builder setBorderTopStyle(BorderStyleValue value)
public Properties.Builder setBorderRightStyle(BorderStyleValue value)
public Properties.Builder setBorderBottomStyle(BorderStyleValue value)
public Properties.Builder setBorderLeftStyle(BorderStyleValue value)
public Properties.Builder setBorderTop(int widthPx, Color color, BorderStyleValue style)
public Properties.Builder setBorderRight(int widthPx, Color color, BorderStyleValue style)
public Properties.Builder setBorderBottom(int widthPx, Color color, BorderStyleValue style)
public Properties.Builder setBorderLeft(int widthPx, Color color, BorderStyleValue style)
public Properties.Builder setBorder(int widthPx, Color color, BorderStyleValue style)
public Properties.Builder setBorderRadiusPx(int px)
public Properties.Builder setBorderTopRightRadiusPx(int px)
public Properties.Builder setBorderBottomRightRadiusPx(int px)
public Properties.Builder setBorderBottomLeftRadiusPx(int px)
public Properties.Builder setBorderTopLeftRadiusPx(int px)
public Properties.Builder setBorderSpacingPx(int px)
public Properties.Builder setFontFamily(FontFamilyFallback fallback, String... names)
public Properties.Builder setFontFamily(String... names)
public Properties.Builder setFontSizePx(int px)
public Properties.Builder setFontSizeEm(double em)
public Properties.Builder setLetterSpacingPx(int px)
public Properties.Builder setLetterSpacingEm(double em)
public Properties.Builder setWordSpacingPx(int px)
public Properties.Builder setWordSpacingEm(double em)
public Properties.Builder setLineHeightPx(int px)
public Properties.Builder setLineHeightEm(double em)
public Properties.Builder setLineHeightPct(double pct)
public Properties.Builder setTextIndentPx(int px)
public Properties.Builder setTextIndentEm(double em)
public Properties.Builder setTextShadow(Shadow... shadows)
public Properties.Builder setBoxShadow(Shadow... shadows)
public Properties.Builder setOpacity(double opacity)
public Properties.Builder setTransform(TransformFunction... functions)
public Properties.Builder setTransformOriginPx(int xPx, int yPx)
public Properties.Builder setTransformOriginPxPct(int xPx, double yPct)
public Properties.Builder setTransformOriginPctPx(double xPct, int yPx)
public Properties.Builder setTransformOriginPct(double xPct, double yPct)
@PoorBrowserSupport public Properties.Builder setColumnCount(int columnCount)
@PoorBrowserSupport public Properties.Builder setColumnGapPx(int px)
@PoorBrowserSupport public Properties.Builder setColumnRule(int widthPx, Color color, BorderStyleValue style)
@PoorBrowserSupport public Properties.Builder setColumnRuleWidthPx(int px)
@PoorBrowserSupport public Properties.Builder setColumnRuleColor(Color color)
@PoorBrowserSupport public Properties.Builder setColumnRuleStyle(BorderStyleValue style)
@PoorBrowserSupport public Properties.Builder setColumnWidthPx(int px)
@PoorBrowserSupport public Properties.Builder setTransition(Transition... singles)
@PoorBrowserSupport public Properties.Builder setAnimation(Animation... singles)
@PoorBrowserSupport public Properties.Builder setAnimationTimingFunction(TimingFunction function)
@PoorBrowserSupport public Properties.Builder setAnimationPlayState(boolean running)
public Properties.Builder setZIndex(int zIndex)
public Properties.Builder set(BorderCollapseValue value)
public Properties.Builder set(CaptionSideValue value)
public Properties.Builder set(ClearValue value)
public Properties.Builder set(CursorValue value)
public Properties.Builder set(DirectionValue value)
public Properties.Builder set(DisplayValue value)
public Properties.Builder set(EmptyCellsValue value)
public Properties.Builder set(FloatValue value)
public Properties.Builder set(FontStyleValue value)
public Properties.Builder set(FontVariantValue value)
public Properties.Builder set(FontWeightValue value)
public Properties.Builder set(ListStylePositionValue value)
public Properties.Builder set(ListStyleTypeValue value)
public Properties.Builder set(OutlineStyleValue value)
public Properties.Builder set(OverflowValue value)
public Properties.Builder set(PositionValue value)
public Properties.Builder set(VerticalAlignValue value)
public Properties.Builder set(TableLayoutValue value)
public Properties.Builder set(TextAlignValue value)
public Properties.Builder set(TextDecorationValue value)
public Properties.Builder set(TextTransformValue value)
public Properties.Builder set(UnicodeBidiValue value)
public Properties.Builder set(VisibilityValue value)
public Properties.Builder set(WhiteSpaceValue value)
public Properties build()
build
in interface PropertiesOrBuilder
Copyright © 2013. All Rights Reserved.