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

## org.eclipse.birt.report.model.api
Class FontHandle

    java.lang.Object
      org.eclipse.birt.report.model.api.ElementDetailHandle
          org.eclipse.birt.report.model.api.ValueHandle
              org.eclipse.birt.report.model.api.ComplexValueHandle
                  org.eclipse.birt.report.model.api.FontHandle

    public class FontHandle

extends ComplexValueHandle

Simplifies working with the font family property. The font family can be for either a element property or a structure member.

Values of a font family can be a list of font names, a string, a CSS (pre-defined) string. The CSS values are defined in `DesignChoiceConstants`. For example, the font family allows values in these formats:

- "serif, recursive, Times New Roman, Arial" ( a list of font names separated by commas )
- Song ( a string )
- cursive, sans-serif ( a CSS constant )

CSS has the following predefined font names:

- serif
- sans-serif
- cursive
- fantasy
- monospace

Please note that for a list of font names, blanks are allowed between two neighboring font names.

The application generally does not create font handles directly. It uses the method in `DesignElementHandle` to get a color handle like:

     DesignElementHandle elementHandle = element.handle( );FontHandle fontHandle = elementHandle.getFontProperty( Style.FONT_FAMILY_PROP );

Field Summary

Fields inherited from class org.eclipse.birt.report.model.api.ComplexValueHandle
`memberRef, propDefn`

Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
`elementHandle`

Constructor Summary
`FontHandle(DesignElementHandle handle)` Constructs a font family handle for an element property.
`FontHandle(DesignElementHandle handle, org.eclipse.birt.report.model.core.MemberRef memberRef)` Constructs a font family handle for a structure member.

Method Summary
`IChoice[]` | `getCSSFontFamilies()` Returns an array containing CSS (pre-defined) font names.
`java.lang.String[]` | `getFontFamilies()` Returns an array containing all of font names in the correct order.

Methods inherited from class org.eclipse.birt.report.model.api.ComplexValueHandle
`getDefn, getDisplayValue, getPropertyDefn, getReference, getStringValue, getValue, isSet, setStringValue, setValue`

Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
`getDesign, getElement, getElementHandle, getModule`

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

Constructor Detail

### FontHandle

    public FontHandle(DesignElementHandle handle)

  Constructs a font family handle for an element property.

  Parameters:
    `handle` - the element handle

### FontHandle

    public FontHandle(DesignElementHandle handle,
                      org.eclipse.birt.report.model.core.MemberRef memberRef)

  Constructs a font family handle for a structure member.

  Parameters:
    `handle` - the element handle
    `memberRef` - the reference to the structure member.

Method Detail

### getFontFamilies

    public java.lang.String[] getFontFamilies()

  Returns an array containing all of font names in the correct order. Names are separated by commas in the property value, and are slit into an array by this method.

  Returns:
    an array containing font names or `null` if the value of the font family property is not set.

### getCSSFontFamilies

    public IChoice[] getCSSFontFamilies()

  Returns an array containing CSS (pre-defined) font names. Each item in the array is a CSS constant defined in the `DesignChoiceConstants`.

  Returns:
    an array containing CSS (pre-defined) font names.

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

Copyright © 2008 Actuate Corp. All rights reserved.