Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Nebula RoundedToolbar"

(Created page with "==Introduction== File:RoundedToolbar.png A simple rounded toolbar with grey buttons. ==Usage== This is very simple : you instantiate a <code>RoundedToolbar</code> and...")
 
Line 9: Line 9:
 
This is very simple : you instantiate a <code>RoundedToolbar</code> and then you create <code>RoundedToolItems</code> (like the <code>Toolbar</code> widget):
 
This is very simple : you instantiate a <code>RoundedToolbar</code> and then you create <code>RoundedToolItems</code> (like the <code>Toolbar</code> widget):
  
  final RoundedToolbar roundedToolBar = new RoundedToolbar(shell, SWT.NONE);
+
  final RoundedToolbar roundedToolBar = new RoundedToolbar(shell, SWT.PUSH);
  
 
  RoundedToolItem item = new RoundedToolItem(roundedToolBar);
 
  RoundedToolItem item = new RoundedToolItem(roundedToolBar);
Line 18: Line 18:
  
 
And ''voilà'' !
 
And ''voilà'' !
 +
 +
Actually, the buttons can be PUSH BUTTON (default behaviour, <code>SWT.PUSH</code>), RADIO BUTTONS(<code>SWT.RADIO</code>) or CHECKBOX BUTTONS(<code>SWT.CHECK</code>).
  
 
You can customize your buttons: selection image, image when not selected or disabled, font color, size...
 
You can customize your buttons: selection image, image when not selected or disabled, font color, size...

Revision as of 18:10, 17 February 2018

Introduction

RoundedToolbar.png

A simple rounded toolbar with grey buttons.

Usage

This is very simple : you instantiate a RoundedToolbar and then you create RoundedToolItems (like the Toolbar widget):

final RoundedToolbar roundedToolBar = new RoundedToolbar(shell, SWT.PUSH);
RoundedToolItem item = new RoundedToolItem(roundedToolBar);
item.setTooltipText("Simple item");
item.setSelectionImage(iconBubble1w);
item.setImage(iconBubble1b);
item.setWidth(40);

And voilà !

Actually, the buttons can be PUSH BUTTON (default behaviour, SWT.PUSH), RADIO BUTTONS(SWT.RADIO) or CHECKBOX BUTTONS(SWT.CHECK).

You can customize your buttons: selection image, image when not selected or disabled, font color, size...

Examples

An example called RoundedToolbarSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.roundedtoolbar.snippets.

This example is also available here : https://git.eclipse.org/c/nebula/org.eclipse.nebula.git/tree/widgets/opal/roundedtoolbar/org.eclipse.nebula.widgets.opal.roundedtoolbar.snippets/src/org/eclipse/nebula/widgets/opal/roundedtoolbar/snippets/RoundedToolbarSnippet.java

Back to the top