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 Chips"

(Created page with "< Back to Nebula Main Page ==Introduction== File:Chips.png This widget displays a round-shaded button. It could be used for example to filter a list of data...")
 
 
Line 18: Line 18:
 
  final Chips chip3 = new Chips(cmp, SWT.CHECK | SWT.CLOSE);
 
  final Chips chip3 = new Chips(cmp, SWT.CHECK | SWT.CLOSE);
  
This widget is highly customizable : you can change the background color, the foreground color, the border color, ... You can also customize these colors when the mouse is hover, when the button is "selected" (toggle on), ...
+
This widget is highly customizable : you can change the background color, the foreground color, the border color, ... You can also customize these colors when the mouse is hover, when the button is "selected" (toggle on), ... For that, just call the relevant setters. I recommand you to look at the snippet, which shows all possibilities.
  
 
==Example==
 
==Example==

Latest revision as of 06:15, 19 March 2020

< Back to Nebula Main Page

Introduction

Chips.png

This widget displays a round-shaded button. It could be used for example to filter a list of data (like the tags in blogs)

Usage

The first thing to do is instatiate the widget. 2 style flags can be applied : SWT.PUSH to create a Chip displayed like a toogle button or SWT.CHECK to create a Chip that reacts like a checkbox. You can use the SWT.CLOSE flag to display a "close" button.

final Chips chip1 = new Chips(cmp, SWT.NONE);
final Chips chip2 = new Chips(cmp, SWT.CLOSE);
final Chips chip3 = new Chips(cmp, SWT.CHECK | SWT.CLOSE);

This widget is highly customizable : you can change the background color, the foreground color, the border color, ... You can also customize these colors when the mouse is hover, when the button is "selected" (toggle on), ... For that, just call the relevant setters. I recommand you to look at the snippet, which shows all possibilities.

Example

An example called ChipsSnippet.java is located in the plugin org.eclipse.nebula.widgets.chips.snippets.

This example is also available here : ChipsSnippet.java

Back to the top