Class: ColorAttributeGroupHandler

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

oj. ColorAttributeGroupHandler extends oj.AttributeGroupHandler

Version:
  • 3.2.0

Constructor

new ColorAttributeGroupHandler(matchRules)

Creates a color attribute group handler that will generate color attribute values.
Parameters:
Name Type Argument Description
matchRules Object <optional>
A map of key value pairs for categories and the matching attribute value e.g. {"soda" : "#336699", "water" : "#CC3300", "iced tea" : "#F7C808"}. Attribute values listed in the matchRules object will be reserved only for the matching categories when getAttributeValue is called. Note that not all colors in the default color ramp will meet minimum contrast requirements for text.
Source:

Methods

<static> createAttrDiv() → {Object}

Creates an element and appends a div for each style class
Source:
Returns:
The element containing divs for each style class
Type
Object

<static> processAttrDiv(attrGpsDiv)

Processes the colors for each div on the given element
Parameters:
Name Type Description
attrGpsDiv Object The element containing divs for each style class
Source:

addMatchRule(category, attributeValue)

Reserves an attribute value for the given category. All match rules should be added before any category assignments are done with the getValue API.
Parameters:
Name Type Description
category string Used for checking inputs to getAttributeValue against when assigning an attribute value
attributeValue string The attribute value to assign for inputs matching the given category e.g. "square" or "circle"
Inherited From:
Source:

getCategoryAssignments() → {Array}

Returns the current map of key value pairs for categories and the assigned attribute values. Note that match rules are not reflected in category assignments.
Inherited From:
Source:
Returns:
The current list of category and value pairing
Type
Array

getValue(category) → {Object}

Assigns the given category an attribute value. Will consistently return the same attribute value for equal categories.
Parameters:
Name Type Description
category Object The category to assign
Inherited From:
Source:
Returns:
The attribute value for the category
Type
Object

getValueRamp() → {Array}

Returns the array of possible color values for this attribute group handler.
Source:
Returns:
The array of color values
Type
Array