public class ColorHandle extends ComplexValueHandle
The application generally does not create color handles directly. It uses the method in other handle to get a color handle like:
A color property may be in the following format:
ColorHandle colorHandle = styleHandle.getColor( );
Use ColorUtil.format(int, int)
and
ColorUtil.format(String, int)
to do the formatting work on a color
value.
ColorUtil
,
ColorPropertyType
memberContext, propDefn
elementHandle
Constructor and Description |
---|
ColorHandle(DesignElementHandle element,
org.eclipse.birt.report.model.metadata.ElementPropertyDefn thePropDefn)
Constructs a color handle for a element property.
|
ColorHandle(DesignElementHandle element,
org.eclipse.birt.report.model.core.MemberRef context)
Deprecated.
|
ColorHandle(DesignElementHandle element,
org.eclipse.birt.report.model.core.StructureContext context)
Constructs a color handle for a member in a structure.
|
Modifier and Type | Method and Description |
---|---|
java.util.List |
getColors()
Returns a list containing all the names of both standard(CSS) colors or
user defined colors.
|
java.util.List |
getCSSColors()
Returns a list containing standard(CSS) color names.
|
java.lang.String |
getCssValue()
Returns a CSS-compatible color value.
|
int |
getRGB()
Returns the color value as an integer RGB value.
|
void |
setRGB(int rgbValue)
Sets a color with a given integer RGB value.
|
getContext, getDefn, getDisplayValue, getPropertyDefn, getRawValue, getStringValue, getValue, isSet, setStringValue, setValue
getReference
getDesign, getElement, getElementHandle, getModule
public ColorHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.StructureContext context)
element
- the design element handlecontext
- the context for the member propertypublic ColorHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.MemberRef context)
element
- the design element handlecontext
- the context for the member propertypublic ColorHandle(DesignElementHandle element, org.eclipse.birt.report.model.metadata.ElementPropertyDefn thePropDefn)
element
- handle to the element that defined the property.thePropDefn
- definition of the color property.public int getRGB()
-1
if color value is not set( value is null
) or the
value
is not a valid internal value for a color.ColorPropertyType.toInteger(Module, Object)
public void setRGB(int rgbValue) throws SemanticException
rgbValue
- rgb color value.SemanticException
- if the rgb value is invalid.public java.lang.String getCssValue()
ColorPropertyType#toCSSCompatibleColor(ReportDesign, Object)
public java.util.List getColors()
public java.util.List getCSSColors()
Copyright © 2008 Actuate Corp. All rights reserved.