
Originally Posted by
wysota
But it doesn't imply you should keep the state in the data model.
I don't keep the current state, but only the default state in the XML -- how should the tree item be displayed when loaded.
I don't know what the xml describes - does it describe items that are to be visualized using a tree view?
Yes. Simple XML example:
<browserTree name="MyTree">
<treeNode name="RootNode" expanded="1">
<treeNode name="ChildNode" expanded="1" />
</treeNode>
</browserTree>
<browserTree name="MyTree">
<treeNode name="RootNode" expanded="1">
<treeNode name="ChildNode" expanded="1" />
</treeNode>
</browserTree>
To copy to clipboard, switch view to plain text mode
Keep in mind that the model is only an interface to *any* data, nothing more, nothing less. If you have an XML file - don't read/parse/create structures. Just make your model operate on the XML directly. Otherwise you're ending up with an unnecessary redundancy and lag.
Well the way the app is done right now, the parser (SaX) reads the XML file and creates the appropriate objects on the fly (for the GUI, those objects only describes the elements of the GUI to be generated. The view currently operate on the created objects.
Bookmarks