Package com.webfirmframework.wffweb.css
Class BorderWidth
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<BorderWidth>
com.webfirmframework.wffweb.css.BorderWidth
- All Implemented Interfaces:
CssProperty
,StateChangeInformer<CssProperty>
,Serializable
,Cloneable
public class BorderWidth
extends AbstractCssProperty<BorderWidth>
implements StateChangeInformer<CssProperty>
border-width: medium|thin|thick|length|initial|inherit; The border-width property sets the width of an element's four borders. This property can have from one to four values. Examples: border-width:thin medium thick 10px; top border is thin right border is medium bottom border is thick left border is 10px border-width:thin medium thick; top border is thin right and left borders are medium bottom border is thick border-width:thin medium; top and bottom borders are thin right and left borders are medium border-width:thin; all four borders are thin Note: Always declare the border-style property before the border-width property. An element must have borders before you can set the width.
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThemedium
will be set as the valueBorderWidth
(float percent) BorderWidth
(float value, CssLengthUnit cssLengthUnit) BorderWidth
(BorderWidth borderBottomWidth) BorderWidth
(String cssValue) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
validates if the given cssValue is valid for this class.void
sets asinherit
void
sets asinitial
void
sets asmedium
.void
sets asthick
.void
sets asthin
.void
setBorderWidth
(BorderTopWidth borderTopWidth, BorderRightWidth borderRightWidth, BorderBottomWidth borderBottomWidth, BorderLeftWidth borderLeftWidth) sets the top, right, bottom and left width inBorderWidth
.setCssValue
(String cssValue) void
setPercent
(float percent) setValue
(float value, CssLengthUnit cssLengthUnit) void
stateChanged
(CssProperty stateChangedObject) toString()
Methods inherited from class com.webfirmframework.wffweb.css.core.AbstractCssProperty
clone, getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer, toCssString
-
Field Details
-
MEDIUM
- See Also:
-
THIN
- See Also:
-
THICK
- See Also:
-
INITIAL
- See Also:
-
INHERIT
- See Also:
-
-
Constructor Details
-
BorderWidth
public BorderWidth()Themedium
will be set as the value -
BorderWidth
- Parameters:
cssValue
- the css value to set.
-
BorderWidth
- Parameters:
borderBottomWidth
- theBorderBottomWidth
object from which the cssValue to set.And,null
will throwNullValueException
-
BorderWidth
public BorderWidth(float percent) - Parameters:
percent
- the percentage value to set. The cssLengthUnit will automatically set to %.- Since:
- 1.0.0
-
BorderWidth
- Parameters:
value
-cssLengthUnit
-
-
-
Method Details
-
setValue
- Parameters:
value
-cssLengthUnit
-- Returns:
- the current object
- Since:
- 1.0.0
-
setPercent
public void setPercent(float percent) - Parameters:
percent
- the percent to set- 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
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<BorderWidth>
- Parameters:
cssValue
- the value should be in the format of55px
or95%
.null
is considered as an invalid value and it will throwNullValueException
.- 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
-
setAsMedium
public void setAsMedium()sets asmedium
.- Since:
- 1.0.0
-
setAsThin
public void setAsThin()sets asthin
.- Since:
- 1.0.0
-
setAsThick
public void setAsThick()sets asthick
.- Since:
- 1.0.0
-
setBorderWidth
public void setBorderWidth(BorderTopWidth borderTopWidth, BorderRightWidth borderRightWidth, BorderBottomWidth borderBottomWidth, BorderLeftWidth borderLeftWidth) sets the top, right, bottom and left width inBorderWidth
. 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:
borderTopWidth
-borderRightWidth
-borderBottomWidth
-borderLeftWidth
-- Since:
- 1.0.0
-
getBorderTopWidth
- Returns:
- the borderTopWidth
- Since:
- 1.0.0
-
getBorderRightWidth
- Returns:
- the borderRightWidth
- Since:
- 1.0.0
-
getBorderBottomWidth
- Returns:
- the borderBottomWidth
- Since:
- 1.0.0
-
getBorderLeftWidth
- Returns:
- the borderLeftWidth
- Since:
- 1.0.0
-
stateChanged
- Specified by:
stateChanged
in interfaceStateChangeInformer<CssProperty>
-
isValid
validates if the given cssValue is valid for this class.- Parameters:
cssValue
- the value to check.- Returns:
- true if valid and false if invalid.
- Since:
- 1.0.0
-
hasPredefinedConstantValue
public boolean hasPredefinedConstantValue()- Returns:
- true if its cssValue is any of the values
initial or inherit
. - Since:
- 1.0.0
-