Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Right-aligned toolbar
Right-aligned toolbar [message #642690] Thu, 02 December 2010 11:40 Go to next message
Giddi Ohm is currently offline Giddi OhmFriend
Messages: 10
Registered: September 2010
Junior Member
Is there a way to align a toolbar to the right hand side of the toolbar container? I would like my toolbar to behave just like the perspectives toolbar which is glued to the right and moves when the window is resized.

I would like to add a search field to my toolbar and I would like to always display it at the end of the toolbar.

I have tried adding a new toolbar but I cannot set its location. I've also tried adding the search field to the main toolbar and adjusting the size of the space between the buttons and the field, but it doesn't seem to work. I've also considered hacking the perspectives bar (remove all buttons and add a field, but I haven't found a way to do that yet).

Is there a way to create my own toolbar manager and do custom layout? I am using Eclipse 3.6 and my main toolbar is populated with commands.

Is this possible in Eclipse?
Re: Right-aligned toolbar [message #643022 is a reply to message #642690] Fri, 03 December 2010 16:47 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi Giddi,

Did you look at the "menus" extension point? It enables you to put items in
the "trim areas"

toolbar:org.eclipse.ui.main.toolbar - the top-level tool bar
toolbar:org.eclipse.ui.trim.command1 - the top left trim
toolbar:org.eclipse.ui.trim.command2 - the top right trim
toolbar:org.eclipse.ui.trim.vertical1 - the left vertical trim
toolbar:org.eclipse.ui.trim.vertical2 - the right vertical trim
toolbar:org.eclipse.ui.trim.status - the status line trim


--

Best Regards,
Wim Jongman


> Is there a way to align a toolbar to the right hand side of the toolbar
container? I would like my toolbar to behave just like the perspectives
toolbar which is glued to the right and moves when the window is resized.
>
> I would like to add a search field to my toolbar and I would like to always
display it at the end of the toolbar.
>
> I have tried adding a new toolbar but I cannot set its location. I've also
tried adding the search field to the main toolbar and adjusting the size of
the space between the buttons and the field, but it doesn't seem to work.
I've also considered hacking the perspectives bar (remove all buttons and add
a field, but I haven't found a way to do that yet).
>
> Is there a way to create my own toolbar manager and do custom layout? I am
using Eclipse 3.6 and my main toolbar is populated with commands.
>
> Is this possible in Eclipse?
Re: Right-aligned toolbar [message #643245 is a reply to message #643022] Mon, 06 December 2010 09:26 Go to previous message
Giddi Ohm is currently offline Giddi OhmFriend
Messages: 10
Registered: September 2010
Junior Member
Thanks for the tip, that solved the problem with the location. However, the result wasn't 100% as I had expected.

My main toolbar has icons that are 32x32 in size. The search field is only 22 pixel high on Windows 7. Setting the location to "toolbar:org.eclipse.ui.trim.command2" will indeed put it in the upper-right corner, but since the toolbar is put in a different container it will not get the same height as my main toolbar and the search field is crammed up in the top-right corner and not centered vertically with my main toolbar icons.

Is there any way to force the height of this toolbar? Setting the minimum size of the components inside the toolbar doesn't make the toolbar taller, but instead the components will get clipped.

Also, is there a way to turn off the toolbar handle for just this toolbar? I don't want the user to be able to move the search toolbar around.

[Updated on: Mon, 06 December 2010 14:35]

Report message to a moderator

Previous Topic:Eclipse RCP and java web start
Next Topic:Printing something to eclipse code editor
Goto Forum:
  


Current Time: Tue Apr 23 12:32:59 GMT 2024

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

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

Back to the top