|Re: An EMF model based on a super class [message #658109 is a reply to message #658086]
||Sun, 06 March 2011 16:01
| Ed Merks
Registered: July 2009
Herb Miller wrote:
> I can tell from your reply that there is a way to do it, I just do not
> understand it yet. Let me be more specific.
> I am working through the new RCP book. Section 5.3 has a chat model.
> The model in the book is simple, so I implented it in code. Then I
> thought, why not use EMF to implement this model.
> Then I looked in the code for that chapter, and one of the parent
> classes of the model actually inherits from an existing Eclipse object
> named PlatformObject. I don't really have another model to add into
> the editor.
That's a little different question. EMF's implementation classes must
extends a subclass of BasicEObjectImpl (in order to implementation
EObject and InternalEObject). So they can't extend some other class
like PlatformObject. YOu can however define an EClass to wrap an
existing interface, like IAdaptable, but setting the instance type name
of the fully qualified name of the interface and marking it as interface
true. You can then use that in the eSuperTypes of any other EClass and
implement the methods needed in the generated implementation classes.
(You could even define the EOperations of the wrapped interface in the
wrapper EClass so that stubs are generated.)
> So, did you answer my question and I just missed it, or is my question
> more clear now?
More clear now.
> Herb Miller
Powered by FUDForum
. Page generated in 0.01616 seconds