Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to remove toolbar when Console view is firstly created.
How to remove toolbar when Console view is firstly created. [message #546763] Wed, 14 July 2010 06:55
yuanyun.ken is currently offline yuanyun.ken
Messages: 25
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: )
Previous Topic:How to prompt a custom dialog when close editor and application
Next Topic:[CNF] FilteredTree support ?
Goto Forum:
  


Current Time: Fri Oct 24 14:49:26 GMT 2014

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

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