Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating a generic editor for an abstract class
Creating a generic editor for an abstract class [message #141053] Tue, 03 July 2007 14:24 Go to next message
Eclipse UserFriend
Originally posted by: Stefan.Warwas.freenet.de

Hi,

I want to avoid creating the same editor for all implementations of an
abstract class. Here is an example:


- A contains B
- B is abstract
- B contains B
- B1, B2, B3, ... implement B


I have created an editor for "A" where I can place instances of B1, B2,
B3, ... Now I want to create a generic editor for "B" where I can place
again instances of B1, B2, B3, ... The editor for "B" should open
whenever somebody double-clicks on an instance of B1, B2, B3, ...
(recursively). I realized that it is not possible to create a generic
editor for "B", because GMF complains that "B" is abstract.

I want to avoid creating the same editor for B1, B2, etc... Has somebody
an idea how I can solve this problem in an elegant way?

Thanks!


Stefan
Re: Creating a generic editor for an abstract class [message #141278 is a reply to message #141053] Wed, 04 July 2007 10:36 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Stefan,

Try generating the code for B (ignoring walidation errors) and then correct
it if necessary. I think, the reason why GMF complains about abstractness
of B is: there is a place in the code where GMF is trying to create diagram
for B and create underlying B instance. AFAIU in your situation this action
will never be called, so you can gust remove this part of the generated code.

-----------------
Alex Shatalin
Previous Topic:Scope of EditPart
Next Topic:Label of EEnum
Goto Forum:
  


Current Time: Thu Sep 19 00:47:57 GMT 2024

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

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

Back to the top