GEF OutlineView

139 Views Asked by At

i built a GEF-Editor (like the OPM-Editor) and i need your help with the OutlineView, because my try doesn’t work. I built the ContentOutlinePage like the GEF-example in the ShapeEditor.

I return my new OutlinePage in getAdapter, when the type is IContentOutlinePage.class. Then i call createControl and setContent(model), there is the error. I cannot set the addPropertyChangeListener, my model isn't designed for this Listener

The solution in the ShapeEditor seems to be very complicated.

Is there not a simple solution for the ContenToutlinePage or have somebody a solution with this OPM Editor?

Thanks for our help

1

There are 1 best solutions below

0
On

See ShapesEditor#createControl(Composite parent) line 355: getViewer().setEditPartFactory(new ShapesTreeEditPartFactory());

This is probably what you're missing the right implementation for. You'd have to implement your own EditPart factory to construct your own tree edit parts (subclass GEF's AbstractTreeEditPart). ShapeTreeEditPart #activate() and #deactivate() methods add/remove property change listeners. These listeners are to react to model changes (name label has changed for example) so you'd register your own model change listeners there or leave the method empty if you don't care of the changes to the model.