Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] Wrapping GraphicalEditor inside another EditorPart


In GEF 2.1.2, we fixed a bug which required us to check whether an editor was currently active when it received selection notification from the SelectionService.  The do this is to call getSite().getPage().getActiveEditor() == this.

If you are composing/wrapping GraphicalEditor or GraphicalEditorWithPalette inside another EditorPart (such as MultiPageEditorPart), then GraphicalEditor will never think that it is active, and none of your SelectionActions will work.

If you are (mis)using GraphicalEditor in this way, the hack to avoid this problem is to subclass it and override selectionChanged(...) to call:
updateActions(getSelectionActions());
whenever your wrappered editor is active.

We have made an effort to put as little as possible in GraphicalEditor in hopes that people would not feel obligated to reuse it.  We have done this intentionally because a workbench part is not a convenient unit for composition.

Randy Hudson

Back to the top