Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
Mark Leone is currently offline Mark Leone
Messages: 67
Registered: April 2012
Member
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]

Report message to a 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
Mark Leone is currently offline Mark Leone
Messages: 67
Registered: April 2012
Member
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: Sat Aug 02 04:56:02 EDT 2014

Powered by FUDForum. Page generated in 0.09021 seconds