Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Auto adjust of toolbar item(Auto adjust of toolbar item)
Auto adjust of toolbar item [message #1109910] Mon, 16 September 2013 05:29 Go to next message
bava 502 is currently offline bava 502Friend
Messages: 6
Registered: August 2013
Junior Member
I have one label to be displayed as tool bar item and i have added it to toolbar as ToolControl item. I am able to see it on toolbar but i want to display it on the top right corner of toolbar and it should be auto adjusted if i minimize or maximize the screen. Is it possible to do so? ..Help will be greatly appreciated.

I have used the code below for ToolControl:

final Composite comp = new Composite(parent, SWT.NONE);

comp.setLayout(new GridLayout(1,true));
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
Label label= new Label(comp, SWT.NONE);
label.setText("label name");
label.setLayoutData(gridData );
GridDataFactory.fillDefaults().hint(100, SWT.DEFAULT).applyTo(label);

thanks in advance
Re: Auto adjust of toolbar item [message #1115932 is a reply to message #1109910] Tue, 24 September 2013 19:46 Go to previous message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member
The SWT Toolbar's layout is in control of the position / size of the embedded MToolControl. I'm relatively sure that trying to work around this is gonna lead t a world of hurt...

What you might try is to add the item directly as a ToolControl *not* embedded in a Toolbar; that way you own the layout and can put the label and associated TB anywhere you want...
Previous Topic:Testing my RCP app on Eclipse 4.3 - unwanted progress bar is showing
Next Topic:ACTIVE_PART: exactly when is it set?
Goto Forum:

Current Time: Sun Feb 16 18:53:56 GMT 2020

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

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

Back to the top