Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Sharing Model(Sharing Model with Navigator Content Nodes)
Sharing Model [message #895072] Wed, 11 July 2012 15:25 Go to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 213
Registered: July 2009
Senior Member
Hello,

First of all thanks for the wonderful Sapphire 0.5.1 relases. Hats of for you all hard work.


Back to business, I am developing Navigator for my project, I have developed a SapphireXML editor, my navigator will show the nodes of the xml file that uses Sapphire XML editor as default editor. The user will be able to open the XML file form the Navigator nodes --> Trigger Sapphire XML Editor opening.

Now the problem is that I am not able to trigger selections from my Navigatore nodes and Sapphire MasterDetailContentNodes, after debugging I found out that there two different object tree is available 1. created by sapphire 2. another one i loaded when in my navigator tree, so naturally I cant fire MasterDetailContentNode.findByModelElement(myNavigatorSelectedModelElement), i resorted to manual comparison caseting objects and then doing by ID property.

Is there any better way to do the slection synch ? somethign like how OutlineViewer and SapphireEditor Nodes are synched ..

~Kamesh
Re: Sharing Model [message #895089 is a reply to message #895072] Wed, 11 July 2012 16:31 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
The difference between what you are doing and the outline view is that the outline view has exact same lifecycle as the editor. No complicated logic is necessary for it to re-use the editor's model instance. In your navigator usecase, you'd have to write some code that listens on editor open/close events in the workbench and alternates between editor's model instance and its own model instance based on the file on disk. I haven't played around with workbenche's editor lifecycle API, but I believe this should be possible to implement.

One issue with your current approach is that the model in the navigator will not see unsaved changes in the editor, so the navigator view will get out of sync with the editor.

- Konstantin
Re: Sharing Model [message #895095 is a reply to message #895089] Wed, 11 July 2012 16:41 Go to previous message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 213
Registered: July 2009
Senior Member
Yeah I felt so that out of sync will happen .. let me investigate the options and keep you posted. Thanks for the quick reply as usual Smile
Previous Topic:How to run the examples?
Next Topic:Sapphire on Git
Goto Forum:
  


Current Time: Wed Apr 24 23:36:41 GMT 2024

Powered by FUDForum. Page generated in 0.02772 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top