Class Flex
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<Flex>
com.webfirmframework.wffweb.css.css3.Flex
- All Implemented Interfaces:
CssProperty
,StateChangeInformer<CssProperty>
,Serializable
,Cloneable
flex: flex-grow flex-shrink flex-basis|auto|initial|inherit; The flex property specifies the length of the item, relative to the rest of the flexible items inside the same container. The flex property is a shorthand for the flex-grow, flex-shrink, and the flex-basis properties. Note: If the element is not a flexible item, the flex property has no effect. Default value: 0 1 auto Inherited: no Animatable: yes Version: CSS3 JavaScript syntax: object.style.flex="1" The undefined value for flex-grow, flex-shrink and flex-basis in flex property is 1, 1 and 0% respectively.
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPredefinedConstant
(String constant) static boolean
checks the given css value is valid for this class.void
sets as autovoid
sets as inheritvoid
sets as initialsetCssValue
(String cssValue) setFlexBasis
(FlexBasis flexBasis) setFlexGrow
(FlexGrow flexGrow) setFlexShrink
(FlexShrink flexShrink) 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:
-
AUTO
- See Also:
-
-
Constructor Details
-
Flex
public Flex()The value0 1 auto
will be assigned as the cssValue.- Since:
- 1.0.0
-
Flex
- Parameters:
cssValue
- the css value to set.
-
Flex
- Parameters:
flex
- theFlex
object from which the cssValue to set.And,null
will throwNullValueException
-
-
Method Details
-
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<Flex>
- Parameters:
cssValue
- the value should be in the format of1 1 auto
or1 1 15px
.null
is considered as an invalid value and it will throwNullValueException
.- Returns:
- the current object.
- Since:
- 1.0.0
-
isValid
checks the given css value is valid for this class. It does't do a strict validation.- Parameters:
cssValue
-- Returns:
- Since:
- 1.0.0
-
setAsInitial
public void setAsInitial()sets as initial- Since:
- 1.0.0
-
setAsInherit
public void setAsInherit()sets as inherit- Since:
- 1.0.0
-
setAsAuto
public void setAsAuto()sets as auto- Since:
- 1.0.0
-
getFlexBasis
-
getFlexShrink
-
getFlexGrow
-
setFlexGrow
-
setFlexShrink
-
setFlexBasis
-
stateChanged
- Specified by:
stateChanged
in interfaceStateChangeInformer<CssProperty>
-
addPredefinedConstant
- Since:
- 1.0.0
-