|
Re: SelectionActions and MultiPageEditorPart [message #127870 is a reply to message #127815] |
Sat, 17 April 2004 23:09 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
This is just one of several problems you will have when you embed
GraphicalEditor inside multipage editor. It is not supported.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=46207
"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c5p7u6$k4$1@eclipse.org...
> If a GraphicalEditor is embedded within a MultiPageEditorPart the
registered
> SelectionsAction actions do not get updated when the selection changes.
>
> This is due to the fact that the following code exists in
> org.eclipse.gef.ui.parts.GraphicalEditor:
>
> public void selectionChanged(IWorkbenchPart part, ISelection selection) {
> // If not the active editor, ignore selection changed.
> if
>
(this.equals(getSite().getWorkbenchWindow().getActivePage(). getActiveEditor(
> )))
> updateActions(selectionActions);
> }
>
> In this case the active editor returned by ...getActiveEditor() is the
> MultiPageEditor not the the GraphicalEditor, one way to fix it would be to
> change the above method to:
>
> public void selectionChanged(IWorkbenchPart part, ISelection selection)
> {
> // If not the active editor, ignore selection changed.
> IEditorPart editorPart =
> getSite().getWorkbenchWindow().getActivePage().getActiveEdit or();
> if (editorPart instanceof MultiPageEditorPart)
> editorPart = ((MultiPageEditorPart)editorPart).getActiveEditor();
> if (this.equals(editorPart))
> updateActions(getSelectionActions());
> }
>
> Unfortunately MultiPageEditorPart#.getActiveEditor() is not public so this
> fix cannot be done in the GraphicalEditor code but need to be done in the
> subclasses.
>
> Any other suggestion?
>
> Jose M Beleta
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02821 seconds