Class WebkitFlex

All Implemented Interfaces:
CssProperty, StateChangeInformer<CssProperty>, Serializable, Cloneable

public class WebkitFlex extends AbstractCssProperty<WebkitFlex> implements StateChangeInformer<CssProperty>

 -webkit-flex: -webkit-flex-grow -webkit-flex-shrink -webkit-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 -webkit-flex-grow, -webkit-flex-shrink, and the -webkit-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.webkitFlex="1"

 
 The undefined value for -webkit-flex-grow, -webkit-flex-shrink and -webkit-flex-basis in -webkit-flex property is 1, 1 and 0% respectively.
 
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • WebkitFlex

      public WebkitFlex()
      The value 0 1 auto will be assigned as the cssValue.
      Since:
      1.0.0
    • WebkitFlex

      public WebkitFlex(String cssValue)
      Parameters:
      cssValue - the css value to set.
    • WebkitFlex

      public WebkitFlex(WebkitFlex webkitFlex)
      Parameters:
      webkitFlex - the Flex object from which the cssValue to set.And, null will throw NullValueException
  • Method Details

    • getCssName

      public String getCssName()
      Specified by:
      getCssName in interface CssProperty
      Returns:
      the name portion in style, eg align-content for style align-content: center.
    • getCssValue

      public String getCssValue()
      Specified by:
      getCssValue in interface CssProperty
      Returns:
      the value portion in style, eg center for style align-content: center.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setCssValue

      public WebkitFlex setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<WebkitFlex>
      Parameters:
      cssValue - the value should be in the format of 1 1 auto or 1 1 15px. null is considered as an invalid value and it will throw NullValueException.
      Returns:
      the current object.
      Since:
      1.0.0
    • isValid

      public static boolean isValid(String cssValue)
      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
    • getWebkitFlexBasis

      public WebkitFlexBasis getWebkitFlexBasis()
    • getWebkitFlexShrink

      public WebkitFlexShrink getWebkitFlexShrink()
    • getWebkitFlexGrow

      public WebkitFlexGrow getWebkitFlexGrow()
    • setWebkitFlexGrow

      public WebkitFlex setWebkitFlexGrow(WebkitFlexGrow webkitFlexGrow)
    • setWebkitFlexShrink

      public WebkitFlex setWebkitFlexShrink(WebkitFlexShrink webkitFlexShrink)
    • setWebkitFlexBasis

      public WebkitFlex setWebkitFlexBasis(WebkitFlexBasis webkitFlexBasis)
    • stateChanged

      public void stateChanged(CssProperty stateChangedObject)
      Specified by:
      stateChanged in interface StateChangeInformer<CssProperty>
    • addPredefinedConstant

      protected void addPredefinedConstant(String constant)
      Since:
      1.0.0