Community
Participate
Working Groups
Build ID: 3.3M6 These classes (ShowInMenu/ShowInAction) are really good canidates for API. The one thing that I would like to see changed before making it API is that I woul dlike to supply the Object that is the ShowInContext. Please see related bug 180543
Related: bug 182225 and bug 182234
From a commands perspective we now have the org.eclipse.ui.navigate.showInQuickMenu command which you can add to a view and get all of this functionality for free so long as you register an IShowInSource adapter for your view. The problem is building a submenu for it - I can get an entry that opens a second menu but not one that builds a submenu dynamically.
What is the plan for this for 3.4? Should we do an API command instead?
I'll be looking at options in the M4/M5 timeframe. PW
I'm still waiting for this one. Any reason it was untargetted from 3.4M5?
Yes, I'm not sure what we will be providing here, since it would probably be command/handler based. It will also depend on what comes out of bug 173649 PW
*** Bug 206815 has been marked as a duplicate of this bug. ***
Min, with bug 173649 ContributionItemFactory.VIEWS_SHOW_IN.create(IWorkbenchWindow) will produce the ShowInMenu contribution item for consumption. Using commands/menu contributions new show in targets can be introduced using menu contributions: <menuContribution locationURI="popup:org.eclipse.ui.menus.showInMenu"> <command commandId="org.eclipse.ui.menus.showIn" style="push"> <parameter name="org.eclipse.ui.menus.showIn.targetId" value="org.eclipse.ui.views.ProgressView"> </parameter> <visibleWhen checkEnabled="false"> <with variable="showInSelection"> // insert visible when expression here </with> </visibleWhen> </command> </menuContribution> What behaviour exactly were you looking for? PW
At the begining I was actually using the IContributionItemFactory, but now I'm using the new way of doing it... <menuContribution locationURI="popup:MYEDITORID#PopupMenu?after=MYSEPERATOR"> <command commandId="org.eclipse.ui.navigate.showInQuickMenu" label="Show in"> </command> </menuContribution> However, this never displayed the 2nd-level cascade. If I clicked on "show in" it would then dismiss the context menu, and a new disembodied menu would show up with all the targets. I would have liked it if I could see the show in targets as a sub-menu off the context menu. Also, I want to be able to customize the ShowInContext item that is passed to the IShowInTarget. I think thay may have already been possible. For example, I have a GEF editor. The selection is an EditPart. It would like to convert the EditPart to an IFile. The ShowInContext's selection should be the IFile. -- Just to be clear... bug that this depends on makes it possible to add new ShowInTargets via extension point, instead of having to rely on Perspectives.
(In reply to comment #9) > At the begining I was actually using the IContributionItemFactory, but now I'm > using the new way of doing it... > > <menuContribution > locationURI="popup:MYEDITORID#PopupMenu?after=MYSEPERATOR"> > <command > commandId="org.eclipse.ui.navigate.showInQuickMenu" > label="Show in"> > </command> > </menuContribution> Min, you would use this XML instead of your command element to insert the menu/short-cut/target items <menu commandId="org.eclipse.ui.navigate.showInQuickMenu" id="org.eclipse.ui.ide.markers.showInMenu" label="%menu.showIn.label" mnemonic="%menu.showIn.mnemonic"> <dynamic class="org.eclipse.ui.ExtensionFactory:showInContribution" id="org.eclipse.ui.menus.dynamicShowInMenu"> </dynamic> </menu> > Also, I want to be able to customize the ShowInContext item that is passed to > the IShowInTarget. I think thay may have already been possible. ShowInContext is already API, but it's the IShowInSource that gets a chance to customize it on the way out. > For example, I have a GEF editor. The selection is an EditPart. It would like > to convert the EditPart to an IFile. The ShowInContext's selection should be > the IFile. Your editor can return whatever it wants in its ShowInContext. Later, PW
(In reply to comment #10) > (In reply to comment #9) > > At the begining I was actually using the IContributionItemFactory, but now I'm > > using the new way of doing it... > > > > <menuContribution > > locationURI="popup:MYEDITORID#PopupMenu?after=MYSEPERATOR"> > > <command > > commandId="org.eclipse.ui.navigate.showInQuickMenu" > > label="Show in"> > > </command> > > </menuContribution> > > Min, you would use this XML instead of your command element to insert the > menu/short-cut/target items > > <menu > commandId="org.eclipse.ui.navigate.showInQuickMenu" > id="org.eclipse.ui.ide.markers.showInMenu" > label="%menu.showIn.label" > mnemonic="%menu.showIn.mnemonic"> > <dynamic > class="org.eclipse.ui.ExtensionFactory:showInContribution" > id="org.eclipse.ui.menus.dynamicShowInMenu"> > </dynamic> > </menu> > > > Did you get a chance to try the new menu contribution XML? PW
When was the Eclipse platform updated to support this style? <menu commandId="org.eclipse.ui.navigate.showInQuickMenu" id="com.ibm.etools.diagram.web.ui.showInQuickMenuId" label="Show In"> <dynamic class="org.eclipse.ui.ExtensionFactory:showInContribution" id="org.eclipse.ui.menus.dynamicShowInMenu"> </dynamic> </menu> I put the menu within the <menuContribution> block. I just tried it in my development target (which is based on Eclipse code from 20080205). It's not working yet. Should it already be working on that build or should I wait for a later one?
(In reply to comment #12) > When was the Eclipse platform updated to support this style? > > <menu > commandId="org.eclipse.ui.navigate.showInQuickMenu" > id="com.ibm.etools.diagram.web.ui.showInQuickMenuId" > label="Show In"> > <dynamic > class="org.eclipse.ui.ExtensionFactory:showInContribution" > id="org.eclipse.ui.menus.dynamicShowInMenu"> > </dynamic> > </menu> > > I put the menu within the <menuContribution> block. > > > I just tried it in my development target (which is based on Eclipse code from > 20080205). It's not working yet. Should it already be working on that build or > should I wait for a later one? > Ah, it won't be available until at least I20080320-0800 PW
Let me know how it worked with the later I build. PW
This work has concluded. PW