| Summary: | [MPE] Allow bookmarks and tasks in plugin.xml source | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jim DAnjou <danjou> | ||||
| Component: | UI | Assignee: | Douglas Pollock <douglas.pollock> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P1 | CC: | daniel_megert, douglas.pollock, for.work.things, kai-uwe_maetzel, Michael.Valenta, n.a.edgar, thatnitind, wassim.melhem | ||||
| Version: | 2.1 | ||||||
| Target Milestone: | 3.1.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Jim DAnjou
The problem is fairly complicated. PDE editors are multi-page - they implement IEditorPart but the source page itself is an IEditorPart (also ITextEditor and ITextEditorExtension). When BookmarkRulerAction is registered using the viewerContribution element in popupMenus extension point, this action reacts to top-level editor switching only. When the active editor changes, it tests if the new editor is ITextEditor and also ITextEditorExtension and does nothing if it isn't. Kai, this is a problem for use because text editor is just one of the pages for us. How can we contribute actions to the vertical ruler when our top-level editor is not a text editor, but one of the pages is? *** Bug 57673 has been marked as a duplicate of this bug. *** Fixed in the new editor. Broken on all 3 pages (build.properties, plugin.xml, manifest.mf) in the editor in 3.1rc3. Perhaps the AbstractRulerActionDelegate should ask the editor part for an ITextEditor as an adapter? This could solve the problem for other multi-page editors with a single source page. This functionality was lost some time toward the end of the 3.1 cycle. Not sure exactly when. Dani, do you know what could have happened here? It currently works via menu but not via ruler. AFAIK we didn't change any code
in that area, and I doubt it ever worked from the ruler when looking at the code.
>Perhaps the AbstractRulerActionDelegate should ask the editor part for an
>ITextEditor as an adapter? This could solve the problem for other multi-page
>editors with a single source page.
The PDE editor has more than one source page.
Changing the severity from an Enhancement to Normal--the action exists and shows up, it just doesn't work. Konrad, please investigate for 3.1.1 I have done some investigation. It worked in M6, broken since M7.
In M6 MultipageEditorSite used to have:
public void registerContextMenu(String menuID, MenuManager menuMgr,
ISelectionProvider selProvider) {
if (menuExtenders == null) {
menuExtenders = new ArrayList(1);
}
menuExtenders.add(new PopupMenuExtender(menuID, menuMgr, selProvider,
editor));
}
where editor was ManifestSourcePage when opening manifest editor.
Since M7 till now, the method reads:
public void registerContextMenu(String menuID, MenuManager menuMgr,
ISelectionProvider selProvider) {
getMultiPageEditor().getSite().registerContextMenu(menuID, menuMgr,
selProvider);
}
where getSite() resolves to PartSite for ManifestEditor which is the outder
editor so does not implement ITextEditor.
If, in org.eclipse.ui.workbench plug-in, I replace MultiPageEditorSite with
the previous revision (1.15) then bookmarks and tasks work again.
Nick, I don't quite understand the reason for the change in
MultiPageEditorSite. Can this be corrected on the UI side, or is there
another way PDE editors should register context menu?
Thanks.
See bug 93998 for the rationale for this change. In retrospect, we should not have done this, as it worked this way in 3.0. The inconsistency was not due to the change for bug 68938 as I had assumed, it just propagated the same inconsistency. So it looks like we'll need to roll back the change for bug 93998 and live with the inconsistency, and we can do this for 3.1.1. This will be great for 3.1.1. Thanks Nick. Created attachment 25582 [details] Patch to "MultiPageEditorSite" This simply reverts the fix for Bug 93998. I believe MultiPageEditorSite is the only class affected. Fixed in both the 3.2 stream and the 3.1.1 stream. Verified can create a bookmark using menu item (but not by double clicking in ruler) in manifest.mf, plugin.xml, and build.properties. Using 3.1.1 20050923-1430 running in simplified chinese, using NLpack1-eclipse- SDK-M20050816-1400-win32.zip. I should not have marked this as verified as it hasn't yet been verified in 3.2 Verified in 3.1.1 but not 3.2 yet Verified on 3.1.1 RC2 and 3.2 M2 using GTK+ 2.6.8. |