Class: ShapeAttributeGroupHandler

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


ShapeAttributeGroupHandler extends oj.AttributeGroupHandler

Version:
  • 7.1.0
Since:
  • 1.0
Module:
  • ojattributegrouphandler

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojattributegrouphandler'], function(attributegrouphandler) {
 // Application should call API on attributegrouphandler.ShapeAttributeGroupHandler 
})
Typescript Import Format
//To import this class, use the format below.
import {ShapeAttributeGroupHandler} from "ojs/ojattributegrouphandler";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Constructor

new ShapeAttributeGroupHandler(matchRules)

Creates a shape attribute group handler that will generate shape attribute values.
Parameters:
Name Type Argument Description
matchRules {[propName: string]: any} <optional>
A map of key value pairs for categories and the matching attribute value e.g. {"soda" : "square", "water" : "circle", "iced tea" : "triangleUp"}. Attribute values listed in the matchRules object will be reserved only for the matching categories when getAttributeValue is called.

Methods

addMatchRule(category, attributeValue) → {void}

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 any The attribute value to assign for inputs matching the given category e.g. "square" or "circle"
Inherited From:
Returns:
Type
void

getCategoryAssignments() → {Array<{[propName: string]: any}>}

Returns the current list of assigned categories as an array of objects with "category" and "value" keys. Note that match rules are not reflected in category assignments.
Inherited From:
Returns:
The current list of category and value pairings
Type
Array<{[propName: string]: any}>

getValue(category) → {any}

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

getValueRamp() → {Array.<string>}

Returns the array of possible shape values for this attribute group handler.
Returns:
The array of shape values
Type
Array.<string>