Class IdentValue

  • All Implemented Interfaces:
    FSDerivedValue

    public class IdentValue
    extends Object
    implements FSDerivedValue
    An IdentValue represents a string that you can assign to a CSS property, where the string is one of several enumerated values. For example, "whitespace" can take the values "nowrap", "pre" and "normal". There is a static instance for all idents in the CSS 2 spec, which you can retrieve using the getByIdentString(String) method. The instance doesn't have any behavior: it's just a marker so that you can retrieve an ident from a DerivedValue or CalculatedStyle, then compare to the instance here. For example:
     CalculatedStyle style = ...getstyle from somewhere
     IdentValue whitespace = style.getIdent(CSSName.WHITESPACE);
     if ( whitespace == IdentValue.NORMAL ) {
          // perform normal spacing
     } else if ( whitespace == IdentValue.NOWRAP ) {
          // space with no wrapping
     } else if ( whitespace == IdentValue.PRE ) {
          // preserve spacing
     }
     
    All static instances are instantiated automatically, and are Singletons, so you can compare using a simple Object comparison using == .
    Author:
    Patrick Wright