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
FieldsFields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
TRANSFER_FOCUS_ON_ENTER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultComboBoxBuilder(ComboBoxModel<T> comboBoxModel, is.codion.common.value.Value<T> linkedValue) -
Method Summary
Modifier and TypeMethodDescriptionfinal BcompletionMode(Completion.Mode completionMode) protected Cprotected final CCreates the component.protected final ComponentValue<T,C> createComponentValue(C component) Creates the component valuefinal Beditable(boolean editable) final Beditor(ComboBoxEditor editor) final BitemListener(ItemListener itemListener) final BmaximumRowCount(int maximumRowCount) final BmouseWheelScrolling(boolean mouseWheelScrolling) Enable mouse wheel scrolling on the combo boxfinal BmouseWheelScrollingWithWrapAround(boolean mouseWheelScrollingWithWrapAround) Enable mouse wheel scrolling on the combo box, with wrap aroundfinal BmoveCaretToFrontOnSelection(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 BpopupWidth(int popupWidth) Only used for the system and cross-platform Look and Feels.final Brenderer(ListCellRenderer<T> renderer) protected final voidsetInitialValue(C component, T initialValue) Sets the initial value in the component, only called for non-null values.Methods inherited from class is.codion.swing.common.ui.component.builder.AbstractComponentBuilder
background, border, build, build, buildValue, clear, clientProperty, componentListener, componentOrientation, enabled, enabled, enableTransferFocusOnEnter, focusable, focusCycleRoot, focusListener, font, foreground, initialValue, keyEvent, keyListener, label, link, link, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, onBuild, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, supportsNull, toolTipText, transferFocusOnEnter, transferHandler, validator, visibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
background, border, build, build, buildValue, clear, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusCycleRoot, focusListener, font, foreground, initialValue, keyEvent, keyListener, label, link, link, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, onBuild, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, transferFocusOnEnter, transferHandler, validator, visible
-
Field Details
-
comboBoxModel
-
-
Constructor Details
-
DefaultComboBoxBuilder
protected DefaultComboBoxBuilder(ComboBoxModel<T> comboBoxModel, is.codion.common.value.Value<T> linkedValue)
-
-
Method Details
-
editable
-
completionMode
- Specified by:
completionModein interfaceComboBoxBuilder<T,C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
completionMode- the completion mode- Returns:
- this builder instance
-
renderer
-
editor
-
mouseWheelScrolling
Description copied from interface:ComboBoxBuilderEnable mouse wheel scrolling on the combo box- Specified by:
mouseWheelScrollingin 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:ComboBoxBuilderEnable mouse wheel scrolling on the combo box, with wrap around- Specified by:
mouseWheelScrollingWithWrapAroundin 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:
maximumRowCountin 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:ComboBoxBuilderWhen 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 forFilteredComboBoxModel. This is enabled by default.- Specified by:
moveCaretToFrontOnSelectionin 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:ComboBoxBuilderOnly used for the system and cross-platform Look and Feels.- Specified by:
popupWidthin 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:
itemListenerin 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:AbstractComponentBuilderCreates the component.- Specified by:
createComponentin classAbstractComponentBuilder<T,C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Returns:
- a new component instance
-
createComponentValue
Description copied from class:AbstractComponentBuilderCreates the component value- Specified by:
createComponentValuein classAbstractComponentBuilder<T,C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
component- the component- Returns:
- a component value based on the component
-
setInitialValue
Description copied from class:AbstractComponentBuilderSets the initial value in the component, only called for non-null values.- Specified by:
setInitialValuein classAbstractComponentBuilder<T,C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> - Parameters:
component- the componentinitialValue- the initial value, not null
-
createComboBox
-