Constructor and Description |
---|
Select(String name,
boolean multiple) |
Select(String name,
boolean multiple,
String[] options) |
Modifier and Type | Method and Description |
---|---|
Select |
add(Enumeration e) |
Composite |
add(Object o)
Add option and specify if selected.
|
Select |
add(Object o,
boolean selected)
Add option and specify if selected.
|
Select |
add(Object o,
boolean selected,
String value)
Add an option.
|
Select |
add(String[] arr,
int selected)
Build a select from the given array of Strings.
|
Select |
add(String[] arr,
String selected)
Build a select from the given array of Strings.
|
static int |
bitsetFormResult(String result)
Utility function for multi-selectors.
|
Select |
setSize(int size)
Set the number of options to display at once
|
contents, nest, replace, reset, setNest, size, unnest
public Select(String name, boolean multiple)
name
- Name of the form elementmultiple
- Whether multiple selections can be madepublic Select setSize(int size)
public Select add(Enumeration e)
public Select add(Object o, boolean selected, String value)
o
- The name of the option (displayed in the form)selected
- Whether the option is selectedvalue
- The value of this option (returned in the form content)public Select add(String[] arr, int selected)
arr
- The array of strings for labelsselected
- The index of the selected label, -1 for defaultpublic Select add(String[] arr, String selected)
arr
- The array of strings for labelsselected
- The index of the selected label, -1 for defaultpublic static int bitsetFormResult(String result)
This function takes the result returned by a multi-select input and produces an integer bit-set result of the selections made. It assumes the values of the multi-select are all different powers of 2.
Copyright © 2013. All rights reserved.