Ok, I’ve got a class I’d like to release, but am stuck trying to think of a good name for it!
Basically it’s a tree node object, sort of an “XmlElement on steroids”… It contains a set of named properties (these are implemented as ‘var’ objects so they can store numbers natively rather than having to convert them to strings like xml does). Like xml, it can contain any number of sub-nodes. But its killer feature is that every operation you do to the tree (add/remove nodes, change/remove properties) is undoable. It also lets you attach listeners to any node to find out when properties or the tree structure changes. And because it’s similar in structure to XML, it can be converted to/from XML for easy storage in a readable format.
When I was writing the original Jucer the thing that was an absolute PITA was that every time I added any option that changed an item’s properties, I had to write an UndoableAction class to implement it - this took ages and made the code really bloated and unreadable. But using one of these trees, it’d handle all of that for you, and it’d be a breeze to build powerful editors for complex structures.
So it’s a cool class, but what should I call it!? VarTree, SmartNode, VarNode, Node, SmartTree, PowerTree… ? All a bit naff… Ideas please!