Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsPerspectiveBarManager: how to avoid Discouraged access?
https://www.eclipse.org/forums/index.php/mv/msg/204325/653415/#msg_653415
Is there a "correct" way to avoid the Discouraged access: The method getPerspectiveBar() from the type WorkbenchWindow is not accessible due to restriction on required library C:\eclipse\plugins\org.eclipse.ui.workbench_3.6.1.M20100826- 1330.jar
This is the code i use to DISABLE the Perspective Toolbar context Menu:
//perspectiveBar existe?
if (perspectiveBarManager!=null){
ToolBar toolBar = perspectiveBarManager.getControl();
Listener[] listeners = toolBar.getListeners(SWT.MenuDetect);
if (listeners != null){
for (Listener listener : listeners){
toolBar.removeListener(SWT.MenuDetect, listener);
}
}
}
}
Thanks.]]>Marco Lopes2011-02-09T17:01:39-00:00Re: PerspectiveBarManager: how to avoid Discouraged access?
https://www.eclipse.org/forums/index.php/mv/msg/204325/653444/#msg_653444
4.1, for example, where the PerspectiveBarManager has been replaced with
something completely different.
You can choose to have the perspective switcher or not using
org.eclipse.ui.application.IWorkbenchWindowConfigurer.setSho wPerspectiveBar(boolean)
but it is not customizable beyond that (except possibly with some minor
preferences).
HTH
Catalin]]>Catalin Gerea2011-02-09T20:03:06-00:00Re: PerspectiveBarManager: how to avoid Discouraged access?
https://www.eclipse.org/forums/index.php/mv/msg/204325/653486/#msg_653486
Catalin Gerea wrote on Wed, 09 February 2011 15:03
Thanks. I've looked into it, tried to adapt to my code, but the result was not what i was expecting. Too far from the original PerspectiveBar behavior which i think should be more versatile.
]]>Marco Lopes2011-02-09T22:30:23-00:00