Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » toolbar doesn't wrap
toolbar doesn't wrap [message #916084] Tue, 18 September 2012 13:54 Go to next message
Dirk Hoffmann is currently offline Dirk Hoffmann
Messages: 163
Registered: July 2009
Senior Member
Hi,

although I created a ToolBarManager with the SWT.WRAP option it doesn't
wrap when resizing the view containing the controlArea composite to a
width too small to display all toolbar items in a single row. This is
the code that creates the ToolbarManager and adds items to it:

protected void buildControlArea(Composite controlArea) {
ToolBarManager toolBarManager = new
ToolBarManager(SWT.HORIZONTAL|SWT.FLAT|SWT.WRAP);
toolBarManager.createControl(controlArea);

for (IContributionItem contribution : _controlAreaContributions) {
toolBarManager.add(contribution);
}

toolBarManager.update(true);
}

Does anybody have an idea why wrapping doesn't work?

Do I have to register an eventhandler with some kind of resize event or
do I have to take special care which layout mangersto use for the tool
bar's parent composite?

Would be great if anybody could help!

Regards,
Dirk
Re: toolbar doesn't wrap [message #945688 is a reply to message #916084] Mon, 15 October 2012 14:35 Go to previous message
John Steele is currently offline John Steele
Messages: 49
Registered: January 2010
Member
I don't think the toolbar will be called to layout unless it's parent explicitly told it to do so.

I'm sure you could go the brute force way and add a control listener and manually calling layout on the toolbar when the surrounding control has been resized.

How do you have the parent layed out? I'll experiment with it tonight and get back to you.
Previous Topic:Problem with using plugin fragments in target platform
Next Topic:SWT Browser Compatibility
Goto Forum:
  


Current Time: Fri Oct 31 11:35:43 GMT 2014

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

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