GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing wiki.eclipse.org — Nebula Multichoice - Eclipsepedia
Jump to: navigation,
search
Nebula MultichoiceIntroductionThe Multichoice widget looks like a combo box in which you can select multiple items. This widget has been designed to replace a set of comboboxes in a form where I ran out of space. You can "fill" the widget with an array of String or some POJO. In this case, the widget uses the ContentsConstructorsThis widget provides 2 constructors :
The "classical" constructor of a SWT widget. Please notice that once the widget has been created, you have to add data.
This constructor builds the widget and initialises it with a list of elements. Add elementsTo add one or many elements, you can use one of the following methods :
Remove elementsTo remove one or many elements, you can use one of the following methods :
Retrieve selectionTo retrieve information about the elements stored by the widget, you can use one of the following methods :
Select/Deselect elementsTo select one or many elements, you can use one of the following methods :
To add one or many elements, you can use one of the following methods :
Retrieve selected elementsTo get the selected elements, you can use one of the following methods :
Change LookYou can change the look of the widget by using the following methods :
You can also use overrided methods (setForeground, setBackground, setFont...) ListenersThis widget has its own selection listener called public abstract void handle(MultiChoice<T> parent, T receiver, boolean selected, Shell popup) This method is called when an element is selected or de-selected. The arguments are the following :
ExampleYou can find an example of use of this widget called MultiChoiceSnippet in the plugin org.eclipse.nebula.widgets.opal.multichoice.snippets. It uses a POJO called "Country". final String[] euroZone = new String[] { "Austria", "Belgium", "Cyprus", "Estonia", "Finland", "France",
"Germany", "Greece", "Ireland", "Italy", "Luxembourg", "Malta", "Netherlands", "Portugal",
"Slovakia", "Slovenia", "Spain" };
final MultiChoice<String> mcSimple = new MultiChoice<String>(shell, SWT.None); mcSimple.addAll(euroZone); This example is also available here : MultiChoiceSnippet.java This page was last modified 09:22, 20 October 2021 by Eclipsepedia anonymous user Unnamed Poltroon. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |