Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Editor reference from a model element
Editor reference from a model element [message #822545] Fri, 16 March 2012 18:19 Go to next message
Roded Bahat is currently offline Roded Bahat
Messages: 152
Registered: August 2011
Senior Member
Hi,
In the cases when there is an editor, is it possible (and does it make sense) to find a reference to it from a model element?
Thanks,
Roded
Re: Editor reference from a model element [message #822933 is a reply to message #822545] Sat, 17 March 2012 10:10 Go to previous messageGo to next message
Greg Amerson is currently offline Greg Amerson
Messages: 116
Registered: March 2010
Senior Member
Hey Roded,

If your model element is based by an xml file you can try this:
ITextEditor textEditor = modelElement.adapt(ITextEditor.class);


That should work with recent builds of 0.5.x
Re: Editor reference from a model element [message #822961 is a reply to message #822933] Sat, 17 March 2012 11:09 Go to previous messageGo to next message
Roded Bahat is currently offline Roded Bahat
Messages: 152
Registered: August 2011
Senior Member
Ah, ok.
I was looking for
element.adapt(SapphireEditor.class);

Was that adapter available before 0.5.0?
Thanks!
Re: Editor reference from a model element [message #824578 is a reply to message #822961] Mon, 19 March 2012 16:54 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 940
Registered: July 2009
Senior Member
No. The specific element.adapt(SapphireEditor.class) ability was added for 0.5 release.
Re: Editor reference from a model element [message #825379 is a reply to message #824578] Tue, 20 March 2012 15:37 Go to previous message
Roded Bahat is currently offline Roded Bahat
Messages: 152
Registered: August 2011
Senior Member
Quite useful.
Thanks
Previous Topic:Using include params in parts' labels
Next Topic:Group UI element suggestions
Goto Forum:
  


Current Time: Sun Aug 31 04:31:22 EDT 2014

Powered by FUDForum. Page generated in 0.02800 seconds