How to remove toolbar when Console view is firstly created. [message #546763] |
Wed, 14 July 2010 06:55 |
Jeffery Yuan Messages: 27 Registered: July 2009 |
Junior Member |
|
|
Hi, all:
I would like to customize the Console view for our RCP application, to remove all unneeded toolbars.
In thread, http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg13554.html
It suggests to create an extension for "org.eclipse.ui.console.consolePageParticipants". add an enablement for "org.eclipse.ui.console.IConsole".
It works, it can remove toolbar from the created console.
But one problem is that, when Console view is first created, the toolbars are not
removed, it still shows toolbar, like: "New Console View", and especially I don't want to expose this toolbar to user.
I checked the org.eclipse.ui.internal.console.ConsoleView code, in method protected PageRec doCreatePage(IWorkbenchPart dummyPart), it will get all IConsolePageParticipant, and apply them.
But in protected IPage createDefaultPage(PageBook book), it doesn't do same thing, it doesn't get all IConsolePageParticipant, and apply them.
Does Eclipse RCP team do this on purpose or not?
Then I tried to add the following code to ApplicationWorkbenchWindowAdvisor, but it also doesn't work.
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
public void postWindowCreate() {
super.postWindowOpen();
IWorkbenchPage workbenchPage = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IViewPart viewPart = workbenchPage
.findView(IConsoleConstants.ID_CONSOLE_VIEW);
IViewSite viewSite = viewPart.getViewSite();
IActionBars actionBars = viewSite.getActionBars();
IToolBarManager toolBarManager = actionBars.getToolBarManager();
toolBarManager.removeAll();
}
}
Anybody knows how to remove toolbar from the page when Console view is firstly created?
Many thanks for any help or suggestions in advance: )
|
|
|
Powered by
FUDForum. Page generated in 0.03157 seconds