Module is.codion.swing.common.ui
Class DefaultComboBoxBuilder<T,C extends JComboBox<T>,B extends ComboBoxBuilder<T,C,B>>
java.lang.Object
is.codion.swing.common.ui.component.builder.AbstractComponentBuilder<T,C,B>
is.codion.swing.common.ui.component.combobox.DefaultComboBoxBuilder<T,C,B>
- All Implemented Interfaces:
ComponentBuilder<T,
,C, B> ComboBoxBuilder<T,
C, B>
public class DefaultComboBoxBuilder<T,C extends JComboBox<T>,B extends ComboBoxBuilder<T,C,B>>
extends AbstractComponentBuilder<T,C,B>
implements ComboBoxBuilder<T,C,B>
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultComboBoxBuilder
(ComboBoxModel<T> comboBoxModel, Value<T> linkedValue) -
Method Summary
Modifier and TypeMethodDescriptionfinal B
completionMode
(Completion.Mode completionMode) protected C
protected final C
Creates the component.protected final ComponentValue<T,
C> createComponentValue
(C component) Creates the component valuefinal B
editable
(boolean editable) final B
editor
(ComboBoxEditor editor) final B
itemListener
(ItemListener itemListener) final B
maximumRowCount
(int maximumRowCount) final B
mouseWheelScrolling
(boolean mouseWheelScrolling) Enable mouse wheel scrolling on the combo boxfinal B
mouseWheelScrollingWithWrapAround
(boolean mouseWheelScrollingWithWrapAround) Enable mouse wheel scrolling on the combo box, with wrap aroundfinal B
moveCaretToFrontOnSelection
(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.final B
normalize
(boolean normalize) Specifies whether to normalize strings during auto completionfinal B
popupWidth
(int popupWidth) Only applicable for the system and cross-platform Look and Feels.final B
renderer
(ListCellRenderer<T> renderer) Methods inherited from class is.codion.swing.common.ui.component.builder.AbstractComponentBuilder
background, border, build, build, buildValue, buildValue, clientProperty, componentListener, componentOrientation, consumer, enabled, enabled, enableTransferFocusOnEnter, 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, self, supportsNull, toolTipText, transferFocusOnEnter, transferHandler, validator, value, visible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
-
Field Details
-
comboBoxModel
-
-
Constructor Details
-
DefaultComboBoxBuilder
-
-
Method Details
-
editable
-
completionMode
- Specified by:
completionMode
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
completionMode
- the completion mode- Returns:
- this builder instance
-
normalize
Description copied from interface:ComboBoxBuilder
Specifies whether to normalize strings during auto completion -
renderer
-
editor
-
mouseWheelScrolling
Description copied from interface:ComboBoxBuilder
Enable mouse wheel scrolling on the combo box- Specified by:
mouseWheelScrolling
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
mouseWheelScrolling
- true if mouse wheel scrolling should be enabled- Returns:
- this builder instance
-
mouseWheelScrollingWithWrapAround
Description copied from interface:ComboBoxBuilder
Enable mouse wheel scrolling on the combo box, with wrap around- Specified by:
mouseWheelScrollingWithWrapAround
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
mouseWheelScrollingWithWrapAround
- true if mouse wheel scrolling with wrap around should be enabled- Returns:
- this builder instance
-
maximumRowCount
- Specified by:
maximumRowCount
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
maximumRowCount
- the maximum row count before a scroll bar is shown- Returns:
- this builder instance
- See Also:
-
moveCaretToFrontOnSelection
Description copied from interface:ComboBoxBuilder
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.- Specified by:
moveCaretToFrontOnSelection
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - 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
Description copied from interface:ComboBoxBuilder
Only applicable for the system and cross-platform Look and Feels.- Specified by:
popupWidth
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
popupWidth
- a fixed popup width- Returns:
- this builder instance
-
itemListener
- Specified by:
itemListener
in interfaceComboBoxBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
itemListener
- the item listener- Returns:
- this builder instance
- See Also:
-
createComponent
Description copied from class:AbstractComponentBuilder
Creates the component.- Specified by:
createComponent
in classAbstractComponentBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Returns:
- a new component instance
-
createComponentValue
Description copied from class:AbstractComponentBuilder
Creates the component value- Specified by:
createComponentValue
in classAbstractComponentBuilder<T,
C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
component
- the component- Returns:
- a component value based on the component
-
createComboBox
-