Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » WorkbenchWindowAdvisor question
WorkbenchWindowAdvisor question [message #635086] Mon, 25 October 2010 15:27 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: May 2010
Junior Member
Hi all,
I have a question regarding the WorkbenchWindowAdvisor. I currently have an application that has a WorkbenchWindowAdvisor that creates a Menu. The items that appear on the menu are determined by plugins that use an extension point defined in the application. When a menu item is clicked, the plugin that defined that menu element opens a new workbench window with a new perspective. My issue is that every new workbench window opened contains the menu of the main application, and I don't want it to. Is there a way from within the called plugin to override the behavior of the main app's WorkbenchWindowAdvisor? Perhaps define a new WorkbenchWindowAdvisor for that specific workbench window? How would I go about doing this, since PlatformUI.getWorkbench().openWorkbenchWindow does not take an advisor like createAndRunWorkbench does?

Thanks!

Jim
Re: WorkbenchWindowAdvisor question [message #635129 is a reply to message #635086] Mon, 25 October 2010 16:55 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The place to do it would be in your
org.eclipse.ui.application.WorkbenchAdvisor.createWorkbenchW indowAdvisor(IWorkbenchWindowConfigurer)
You can create a different Advisor for the second window.

You'll have to dig through the information available at that point to
see if you can tell you're on the second window, or your special window.

PW

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


Re: WorkbenchWindowAdvisor question [message #635138 is a reply to message #635129] Mon, 25 October 2010 17:45 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: May 2010
Junior Member
Paul,
Thank you very much, that is exactly what I was looking for!

-- Jim
Re: WorkbenchWindowAdvisor question [message #635154 is a reply to message #635086] Mon, 25 October 2010 19:12 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: May 2010
Junior Member
As I wade in to this further, I am having a hard time figuring out the best approach to relay what the window type is to the WorkbenchAdvisor. Is there some way to pass a uniqueID to the Advisor based upon the WorkbenchWindow it is trying to create? Can the IWorkBenchWindowConfigurer be modified by the plugin to include an identifier in its setData? I know I can figure out some way to notify the advisor, but I am looking for a solid approach - I don't want to hack it Smile

Thanks!

Jim
Previous Topic:Implement an Alert View
Next Topic:License of an Eclipse RCP application?
Goto Forum:
  


Current Time: Tue Apr 23 10:04:37 GMT 2024

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

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

Back to the top