|
|
Re: perspective shortcuts in menus (commands) without "other.." [message #544892 is a reply to message #544852] |
Mon, 05 July 2010 22:24   |
Christian  Messages: 2 Registered: July 2010 |
Junior Member |
|
|
Yes, I got that link also from a colleague today.
That solves my problem, though I find it kind of irritating, that there is no command to achieve this, or at least to display the standard "show perspective" menuitem (especially with so many people being commited to get Actions marked as deprecated)...
Anyway that solution does work and if it's the best way to go, so be it.
Thanks for the fast reply
[Updated on: Mon, 05 July 2010 22:25] Report message to a moderator
|
|
|
Re: perspective shortcuts in menus (commands) without "other.." [message #545144 is a reply to message #544892] |
Tue, 06 July 2010 18:20  |
|
Hello Christian
I used a dynamic menu contribution because in my case the number in the perspectives can be changed dynamically. Also it had the advantage that I could do a little customization otherwise not possible.
But if you have a fixed number of perspectives you can go for the extension point approach: define a command that has the handler the ShowPerspectiveHandler class.
Then put the menu entry has has the command defined above with the correct parameter (the name of the perspective to be opened).
Then add the visibleWhen conditions based on the user roles.
This approach has the disadvantage that when you add a new perspective to the application you have to add a new menu entry (double work).
There is also the possibility to have the command defined in code and not via extension point. The same goes for the handler.
Take a look at the following classes: PerspectiveMenu, ChangeToPerspectiveMenu and ShowPerspectiveHandler to see how the opening of the perspective is handled via code and how the perspectives shortcuts are added to the menu (including the 'Other...' menu entry).
HTH
Catalin Gerea
Time is what you make of it.
|
|
|
Powered by
FUDForum. Page generated in 0.01349 seconds