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
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.
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.
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.
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.