Documentation
Reference
2.1.56 (current version)
collection
interactivityModel
Interfaces

IOptionManager

Extends IChild, IEventEmitter, IFreezable.

Interface for the options manager. The options manager lets you set option values, build an options inheritance hierarchy, and resolve option values in the context of the existing inheritance hierarchy.

Constructor | Fields | Events | Methods

Constructor

IOptionManager()

Fields

NameTypeDescription
eventsIEventManager

Event manager for the object.

Inherited from IFreezable.

Events

NameDescription
change

Changes to the option.

parentchange

The parent object reference changed.

Data fields:

  • oldParent - Old parent.
  • newParent - New parent.

Inherited from IChild.

Methods

NameReturnsDescription
freeze()

IFreezable

Switches the object to "frozen" mode.

Inherited from IFreezable.

get(key[, defaultValue])

Returns the value of the specified option in the context of the existing options inheritance hierarchy. When this method is called, first values are searched for in the current options manager, then, if the value is not defined, the search continues in the hierarchy of parent managers.

getAll()

Object

Returns a reference to the internal hash that stores option values.

getName()

String

Returns name of the options manager.

getNative(key)

Object

Returns the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager.

getParent()

IOptionManager|null

Returns parent options manager.

isFrozen()

Boolean

Returns true if the object is in "frozen" mode, otherwise false.

Inherited from IFreezable.

resolve(key[, name])

Object

Method intended to be called by child options managers.

setName(name)

Sets the name of the options manager.

setParent(parent)

IChild

Sets the parent options manager.

unfreeze()

IFreezable

Switches the object to active mode.

Inherited from IFreezable.

Events details

change

Changes to the option.

Methods details

get

{} get(key[, defaultValue])

Returns the value of the specified option in the context of the existing options inheritance hierarchy. When this method is called, first values are searched for in the current options manager, then, if the value is not defined, the search continues in the hierarchy of parent managers.

Parameters:

ParameterDefault valueDescription
key*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

Name of the option.

defaultValue

Type: Object

Default value.

* Mandatory parameter/option.

getAll

{Object} getAll()

Returns a reference to the internal hash that stores option values.

getName

{String} getName()

Returns name of the options manager.

getNative

{Object} getNative(key)

Returns the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager.

Parameters:

ParameterDefault valueDescription
key*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

Name of the option.

* Mandatory parameter/option.

getParent

{IOptionManager|null} getParent()

Returns parent options manager.

resolve

{Object} resolve(key[, name])

Method intended to be called by child options managers.

Returns the option's value in the parent context.

Parameters:

ParameterDefault valueDescription
key*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

Name of the option.

name

Type: String

Name of the child options manager.

* Mandatory parameter/option.

setName

{} setName(name)

Sets the name of the options manager.

Parameters:

ParameterDefault valueDescription
name*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

Name of the options manager.

* Mandatory parameter/option.

setParent

{IChild} setParent(parent)

Sets the parent options manager.

Returns self-reference.

Parameters:

ParameterDefault valueDescription
parent*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: IOptionManager|null

Parent options manager.

* Mandatory parameter/option.