Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Missing Toolbar when migrating to e4
Missing Toolbar when migrating to e4 [message #891726] Mon, 25 June 2012 15:53 Go to next message
Missing name Missing nameFriend
Messages: 20
Registered: May 2010
Junior Member
I added the required plugins to run an existing 3.x rcp on e4. When I open my custom editor, the toolbar contributions seem to be missing. How do I add them?
Also, how do I customize the perspective bar area.

Any help would be greatly appreciated.

Thanks!
Re: Missing Toolbar when migrating to e4 [message #891740 is a reply to message #891726] Mon, 25 June 2012 17:38 Go to previous messageGo to next message
Missing name Missing nameFriend
Messages: 20
Registered: May 2010
Junior Member
I've been using "@Override public void contributeToCoolBar(){}" before and the toolbar items did not show up.

When I add my actions to the toolbar using "@Override public void contributeToToolBar(){}" the actions show up. But the toolbar shows up in the wrong place. The order its being displayed currently is

<main toolbar> <quick access bar> | <perspective bar> <editor toolbar>

I wanted the editor toolbar to show up along side <main toolbar>. Any ideas?
Re: Missing Toolbar when migrating to e4 [message #897646 is a reply to message #891740] Tue, 24 July 2012 21:34 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hi,

I have the exact same problem. Perhaps now someone knows a solution?

Frank
Re: Missing Toolbar when migrating to e4 [message #897656 is a reply to message #897646] Tue, 24 July 2012 23:25 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
I found a work around for this problem. Instead of adding the toolbarmanager to the passed coolbarmanager, adding it to the parent works.

Is this a bug?

public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
//...

	protected void fillCoolBar(ICoolBarManager coolBar) {
		ToolBarManager toolBarManager = new ToolBarManager( coolBar.getStyle() );
		toolBarManager.add( fileOpenAction );
		coolBar.add(toolBarManager);
		coolBar.add( new GroupMarker( TOOLB_ADDITIONS )); 

	}
}

public class EditorContribCastle extends MultiPageEditorActionBarContributor {

	@Override
	public void contributeToCoolBar(ICoolBarManager coolBarManager) {
		
		ToolBarManager toolBarManager = new ToolBarManager(coolBarManager.getStyle());
		
		toolBarManager.add(actionX);

		ToolBarContributionItem tbmi = new ToolBarContributionItem(toolBarManager);

		SubCoolBarManager sbm = (SubCoolBarManager)coolBarManager;

		// this line does not work
		coolBarManager.insertBefore(ApplicationActionBarAdvisor.TOOLB_ADDITIONS, tbmi);

		// this line does not work
		coolBarManager.appendToGroup(ApplicationActionBarAdvisor.TOOLB_ADDITIONS, tbmi );

		// this line work!!
		sbm.getParent().insertBefore(ApplicationActionBarAdvisor.TOOLB_ADDITIONS, tbmi);
		
		// this line appends to wrong position
		sbm.getParent().appendToGroup(ApplicationActionBarAdvisor.TOOLB_ADDITIONS, tbmi);
		
	}
}
Re: Missing Toolbar when migrating to e4 [message #897792 is a reply to message #897656] Wed, 25 July 2012 09:09 Go to previous message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
but now I notice, this workaround does add the toolbars each time again, when a document is opened.
Previous Topic:Headless Workspace
Next Topic:Use of DI in extension
Goto Forum:
  


Current Time: Fri Mar 29 10:12:00 GMT 2024

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

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

Back to the top