Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface ListSelectionDialogBuilder<T>
- Type Parameters:
T
- the value type
- All Superinterfaces:
DialogBuilder<ListSelectionDialogBuilder<T>>
,SelectionDialogBuilder<T,
ListSelectionDialogBuilder<T>>
public interface ListSelectionDialogBuilder<T>
extends SelectionDialogBuilder<T,ListSelectionDialogBuilder<T>>
A builder for a
JList
based selection dialog.-
Method Summary
Modifier and TypeMethodDescriptioncomparator
(Comparator<T> comparator) defaultSelection
(Collection<T> defaultSelection) defaultSelection
(T defaultSelection) dialogSize
(Dimension dialogSize) select()
Methods inherited from interface is.codion.swing.common.ui.dialog.DialogBuilder
icon, keyEvent, location, locationRelativeTo, onBuild, owner, owner, title, title
Methods inherited from interface is.codion.swing.common.ui.dialog.SelectionDialogBuilder
allowEmptySelection
-
Method Details
-
defaultSelection
- Parameters:
defaultSelection
- the item selected by default- Returns:
- this builder 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 builder instance
- Throws:
IllegalArgumentException
- in case the selection values do not contain the default selection items
-
dialogSize
- Parameters:
dialogSize
- the preferred dialog size- Returns:
- this builder instance
-
comparator
- Parameters:
comparator
- the comparator to use to sort the items- Returns:
- this builder 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
-