qx.core
Class Property

java.lang.Object
  extended by qx.core.Property

public class Property
extends java.lang.Object

Internal class for handling of dynamic properties. Should only be used through the methods provided by Class.

For a complete documentation of properties take a look at http://qooxdoo.org/documentation/developer_manual/properties.

Normal properties

The properties key in the class definition map of qx.Class#define is used to generate the properties.

Valid keys of a property definition are:

NameTypeDescription
checkArray, String, Function The check is used to validate the incoming value of a property. The check can be:
  • a custom check function. The function takes the incoming value as a parameter and must return a boolean value to indicate whether the values is valid.
  • inline check code as a string e.g. "value > 0 && value < 100"
  • a class name e.g. qx.ui.form.Button
  • a name of an interface the value must implement, e.g. qx.application.IAplpication
  • an array of all valid values
  • one of the predefined checks: Boolean, String, Number, Integer, Float, Double, Object, Array, Map, Class, Mixin, Interface, Theme, Error, RegExp, Function, Date, Node, Element, Document, Window, Event
initvar Sets the default/initial value of the property. If no property value is set or the property gets reset, the getter will return the init value.
applyString On change of the property value the method of the specified name will be called. The signature of the method is function(newValue, oldValue).
eventString On change of the property value an event with the given name will be dispached. The event type is ChangeEvent.
themeableBoolean Whether this property can be set using themes.
inheritableBoolean Whether the property value should be inheritable. If the property does not have a user defined or an init value, the property will try to get the value from the parent of the current object.
nullableBoolean Whether null is an allowed value of the property. This is complemental to the check defined using the check key.
refineBoolean Whether the property definition is a refinemnet of a property in one of the super classes of the class. Only the init value can be changed using refine.
transformString On setting of the property value the method of the specified name will be called. The signature of the method is function(value). The parameter value is the value passed to the setter. The function must return the modified or unmodified value. Transformation occurs before the check function, so both may be specified if desired. Alternatively, the transform function may throw an error if the value passed to it is invalid.

Property groups

Property groups are defined in a similar way but support a different set of keys:

NameTypeDescription
groupString[] A list of property names which should be set using the propery group.
modeString If mode is set to "shorthand", the properties can be set using a CSS like shorthand mode.
themeableBoolean Whether this property can be set using themes.


Constructor Summary
Property()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property

public Property()


Copyright © 2008 1&1. All Rights Reserved.