public class CustomColorHandle extends StructureHandle
Every custom color has three parts: a display name, an internal name and a color value.
The color value can contain any of the valid color representations:
If the color value is in one of the format, then it is meaningful to retrieve it as integer RGB value. Otherwise the color value is treat just as what the user has entered, and can not be converted into an RGB value.
Use ColorUtil.format(int, int)
and
ColorUtil.format(String, int)
to do the formatting work on a color
value.
ColorUtil
structContext
elementHandle
Constructor and Description |
---|
CustomColorHandle(SimpleValueHandle valueHandle,
int index)
Constructs the handle of custom color.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getColor()
Returns the color value as what the user has input.
|
java.lang.String |
getDisplayName()
Returns the internal display name.
|
java.lang.String |
getDisplayNameID()
Returns the resource key for display name.
|
java.lang.String |
getName()
Returns the custom color name.
|
java.lang.String |
getQualifiedName()
Returns the qualified name of this element.
|
int |
getRGB()
Returns the color value as an integer RGB value.
|
void |
setColor(java.lang.String colorValue)
Sets the color value.
|
void |
setDisplayName(java.lang.String displayName)
Sets the display name.
|
void |
setDisplayNameID(java.lang.String displayNameID)
Sets the resource key for display name.
|
void |
setName(java.lang.String name)
Sets the custom color name.
|
drop, getContext, getDefn, getExpressionProperty, getExternalizedValue, getExternalizedValue, getIntProperty, getMember, getProperty, getPropertyDefn, getStringProperty, getStructure, isDesignTime, isLocal, iterator, setDesignTime, setExpressionProperty, setProperty, setPropertySilently
getReference
getDesign, getElement, getElementHandle, getModule
public CustomColorHandle(SimpleValueHandle valueHandle, int index)
valueHandle
- the value handle for custom color list of one propertyindex
- the position of this custom color in the listpublic java.lang.String getDisplayName()
public void setDisplayName(java.lang.String displayName)
displayName
- the display name to setpublic java.lang.String getDisplayNameID()
public void setDisplayNameID(java.lang.String displayNameID)
displayNameID
- the resource key for display namepublic java.lang.String getName()
public java.lang.String getColor()
public void setColor(java.lang.String colorValue) throws SemanticException
colorValue
- the color value to be set.SemanticException
- value required exceptionpublic void setName(java.lang.String name) throws SemanticException
name
- the custom color name to setSemanticException
- value required exceptionpublic int getRGB()
-1
indicates that the value is
not valid.
The color value can contain any of the valid color representations:
-1
if the color value is not valid or the color value is
null
.public java.lang.String getQualifiedName()
Copyright © 2014 OpenText Corp. All rights reserved.