Skip to main content



      Home
Home » Eclipse Projects » JFace » ToolBarManager items stacked vertically instead of horizontally
ToolBarManager items stacked vertically instead of horizontally [message #997286] Fri, 04 January 2013 17:31 Go to next message
Eclipse UserFriend
I add two items to the ToolBarManager obtained from the view site, with the following code in a ViewPart instance:

ToolBarManager mgr = (ToolBarManager) getViewSite().getActionBars().getToolBarManager();
CustomControlItem item1 = new CustomControlItem("someText");
mgr.add(item1);
CustomControlItem item2 = new CustomControlItem("someText");
mgr.add(item2);



the class CustomControlItem extends ControlContribution and creates a control that extends Button and returns it in its createControl() method.

The problem I'm having is that the two items show up in the toolbar stacked one on top of the other. When they're stacked this way, both labels are unreadable because the toolbar height is not sufficient to display two items vertically. The desired behavior is for them to be placed side by side.

All the sample code I've found through searching adds the items as I do, but no one mentions having the problem I'm seeing. The examples I saw were creating a ToolBarManager instance, but I'm using the one provided by the ViewSite.

[Updated on: Sun, 06 January 2013 16:48] by Moderator

Re: ToolBarManager items stacked vertically instead of horizontally [message #997465 is a reply to message #997286] Mon, 07 January 2013 11:13 Go to previous message
Eclipse UserFriend
Found my problem. I was applying a GridLayout to the parent passed to ControlContribution#createControl.
Previous Topic:Make TreeViewerItems not selectable?
Next Topic:How to display ToolTip on Mouse Hover over VerticalRuler
Goto Forum:
  


Current Time: Wed Jul 23 09:46:06 EDT 2025

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

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

Back to the top