Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface SelectionDialogBuilder<T>
- Type Parameters:
T
- the value type
- All Superinterfaces:
DialogBuilder<SelectionDialogBuilder<T>>
A builder for a selection dialog.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Provides the user with the ability to select one or more values.static interface
Provides the user with the ability to select a single value. -
Method Summary
Modifier and TypeMethodDescriptionallowEmptySelection
(boolean allowEmptySelection) defaultSelection
(Collection<T> defaultSelection) defaultSelection
(T defaultSelection) select()
Methods inherited from interface is.codion.swing.common.ui.dialog.DialogBuilder
icon, keyEvent, location, locationRelativeTo, owner, owner, title, titleProvider
-
Method Details
-
defaultSelection
- Parameters:
defaultSelection
- the item selected by default- Returns:
- this SelectionDialogBuilder instance
- Throws:
IllegalArgumentException
- in case the selection values do not contain the default selection item
-
defaultSelection
- Parameters:
defaultSelection
- the items selected by default- Returns:
- this SelectionDialogBuilder instance
- Throws:
IllegalArgumentException
- in case the selection values do not contain the default selection items
-
allowEmptySelection
- Parameters:
allowEmptySelection
- if true then the dialog accepts an empty selection, default false- Returns:
- this SelectionDialogBuilder instance
-
selectSingle
- Returns:
- the selected value,
Optional.empty()
if none was selected - Throws:
CancelException
- in case the user cancelled
-
select
Collection<T> select()- Returns:
- the selected values, an empty Collection if none was selected
- Throws:
CancelException
- in case the user cancelled
-