|Re: Common Navigator Framework - Keeping models in sync with view [message #758545 is a reply to message #758516]
||Wed, 23 November 2011 11:02
| Francis Upton
Registered: July 2009
Location: Oakland, CA
I have a custom project nature whose main artifact is a file in some custom XML format. Additionally I've created an object model representing this artifact. I'm using the CNF to display my model.
Is there a best practice approach to keep the model in sync with the tree view?
I'm thinking of:
File is modified in the file system
Some action modifies the object model.
If you are thinking of having this be part of the Project Explorer, then using the CNF seems to be the right way to go (note I presume you can also use EMF to help you but they are two different things depending on what you are doing). The use of the CNF within the project explorer will allow your model objects to be found and displayed the way you want them in the Project Explorer (which is an implementation of the CNF).
You would configure the CNF to have your Navigator Context Extension be invoked on your project nature and then within that provide the necessary content and label providers to work with your model objects and display them the way you like. This is particularly useful if your model objects have to interact with other things that are displayed in the Project Explorer (like resources or Java objects).
If you can provide more details of what you are interested in, I can try to help further (I feel like my response is kind of vague).
Platform UI Committer for Common Navigator
Powered by FUDForum
. Page generated in 0.01930 seconds