Package com.webfirmframework.wffweb.css
Class Padding
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<Padding>
com.webfirmframework.wffweb.css.Padding
- All Implemented Interfaces:
CssProperty
,StateChangeInformer<CssProperty>
,Serializable
,Cloneable
public class Padding
extends AbstractCssProperty<Padding>
implements StateChangeInformer<CssProperty>
The padding shorthand property sets all the padding properties in one declaration. This property can have from one to four values. Examples: padding:10px 5px 15px 20px; top padding is 10px right padding is 5px bottom padding is 15px left padding is 20px padding:10px 5px 15px; top padding is 10px right and left padding are 5px bottom padding is 15px padding:10px 5px; top and bottom padding are 10px right and left padding are 5px padding:10px; all four paddings are 10px Note: Negative values are not allowed. Default value: 0 Inherited: no Animatable: yes Version: CSS1 JavaScript syntax: object.style.padding="100px 20px"
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()
gets the value,getCssValue
method can also be used to get the same value.boolean
static boolean
void
sets asinherit
void
sets asinitial
setCssValue
(String cssValue) void
setPadding
(PaddingTop paddingTop, PaddingRight paddingRight, PaddingBottom paddingBottom, PaddingLeft paddingLeft) sets the top, right, bottom and left width inPadding
.the padding length to set.void
stateChanged
(CssProperty stateChangedObject) toString()
Methods inherited from class com.webfirmframework.wffweb.css.core.AbstractCssProperty
clone, getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer, toCssString
-
Field Details
-
INITIAL
- See Also:
-
INHERIT
- See Also:
-
-
Constructor Details
-
Padding
public Padding()Theinitial
will be set as the value -
Padding
- Parameters:
cssValue
- the css value to set.
-
Padding
- Parameters:
paddingBottom
- thePaddingBottom
object from which the cssValue to set.And,null
will throwNullValueException
-
-
Method Details
-
setValue
the padding length to set. The alternative methodsetCssValue
can also be used.- Parameters:
value
-- Returns:
- the current object
- Since:
- 1.0.0
-
getCssName
- Specified by:
getCssName
in interfaceCssProperty
- Returns:
- the name portion in style, eg
align-content
for stylealign-content: center
.
-
getCssValue
- Specified by:
getCssValue
in interfaceCssProperty
- Returns:
- the value portion in style, eg
center
for stylealign-content: center
.
-
toString
-
getValue
gets the value,getCssValue
method can also be used to get the same value.- Returns:
- the value in String.
- Since:
- 1.0.0
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<Padding>
- Parameters:
cssValue
- the value should be a length value, for example5px
.null
is considered as an invalid value and it will throwNullValueException
.And an empty string is also considered as an invalid value and it will throwInvalidValueException
.- Returns:
- the current object.
- Since:
- 1.0.0
-
setAsInitial
public void setAsInitial()sets asinitial
- Since:
- 1.0.0
-
setAsInherit
public void setAsInherit()sets asinherit
- Since:
- 1.0.0
-
getPaddingTop
- Returns:
- the paddingTop
- Since:
- 1.0.0
-
setPadding
public void setPadding(PaddingTop paddingTop, PaddingRight paddingRight, PaddingBottom paddingBottom, PaddingLeft paddingLeft) sets the top, right, bottom and left width inPadding
. If the given argument is already used by another object, then the existing/cloned object will be used. And throwsNullValueException
if any of the given argument is null.- Parameters:
paddingTop
-paddingRight
-paddingBottom
-paddingLeft
-- Since:
- 1.0.0
-
getPaddingRight
- Returns:
- the paddingRight
- Since:
- 1.0.0
-
getPaddingBottom
- Returns:
- the paddingBottom
- Since:
- 1.0.0
-
getPaddingLeft
- Returns:
- the paddingLeft
- Since:
- 1.0.0
-
stateChanged
- Specified by:
stateChanged
in interfaceStateChangeInformer<CssProperty>
-
hasPredefinedConstantValue
public boolean hasPredefinedConstantValue()- Returns:
- true if its cssValue is any of the values
initial, inherit or transparent
. - Since:
- 1.0.0
-
isValid
- Since:
- 1.0.0
-