Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Customizing ToolBar
Customizing ToolBar [message #1412579] Tue, 26 August 2014 13:55 Go to next message
Daniel Branco is currently offline Daniel BrancoFriend
Messages: 14
Registered: January 2014
Junior Member
Hello everyone,

I have a simple problem which is to have a flat no space toolbar, the idea is to have something like this "http://book.javanb.com/swt-the-standard-widget-toolkit/images/0321256638/graphics/08fig01.gif"

Any idea on how to do it, I created a Renderer for custom behavior the createWidget method looks like this.

public Object createWidget(final MUIElement theElement, Object theParent) {

if (!(theElement instanceof MToolBar) || !(theParent instanceof Composite) || ((Composite) theParent).isDisposed()
|| PlatformUI.getWorkbench().getActiveWorkbenchWindow() == null) {
logger.error("Cannot create toolBar Banner widget");
return null;
}

IWorkbenchWindow aWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
aWorkbenchWindow.addPerspectiveListener(internalPerspectiveListener);

Object widget = super.createWidget(theElement, theParent);

ToolBar aToolBar = (ToolBar) theElement.getWidget();

//aToolBar.setLayout(new TrimBarBannerLayout(true));

ACTIVE_WINDOW_TOOLBAR.put(aWorkbenchWindow, aToolBar);

return widget;
}
Re: Customizing ToolBar [message #1418305 is a reply to message #1412579] Sat, 06 September 2014 22:01 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Am 26.08.2014 um 15:55 schrieb Daniel Branco:
> Hello everyone,
>
> I have a simple problem which is to have a flat no space toolbar, the
> idea is to have something like this
> "http://book.javanb.com/swt-the-standard-widget-toolkit/images/0321256638/graphics/08fig01.gif"
>
>
> Any idea on how to do it, I created a Renderer for custom behavior the
> createWidget method looks like this.
>
> public Object createWidget(final MUIElement theElement, Object theParent) {
>
> if (!(theElement instanceof MToolBar) || !(theParent instanceof
> Composite) || ((Composite) theParent).isDisposed()
> || PlatformUI.getWorkbench().getActiveWorkbenchWindow()
> == null) {
> logger.error("Cannot create toolBar Banner widget");
> return null;
> }
>
> IWorkbenchWindow aWorkbenchWindow =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow();
>
> aWorkbenchWindow.addPerspectiveListener(internalPerspectiveListener);
>
> Object widget = super.createWidget(theElement, theParent);
>
> ToolBar aToolBar = (ToolBar) theElement.getWidget();
>
> //aToolBar.setLayout(new TrimBarBannerLayout(true));
>
> ACTIVE_WINDOW_TOOLBAR.put(aWorkbenchWindow, aToolBar);
>
> return widget;
> }


Hi Daniel,
the PlatformUI is from the old Eclipse platform. But perhaps the
RoundedToolbar from Opal project is what you are lookung for (see
https://code.google.com/a/eclipselabs.org/p/opal/wiki/RoundedToolbar).
This widget could be placed on a simple part. I've used a similar
solution for a coolbar panel.

Greets,
Ralf.
Previous Topic:Abandoning E4
Next Topic:Eclipse Source Code Editor in e4 RCP
Goto Forum:
  


Current Time: Thu Apr 25 04:57:55 GMT 2024

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

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

Back to the top