Community
Participate
Working Groups
MultiPageSelectionProvider currently assumes that only nested editors can provide selections. This is unfortunate for FormEditor, where pages contributed as controls can also be selection source. The proposed fix is to check the active nested editor first. If the result is null, go to the multi-page editor site itself and see if it has a selection provider. For example: public ISelection getSelection() { IEditorPart activeEditor = multiPageEditor.getActiveEditor(); if (activeEditor != null) { ISelectionProvider selectionProvider = activeEditor.getSite ().getSelectionProvider(); if (selectionProvider != null) return selectionProvider.getSelection(); } return null; } should be rewritten to be public ISelection getSelection() { IEditorPart activeEditor = multiPageEditor.getActiveEditor(); if (activeEditor != null) { ISelectionProvider selectionProvider = activeEditor.getSite ().getSelectionProvider(); if (selectionProvider != null) return selectionProvider.getSelection(); } else { ISelectionProvider selectionProvider = multiPageEditor.getSite ().getSelectionProvider(); if (selectionProvider != null) return selectionProvider.getSelection(); } return null; } I didn't check other classes similar to this one, but in general, MultiPageEditorPart and its site should be given a try if active nested editor is not found.
I was investigating bug 108324 and I looked at this one as well. MultiPageSelectionProvider is the multiPageEditor.getSite ().getSelectionProvider(). In MultiPageSelectionProvider#getSelection() we could augment API so that non-editor pages could also supply IPostSelectionProvders ... although that doesn't look very straightforward. Later, PW
Is this still a problem in 3.3? PW
Changes requested on bug 193523
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.