Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Modelelement with no corresponding EditPart
Modelelement with no corresponding EditPart [message #529856] Tue, 27 April 2010 13:25 Go to next message
Patrick Schmitt is currently offline Patrick SchmittFriend
Messages: 87
Registered: July 2009
Member
Hello guys,
I'm currently working on a customised view for my EMF Models.
In the EditpartFactory I create EditParts for the model elements. But now I have some Model elements dont neew to show in the editor view, so I dont need editparts for them. Whats the proper solution for that? E.g. returning null in the EditPartFoactory throws an exception.
Kind regards
Patrick
Re: Modelelement with no corresponding EditPart [message #529907 is a reply to message #529856] Tue, 27 April 2010 15:42 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 27/04/2010 14:25, Patrick Schmitt wrote:
> Hello guys,
> I'm currently working on a customised view for my EMF Models. In the
> EditpartFactory I create EditParts for the model elements. But now I
> have some Model elements dont neew to show in the editor view, so I dont
> need editparts for them. Whats the proper solution for that? E.g.
> returning null in the EditPartFoactory throws an exception.
> Kind regards
> Patrick

Sounds like you need to filter out those elements from the model.
Re: Modelelement with no corresponding EditPart [message #530085 is a reply to message #529856] Wed, 28 April 2010 12:44 Go to previous messageGo to next message
Patrick Schmitt is currently offline Patrick SchmittFriend
Messages: 87
Registered: July 2009
Member
Yeah, but where to filter out?
Re: Modelelement with no corresponding EditPart [message #530145 is a reply to message #530085] Wed, 28 April 2010 15:36 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 28/04/2010 13:44, Patrick Schmitt wrote:
> Yeah, but where to filter out?

The model that you present to your GraphicalViewer will be the model
used by your EditPartFactory. So for every child in the model you must
return an EditPart. Therefore, I would create a diagram model for the
viewer based on the domain model.
Re: Modelelement with no corresponding EditPart [message #530261 is a reply to message #530085] Thu, 29 April 2010 06:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: modica.cs.tu-berlin.deNOSPAM

Am 28.04.2010 14:44, schrieb Patrick Schmitt:
> Yeah, but where to filter out?
Just don't include the unwanted model objects in the list you return in
the getModelChildren(). For these the editpart tries to create children
editparts with the editpartfatory.
Re: Modelelement with no corresponding EditPart [message #530304 is a reply to message #530261] Thu, 29 April 2010 09:43 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 29/04/2010 07:54, Tony Modica wrote:
> Am 28.04.2010 14:44, schrieb Patrick Schmitt:
>> Yeah, but where to filter out?
> Just don't include the unwanted model objects in the list you return in
> the getModelChildren(). For these the editpart tries to create children
> editparts with the editpartfatory.

Exactly.
Re: Modelelement with no corresponding EditPart [message #530443 is a reply to message #530304] Thu, 29 April 2010 16:08 Go to previous message
Patrick Schmitt is currently offline Patrick SchmittFriend
Messages: 87
Registered: July 2009
Member
Thanks for your solutions, sounds good to me!
Previous Topic:[zest] Arrows/edges between nested nodes
Next Topic:Trying to place a SashForm in a ContentOutlinePage
Goto Forum:
  


Current Time: Thu Dec 18 12:33:28 GMT 2014

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

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