Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.webcontainer.propertyrender
Class ExtentRender

    java.lang.Object
      nextapp.echo2.webcontainer.propertyrender.ExtentRender

    public class ExtentRender

extends java.lang.Object

Utility class for rendering `nextapp.echo2.app.Extent` properties to CSS.

Method Summary
`static boolean` | `isZeroLength(Extent extent)` Determines if the given `Extent` is of zero length.
`static java.lang.String` | `renderCssAttributePixelValue(Extent extent)` Attempts to render a given `Extent` to a pixel CSS attribute value.
`static java.lang.String` | `renderCssAttributeValue(Extent extent)` Renders an `Extent` property value to a CSS dimensioned attribute value.
`static java.lang.String` | `renderCssAttributeValueHalf(Extent extent)` Renders 1/2 the distance specified by an `Extent` property value to a CSS dimensioned attribute.
`static void` | `renderToStyle(CssStyle cssStyle, java.lang.String cssAttribute, Extent extent)` Renders an `Extent` property to the given CSS style.
`static java.lang.String` | `renderUnits(int units)` Renders the given `Extent` units constant into a CSS unit suffix.
`static Extent` | `toExtent(java.lang.String extentString)` Creates an `Extent` from the given CSS dimensioned attribute value.
`static int` | `toPixels(Extent extent, int defaultPixels)` Attempts to convert a given `Extent` to a pixel value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### isZeroLength

    public static boolean isZeroLength(Extent extent)

  Determines if the given `Extent` is of zero length. This method interprets null `Extent`s to be of zero length.

  Parameters:
    `extent` - the extent
  Returns:
    true if the extent is of zero length

### renderCssAttributePixelValue

    public static final java.lang.String renderCssAttributePixelValue(Extent extent)

  Attempts to render a given `Extent` to a pixel CSS attribute value. Returns null if the the extent can not be represented by a pixel value.

  Parameters:
    `extent` - the property value
  Returns:
    the CSS attribute value

### renderCssAttributeValue

    public static final java.lang.String renderCssAttributeValue(Extent extent)

  Renders an `Extent` property value to a CSS dimensioned attribute value.

  Parameters:
    `extent` - the property value
  Returns:
    the CSS attribute value

### renderCssAttributeValueHalf

    public static final java.lang.String renderCssAttributeValueHalf(Extent extent)

  Renders 1/2 the distance specified by an `Extent` property value to a CSS dimensioned attribute. For example, an extent that would normally render as "3px" would be rendered as "1.5px" by this method.

  Parameters:
    `extent` - the property value
  Returns:
    the CSS attribute value

### renderToStyle

    public static final void renderToStyle(CssStyle cssStyle,
                                           java.lang.String cssAttribute,
                                           Extent extent)

  Renders an `Extent` property to the given CSS style. Null property values are ignored.

  Parameters:
    `cssStyle` - the target `CssStyle`
    `cssAttribute` - the CSS attribute name, e.g., "width" or "height".
    `extent` - the property value

### renderUnits

    public static final java.lang.String renderUnits(int units)

  Renders the given `Extent` units constant into a CSS unit suffix.

  Parameters:
    `units` - the `Extent` units constant value
  Returns:
    the CSS unit suffix

### toExtent

    public static final Extent toExtent(java.lang.String extentString)

  Creates an `Extent` from the given CSS dimensioned attribute value.

  Parameters:
    `extentString` - the CSS dimensioned attribute value
  Returns:
    an equivalent `Extent`, or null if the input is not valid.

### toPixels

    public static final int toPixels(Extent extent,
                                     int defaultPixels)

  Attempts to convert a given `Extent` to a pixel value. Returns `defaultPixels` if the conversion is not possible.

  Parameters:
    `extent` - the `Extent` to convert
    `defaultPixels` - the pixel value to return if conversion is impossible.
  Returns:
    the value of the `extent` in pixels

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD