Hi there,
I've come along a general question: Is it possible to override the
"enumeration"-check of a property?
To make my vague question a bit more clear, please take a look at the attached
code.
What I like to know is: When the base class (here, "pin") has defined a
property with a number of possible values ('enumeration'), is it possible to
override this list/array in a derived class ("tristatePin")?
I've tried the attached code in playground, but with no joy :-/
The "refine" key in the property definition does not seem to change the
possibility to re-define the 'enumeration'.
Another question arises: Is it good practice to get the list/array of possible
values from such a property by calling
<code>
qx.Class.getPropertyDefinition(tristatePin, "level").check
</code> ?
Or is there a 'cleaner' way of accessing it?
The static class "qx.util.PropertyUtil" looked promising, but no method like
"getCheck" or "getPossibleValues" there ;)
Thanks in advance,
Peter
qx.Class.define("pin", {
extend : qx.core.Object,
type : "abstract",
properties : {
level : {
check : [ "high", "low" ],
init : "low"
}
}
});
qx.Class.define("tristatePin", {
extend : pin,
properties : {
level : {
refine : true,
init : "tristate",
check : [ "high", "low", "tristate" ]
}
}
});
var portA = new tristatePin();
portA.setLevel("low");
portA.setLevel("high");
portA.setLevel("tristate");
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel