Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Hide perspective bar in eclipse rcp programmatically
Hide perspective bar in eclipse rcp programmatically [message #1783744] Fri, 16 March 2018 13:39 Go to next message
Gaurav Tripathi is currently offline Gaurav TripathiFriend
Messages: 43
Registered: September 2015
Member
How can we hide the perspective toolbar entries in eclipse from the plugin programmatically as shown in the attached image?
  • Attachment: xgov2.png
    (Size: 24.88KB, Downloaded 304 times)
Re: Hide perspective bar in eclipse rcp programmatically [message #1784274 is a reply to message #1783744] Mon, 26 March 2018 07:20 Go to previous message
Gaurav Tripathi is currently offline Gaurav TripathiFriend
Messages: 43
Registered: September 2015
Member
Hi, this helped me in hiding perspective toolbar entries.
        IWorkbenchWindow window = PlatformUI.getWorkbench()
                        .getActiveWorkbenchWindow();
                if (window instanceof WorkbenchWindow) {
                    MTrimBar topTrim = ((WorkbenchWindow) window).getTopTrim();
                for (MTrimElement element : topTrim.getChildren()) {
                    if ("PerspectiveSwitcher".equals(element.getElementId())) {                     
                        element.setVisible(false);
                        break;
                    }
                }
Previous Topic:Port RCP Application to Juno - startup error
Next Topic:P2 Endpoints.
Goto Forum:
  


Current Time: Fri Apr 26 18:04:37 GMT 2024

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

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

Back to the top