jgindin
05-02-2008, 04:02 PM
I'm using 0.5.2, but from a quick glance at the beta 2 source, these issues still exist...
Basically, the way the class is structured makes it look extensible, but in reality it's not :(
Specifically in the TreeTable class:
* createRootItme() is protected, which is great! However, it creates a RootTreeTableItem, which is package local. This means that in order to tweak the root item, I have to copy the complete implementation into my own class.
* onRender() has a hard-coded cast of "root" to RootTreeTableItem. So, I can create my own root item, but since I cannot extend RootTreeTableItem, I get a ClassCastException here.I readily admit that I don't know if there are unintended consequences to what I'm going to propose, so please...if there are, I'm ready to be educated!
I'd like to recommend:
* RootTreeTableItem become an interface, which you are free to implement as you see fit, and I can too :).
* Rename the existing RootTreeTableItem class (obviously :) ) and make it public.
* Change the TreeTable::onRender root member to be of type RootTreeTableItem (the new interface).Now, there are a few other issues that prevent extending TreeTable... Specifically, there are a number of members which are private, rather than protected. This could be OK, if (for example) there are overridable methods for creating them and accessors for accessing them.
Thanks for your great work on this MUCH needed toolkit!
jay
Basically, the way the class is structured makes it look extensible, but in reality it's not :(
Specifically in the TreeTable class:
* createRootItme() is protected, which is great! However, it creates a RootTreeTableItem, which is package local. This means that in order to tweak the root item, I have to copy the complete implementation into my own class.
* onRender() has a hard-coded cast of "root" to RootTreeTableItem. So, I can create my own root item, but since I cannot extend RootTreeTableItem, I get a ClassCastException here.I readily admit that I don't know if there are unintended consequences to what I'm going to propose, so please...if there are, I'm ready to be educated!
I'd like to recommend:
* RootTreeTableItem become an interface, which you are free to implement as you see fit, and I can too :).
* Rename the existing RootTreeTableItem class (obviously :) ) and make it public.
* Change the TreeTable::onRender root member to be of type RootTreeTableItem (the new interface).Now, there are a few other issues that prevent extending TreeTable... Specifically, there are a number of members which are private, rather than protected. This could be OK, if (for example) there are overridable methods for creating them and accessors for accessing them.
Thanks for your great work on this MUCH needed toolkit!
jay