Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to customize perspective programmatically?(Hide Default menus and toolbars for certain perspective)
How to customize perspective programmatically? [message #904372] Tue, 28 August 2012 10:43 Go to next message
becks m is currently offline becks mFriend
Messages: 59
Registered: June 2012
Member
Hi,

I want to make the same behavior I got when I do a right click on a perspective and choose customize to get this window

http://store2.up-00.com/Aug12/oOV50449.png

I want to customize menus and toolbars for my perspective only programmatically
Actually, I want to remove most menus and toolbars in my perspective only and they will show up again when I change to any other perspective
Can you please help me with this ?

[Updated on: Tue, 28 August 2012 14:47]

Report message to a moderator

Re: How to customize perspective programmatically? [message #905144 is a reply to message #904372] Wed, 29 August 2012 19:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There's no API to do this. In 4.2 you would be able to update a property on the model (although it's still not API). In 4.3 we hope to expose a proper model way to do that.

PW


Re: How to customize perspective programmatically? [message #1429488 is a reply to message #905144] Tue, 23 September 2014 09:42 Go to previous messageGo to next message
Mattias Bertilsson is currently offline Mattias BertilssonFriend
Messages: 2
Registered: September 2014
Junior Member
Paul Webster wrote on Wed, 29 August 2012 19:42
There's no API to do this. In 4.2 you would be able to update a property on the model (although it's still not API). In 4.3 we hope to expose a proper model way to do that.


Did something like this make it in for 4.3 or 4.4?

As far as I can see, there are not that many alternatives if you need to reduce the clutter of UI contributions from other plugins in your perspective.

Using the hiddenMenuItem and hiddenToolBarItem elements of perspectiveExtension I guess works, but is fragile since it requires the exact id of each contribution, and I guess does not allow the user to include the items if he / she really wants them.

Associating the UI contributions with activities and then disable the activities when activeWorkbenchWindow.activePerspective matches your perspective might work, but then again the user would not be able to override your decision. Using activities without a disabling expression would give the user a chance to enable the contributions, but on the other hand remove them from all perspectives.

Are there any other options?

/Mattias Bertilsson
Re: How to customize perspective programmatically? [message #1429791 is a reply to message #1429488] Tue, 23 September 2014 19:17 Go to previous message
Mattias Bertilsson is currently offline Mattias BertilssonFriend
Messages: 2
Registered: September 2014
Junior Member
Mattias Bertilsson wrote on Tue, 23 September 2014 09:42
Using the hiddenMenuItem and hiddenToolBarItem elements of perspectiveExtension I guess works, but is fragile since it requires the exact id of each contribution, and I guess does not allow the user to include the items if he / she really wants them.


Actually, it seems to work the way you want (hiding the items, but allowing the user to have them shown by customizing the perspective), when it works. It is the getting it to work in the first place (for all the different items you want to hide) that is the difficult part.
Previous Topic:Compare With Each other
Next Topic:Switch Perspective fails when executed after Job
Goto Forum:
  


Current Time: Tue Apr 23 17:03:37 GMT 2024

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

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

Back to the top