Attention anyone using the TreeVirtual widget... I checked in a number of changes to qx.ui.treevirtual.* today. The goal is to move towards allowing an easier method of manipulating a tree. Everything that could be done previous via the main TreeVirtual class and its helper classes can still be done, albeit a bit differently (and hopefully more easily!). To summarize the changes:
- More intelligence has been added to the SimpleTreeDataModel.setState() method so that it becomes the only method necessary for modifying the various states of a node. Methods that were previously required to "preprocess" what got to setState() no longer need this intelligence. In particular, the intelligence in the method TreeVirtual.toggleOpened() (which ultimately called SimpleTreeDataModel.setState() has been moved directly into SimpleTreeDataModel.setState(). - A new mixin, MNode,has been added to the qx.ui.treevirtual hierarchy. This mixin provides numerous methods for manipulating a node. Each of these methods takes a nodeReference parameter, where a nodeReference can be either a nodeId (as returned by addLeaf() or addBranch()) or a node object itself. This makes these methods easily callable in many different situations. - A new mixin, MFamily,has been added to the qx.ui.treevirtual hierarchy. This mixin provides a number of methods for enumerating children and siblings. - Some previously available methods in TreeVirtual have been deprecated (and now throw an error if used) in favor of methods in the mixins. - All of the TreeVirtual_*.html examples have been updated to use the MNode mixin and call its methods. (Whomever it was I added the original child and sibling enumeration methods for: please confirm that the MFamily methods are working correctly as their replacement.) With these changes, it should be possible to do nearly everything that the typical application needs without having to delve into internals nor learn about any interfaces other than those provided by TreeVirtual itself, the mixins, and SimpleTreeDataModel. This means that all operations are either on the tree itself (TreeVirtual and the two mixins), or on the data model. I am considering adding data model manipulation methods as another mixin, to further simplify usage; then all manipulation of the tree for typical usage would be via the instantiated TreeVirtual object once the mixins were included. I look forward to comments on successes, problems, likes and dislikes about the modified TreeVirtual! Cheers, Derrell ps. I am also considering creating similar convenience methods for Table, but would like to hear from those who have painfully worked their way through the Table helper classes (Jim Hunter, that includes you! :-) with suggestions on what actions could really use convenience methods. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
