AccessEngine :: AEState :: Setting :: EnumSetting :: Class EnumSetting
[hide private]
[frames] | no frames]

Class EnumSetting

source code

object --+        
         |        
   Setting --+    
             |    
 ChoiceSetting --+
                 |
                EnumSetting

Represents a one of many choice setting where text labels describe an arbitrary value. The labels collection is intended to be presented to the user while the values collection is intended to stored values to be used internally only.

Instance Methods [hide private]
 
__init__(self, state, name, default, label, description, persist, choices)
Initializes all instance variables.
source code
 
getLabel(self, choice)
Gets the label for a given choice.
source code
 
addChoice(self, label, choice)
Add a new choice possibility with the given label.
source code
 
update(self, setting)
Updates the labels in addition to everything done in the parent class method.
source code

Inherited from ChoiceSetting: unserialize

Inherited from ChoiceSetting (private): _setValue

Inherited from Setting: addObserver, clearObservers, copy, removeObserver, restore, save, serialize

Inherited from Setting (private): _getValue, _notify

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]

Inherited from ChoiceSetting: value

Instance Variables [hide private]
list labels
Collection of choice labels

Inherited from ChoiceSetting: values

Inherited from Setting: default, description, label, name, persist, state

Inherited from Setting (private): _cached, _observers, _value

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, state, name, default, label, description, persist, choices)
(Constructor)

source code 
Initializes all instance variables.
Overrides: ChoiceSetting.__init__

getLabel(self, choice)

source code 
Gets the label for a given choice.
Parameters:
  • choice (object) - Value for which to retrieve the label
Raises:
  • ValueError - When choice is not a valid value

addChoice(self, label, choice)

source code 
Add a new choice possibility with the given label.
Parameters:
  • label (string) - Human readable name
  • choice (object) - New option
Overrides: ChoiceSetting.addChoice

update(self, setting)

source code 
Updates the labels in addition to everything done in the parent class method.
Parameters:
  • setting (EnumSetting) - Setting of the same kind as this one
Overrides: ChoiceSetting.update