Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to remove actions from toolbar of Navigator?
How to remove actions from toolbar of Navigator? [message #661153] Wed, 23 March 2011 11:50 Go to next message
Giovanni De Sossi is currently offline Giovanni De Sossi
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi,

in my RCP app I used Common Navigator Framework to implement a model navigator view; now I need to remove the usual controls appearing in the view toolbar: Collapse All, Link with Editor and View menu: any idea about this?

Thank you,

Giovanni.
Re: How to remove actions from toolbar of Navigator? [message #661340 is a reply to message #661153] Thu, 24 March 2011 10:22 Go to previous messageGo to next message
Giovanni De Sossi is currently offline Giovanni De Sossi
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

I found the solution, hope this helps:

In my View extending CommonNavigator I overrode the protected ActionGroup createCommonActionGroup(), returning a personal implementation of ActionGroup; in that class, I overrode the fillActionBars method:

@Override
public void fillActionBars(IActionBars actionBars) {
IToolBarManager toolBar = actionBars.getToolBarManager();
IMenuManager menuMgr = actionBars.getMenuManager();
toolBar.removeAll();
menuMgr.removeAll();
}

this do the trick.

Bye,

Giovanni
Re: How to remove actions from toolbar of Navigator? [message #959965 is a reply to message #661153] Sat, 27 October 2012 04:26 Go to previous message
David Hipshman is currently offline David Hipshman
Messages: 1
Registered: October 2012
Junior Member
I was trying to do something similar. In this case removing the Collapse All action from a view that extends CommonNavigatorView. But I wanted to only remove that one action. For future reference here is how I did it. Just by setting a property to hide it in the plugin.xml file , adding this extension...

<extension
point="org.eclipse.ui.navigator.viewer">
<viewer
viewerId="yourViewerID">
<options>
<!-- Hide the "Collapse All" action from the toolbar etc of the viewer -->
<property
name="org.eclipse.ui.navigator.hideCollapseAllAction"
value="true"/>
</options>
</viewer>
</extension>
Previous Topic:Incorrect Intro/Welcome behavior after move to 4.2
Next Topic:Getting Started - Books?
Goto Forum:
  


Current Time: Fri Sep 19 16:12:20 GMT 2014

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

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