[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Hide/Unhide a toolbar inside a coolbar

Hi,
I have a problem with the visibility of coolbars in an rcp-project. I have several toolbars inside the main coolbar, for which I want to implement a functionality to hide/unhide them (quite similar to the standard eclipse functionality window -> customize perspective). I use the extension org.eclipse.ui.menu to add a number of toolbars to the default one:


<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
	<toolbar id="com.dcx.ivkmds.application.rcs.toolbar.edit">
	...
	</toolbar>
	<toolbar id=...
	...
	</toolbar>
</menuContribution>

I tried several approaches to set the visibility of each single toolbar, but none of them seems to work properly.
First, I tried to set the visibility programatically:


ApplicationWindow window = (ApplicationWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ICoolBarManager coolbarManager = window.getCoolBarManager2();


coolbarManager.getItems() returns the correct list of ContributionItems, but calling setVisible() on any of them doesn't change anything.

My second approach was a property tester. Though I can't seem to hide the toolbar itself, I can hide its commands. But when I try to change the visibility back to true, again nothing happens (as far as I know the property tester only reacts on events, when I set the focus on another window and back to the application, the toolbar is shown again).

I would appreciate any help, I'm quite desperate and I don't want to change it all back to actionSets, although this might be working.


Thanks for your help.

Regards,

Robert