This is a comparison between the old and new properties. It shows the differences between the two implementations. qooxdoo 0.7 removes some declarations that were too specific and adds some missing features.
| qooxdoo 0.6.x | qooxdoo 0.7 |
Outside the class definition:qx.OO.addProperty({
name : "test"
});
| Part of the class definition:properties : {
test: {}
}
|
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
type : "string"
});
| test: {
check : "String"
}
|
qooxdoo 0.6 only supports the types available through the typeof operator in JavaScript: string, number, object, function, boolean.
qooxdoo 0.7 supports much more. The names of types are identical to the ones used in the API viewer:
Boolean, String, Number, Integer, Float, Double
Object, Array, Map
Class, Mixin, Interface, Theme
Error, RegExp, Function, Date, Node, Element, Document, Window, Event
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
instance : "qx.core.Object"
});
| test: {
check : "qx.core.Object"
}
|
Explicit check, if property value is a direct instance of a class given by its classname. Normally less useful than instance checks, where instances of all subclasses also match.
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
classname: "qx.core.Object"
});
| Not supported. If this is needed, one could use an custom check function as listed below. |
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
possibleValues : [ "red", "blue", "yellow" ]
});
| Given as an array of allowed values:test: {
check : [ "red", "blue", "yellow" ]
}
|
| qooxdoo 0.6.x | qooxdoo 0.7 |
By naming convention. The name of the corresponding instance method needed to be _check followed by the capitalized property name.qx.OO.addProperty({
name : "test"
});
qx.Proto._checkTest = function(value) {
// do check...,
}
| The custom check method can be placed right into the property declaration:test: {
check : function(value) {
// do check...,
}
}
|
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
allowNull : true
});
| By default properties are not nullable.test: {
nullable : true
}
|
Support for aliases like isProperty for getProperty.
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "checked",
getAlias : "isChecked"
});
| not supported anymore |
Support for widget specific queue handling.
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
addToQueue: true
});
| not supported anymore |
Support for widget specific unit detection.
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "test",
unitDetection : "pixelPercent"
});
| not supported anymore |
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.changeProperty(
{
name : "test",
defaultValue : "world",
type : "string",
[...]
});
| test: {
refine : true,
init : "world"
}
|
The new properties do not allow other than init value modifications.
| qooxdoo 0.6.x | qooxdoo 0.7 |
| Not possible. It was always "change" + name of the property | test: {
event : "testChanged"
}
|
| qooxdoo 0.6.x | qooxdoo 0.7 |
| By naming convention. The name of the corresponding instance method was "_modify" followed by the capitalized property name. | Explicit. A leading _apply is a preferred convention.test: {
apply: "_applyTest"
}
|
| qooxdoo 0.6.x | qooxdoo 0.7 |
qx.OO.addProperty(
{
name : "width",
impl : "dimension"
});
qx.OO.addProperty(
{
name : "height",
impl : "dimension"
});
| width: {
apply : "applyDimension"
},
height: {
apply : "applyDimension"
}
|
| qooxdoo 0.6.x | qooxdoo 0.7 |
Not supported. User value overwrites init value. Reset call afterwards changes value to null. | Supported. Init value is recoverable using reset method. |
| qooxdoo 0.6.x | qooxdoo 0.7 |
Not supported. Appearance value may overwrite user value. Especially affected were the state areas of appearance themes. | Supported. A themeable value is stored separately and has a lower priority than the user value. |
| qooxdoo 0.6.x | qooxdoo 0.7 |
| Not supported. Manual work to apply property stuff the same way the modifier would do it. | Supported. It is possible to initialize a property in the class constructor. |
| qooxdoo 0.6.x | qooxdoo 0.7 |
| Not supported. Manual work is needed to copy values around. | Supported. It is possible to enable inheritance on property level. Supports overriding, too. |