Module is.codion.swing.common.ui
Interface ComboBoxBuilder<T,C extends JComboBox<T>,B extends ComboBoxBuilder<T,C,B>>
- Type Parameters:
T
- the value typeC
- the component typeB
- the builder type
- All Superinterfaces:
ComponentBuilder<T,
C, B>
- All Known Subinterfaces:
EntityComboBox.Builder
- All Known Implementing Classes:
DefaultComboBoxBuilder
public interface ComboBoxBuilder<T,C extends JComboBox<T>,B extends ComboBoxBuilder<T,C,B>>
extends ComponentBuilder<T,C,B>
Builds a
JComboBox
.-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>>
ComboBoxBuilder<T,C, B> builder
(ComboBoxModel<T> comboBoxModel) static <T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>>
ComboBoxBuilder<T,C, B> builder
(ComboBoxModel<T> comboBoxModel, Value<T> linkedValue) completionMode
(Completion.Mode completionMode) editable
(boolean editable) editor
(ComboBoxEditor editor) static void
enableMouseWheelSelection
(JComboBox<?> comboBox) Enables mouse wheel selection for the given combo boxstatic void
enableMouseWheelSelectionWithWrapAround
(JComboBox<?> comboBox) Enables mouse wheel selection for the given combo box with wrap arounditemListener
(ItemListener itemListener) maximumRowCount
(int maximumRowCount) mouseWheelScrolling
(boolean mouseWheelScrolling) Enable mouse wheel scrolling on the combo boxmouseWheelScrollingWithWrapAround
(boolean mouseWheelScrollingWithWrapAround) Enable mouse wheel scrolling on the combo box, with wrap aroundmoveCaretToFrontOnSelection
(boolean moveCaretToFrontOnSelection) When a JComboBox is editable, and a long item is selected, the caret is moved to the end, hiding the start of the selected item.normalize
(boolean normalize) Specifies whether to normalize strings during auto completionpopupWidth
(int popupWidth) Only applicable for the system and cross-platform Look and Feels.renderer
(ListCellRenderer<T> renderer) Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
background, border, build, build, buildValue, buildValue, clientProperty, componentListener, componentOrientation, consumer, enabled, enabled, focusable, focusCycleRoot, focusListener, font, foreground, keyEvent, keyListener, label, link, link, listener, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onBuildValue, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, transferFocusOnEnter, transferHandler, validator, value, visible
-
Method Details
-
editable
- Parameters:
editable
- specifies whether the combo box should be editable- Returns:
- this builder instance
- See Also:
-
completionMode
- Parameters:
completionMode
- the completion mode- Returns:
- this builder instance
-
normalize
Specifies whether to normalize strings during auto completion- Parameters:
normalize
- true if strings should be normalized during autocomplete- Returns:
- this builder instance
- See Also:
-
renderer
- Parameters:
renderer
- the renderer for the combo box- Returns:
- this builder instance
- See Also:
-
editor
- Parameters:
editor
- the editor for the combo box- Returns:
- this builder instance
- See Also:
-
mouseWheelScrolling
Enable mouse wheel scrolling on the combo box- Parameters:
mouseWheelScrolling
- true if mouse wheel scrolling should be enabled- Returns:
- this builder instance
-
mouseWheelScrollingWithWrapAround
Enable mouse wheel scrolling on the combo box, with wrap around- Parameters:
mouseWheelScrollingWithWrapAround
- true if mouse wheel scrolling with wrap around should be enabled- Returns:
- this builder instance
-
maximumRowCount
- Parameters:
maximumRowCount
- the maximum row count before a scroll bar is shown- Returns:
- this builder instance
- See Also:
-
moveCaretToFrontOnSelection
When a JComboBox is editable, and a long item is selected, the caret is moved to the end, hiding the start of the selected item. Enabling this moves the caret to the front on selection, thereby showing the start of the selected item. Note that this only works in conjunction with aFilterComboBoxModel
. This is enabled by default.- Parameters:
moveCaretToFrontOnSelection
- if true the caret is moved to the front of the editor component on selection, displaying the start of the selected item, instead of the end- Returns:
- this builder instance
-
popupWidth
Only applicable for the system and cross-platform Look and Feels.- Parameters:
popupWidth
- a fixed popup width- Returns:
- this builder instance
-
itemListener
- Parameters:
itemListener
- the item listener- Returns:
- this builder instance
- See Also:
-
builder
static <T,C extends JComboBox<T>, ComboBoxBuilder<T,B extends ComboBoxBuilder<T, C, B>> C, builderB> (ComboBoxModel<T> comboBoxModel) - Type Parameters:
T
- the value typeC
- the component typeB
- the builder type- Parameters:
comboBoxModel
- the combo box model- Returns:
- a builder for a component
-
builder
static <T,C extends JComboBox<T>, ComboBoxBuilder<T,B extends ComboBoxBuilder<T, C, B>> C, builderB> (ComboBoxModel<T> comboBoxModel, Value<T> linkedValue) - Type Parameters:
T
- the value typeC
- the component typeB
- the builder type- Parameters:
comboBoxModel
- the combo box modellinkedValue
- the value to link to the component- Returns:
- a builder for a component
-
enableMouseWheelSelection
Enables mouse wheel selection for the given combo box- Parameters:
comboBox
- the combo box
-
enableMouseWheelSelectionWithWrapAround
Enables mouse wheel selection for the given combo box with wrap around- Parameters:
comboBox
- the combo box
-