6

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

enter image description here

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 let them show up again when I change to any other perspective Can you please help me with this ?

becks
  • 2,656
  • 8
  • 35
  • 64

1 Answers1

3

This guide shows how to customise toolbars programmatically based on the current perspective, and hints that the solution for menus is very similar.

Also, the code for the UI in your screenshot is available here, and might contain some useful hints at how to do it.

Sinjo
  • 430
  • 3
  • 7
  • I'll just add that as Eclipse moves to 4.2, this is less likely to work. – Paul Webster Aug 29 '12 at 20:25
  • Oh, how come? We've not moved our project up to 4.2 so far, and I'm curious to know about things which might give us trouble. – Sinjo Oct 02 '12 at 10:14
  • 2
    WorkbenchWindow doesn't offer the same access in 4.2 as it does in 3.x. In 3.x it uses the window MenuManager, in 4.2 it uses a completely different rendering story. – Paul Webster Oct 02 '12 at 13:24