How to customize eclipse perspective programmatically?
Asked Answered
L

1

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 ?

Losel answered 28/8, 2012 at 13:1 Comment(0)
S
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.

Shrink answered 28/8, 2012 at 14:16 Comment(3)
I'll just add that as Eclipse moves to 4.2, this is less likely to work.Rechabite
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.Shrink
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.Rechabite

© 2022 - 2024 — McMap. All rights reserved.