Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: ShowInMenu
Re: ShowInMenu [message #329930] Thu, 10 July 2008 18:46 Go to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Paul Wells wrote:
> I'm working on a project which uses the JDT to create class diagrams.
>
> One of the popup actions has stopped working since Ganymede.
>
> The action uses org.eclipse.ui.internal.ShowInMenu to allow the user to
> navigate to other views such as the History or the Project Explorer
> depending upon the currently selected java element in the class diagram.
>
> Yes - I know you're not supposed to use the internal packages. Is there
> a way I can invoke this action without accessing an internal package?
>
> Here's the code:
>
> MenuManager showInMenuManager = new MenuManager("Show In");
>
> ShowInMenu showInMenu = new
> ShowInMenu(getDiagram().getDiagramEditor().getSite().getWork benchWindow(),
> "show in");
>
> showInMenuManager.add(showInMenu);
>
> popupEvent.getMenuManager().add(showInMenuManager);
>
> Because the diagram is a selection provider showInMenu always worked
> like magic. Since Ganymede it looks like it has become more choosy about
> which view it is invoked from.

re-routing to eclipse.platform

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: ShowInMenu [message #329931 is a reply to message #329930] Thu, 10 July 2008 19:15 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Paul Webster wrote:
> Paul Wells wrote:
>>
>> Here's the code:
>>
>> MenuManager showInMenuManager = new MenuManager("Show In");
>>
>> ShowInMenu showInMenu = new
>> ShowInMenu(getDiagram().getDiagramEditor().getSite().getWork benchWindow(),
>> "show in");

It was modified in 3.4 to integrate with menu contributions as well as
the other show in sources.

What if you change those 2 lines to:
ShowInMenu showInMenu = new ShowInMenu();
showInMenu.setId("showIn");
showInMenu.initialize(getDiagram().getDiagramEditor().getSit e().getWorkbenchWindow());

which is how it is used in 3.4 in
org.eclipse.ui.actions.ContributionItemFactory.VIEWS_SHOW_IN

Does that help?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:How to programatically customize perspective
Next Topic:Viewer is busy
Goto Forum:
  


Current Time: Thu Dec 26 15:07:27 GMT 2024

Powered by FUDForum. Page generated in 0.03262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top