Module is.codion.swing.common.ui
Interface TextComponentBuilder<T,C extends JTextComponent,B extends TextComponentBuilder<T,C,B>>
- All Superinterfaces:
ComponentBuilder<T,
C, B>
- All Known Subinterfaces:
NumberField.Builder<T>
,PasswordFieldBuilder
,TemporalField.Builder<T>
,TextAreaBuilder
,TextFieldBuilder<T,
C, B>
public interface TextComponentBuilder<T,C extends JTextComponent,B extends TextComponentBuilder<T,C,B>>
extends ComponentBuilder<T,C,B>
A builder for text components.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Specifies the possible initial caret positions in case text component has an initial value. -
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptioncaretListener
(CaretListener caretListener) caretPosition
(TextComponentBuilder.CaretPosition caretPosition) Specifies the initial caret position for the component in case an initial value is specified.caretUpdatePolicy
(int caretUpdatePolicy) controlDeleteWord
(boolean controlDeleteWord) disabledTextColor
(Color disabledTextColor) dragEnabled
(boolean dragEnabled) editable
(boolean editable) focusAccelerator
(char focusAcceleratorKey) lowerCase
(boolean lowerCase) maximumLength
(int maximumLength) moveCaretToEndOnFocusGained
(boolean moveCaretToEndOnFocusGained) moveCaretToStartOnFocusGained
(boolean moveCaretToStartOnFocusGained) onTextChanged
(Consumer<String> onTextChanged) selectAllOnFocusGained
(boolean selectAllOnFocusGained) Makes the text component select all when it gains focusselectedTextColor
(Color selectedTextColor) selectionColor
(Color selectionColor) DefaultUpdateOn.VALUE_CHANGE
upperCase
(boolean upperCase) 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
- false if the component should not be editable- Returns:
- this builder instance
- See Also:
-
updateOn
DefaultUpdateOn.VALUE_CHANGE
- Parameters:
updateOn
- specifies when the underlying value should be updated- Returns:
- this builder instance
-
upperCase
- Parameters:
upperCase
- if true the text component convert all lower case input to upper case- Returns:
- this builder instance
-
lowerCase
- Parameters:
lowerCase
- if true the text component convert all upper case input to lower case- Returns:
- this builder instance
-
maximumLength
- Parameters:
maximumLength
- the maximum text length- Returns:
- this builder instance
-
margin
- Parameters:
margin
- the margin- Returns:
- this builder instance
- See Also:
-
controlDeleteWord
- Parameters:
controlDeleteWord
- true if CTRL-DEL and CTRL-BACKSPACE should delete the next/previous word- Returns:
- this builder instance
-
disabledTextColor
- Parameters:
disabledTextColor
- the color used to render disabled text- Returns:
- this builder instance
- See Also:
-
selectedTextColor
- Parameters:
selectedTextColor
- the color used to render selected text- Returns:
- this builder instance
- See Also:
-
selectionColor
- Parameters:
selectionColor
- the color used to render selected text background- Returns:
- this builder instance
- See Also:
-
selectAllOnFocusGained
Makes the text component select all when it gains focus- Parameters:
selectAllOnFocusGained
- if true the component will select contents on focus gained- Returns:
- this builder instance
-
moveCaretToEndOnFocusGained
- Parameters:
moveCaretToEndOnFocusGained
- true if the caret should be moved to the end on focus gained- Returns:
- this builder instance
-
moveCaretToStartOnFocusGained
- Parameters:
moveCaretToStartOnFocusGained
- true if the caret should be moved to the start on focus gained- Returns:
- this builder instance
-
caretListener
- Parameters:
caretListener
- the caret listener to add- Returns:
- this builder instance
-
onTextChanged
- Parameters:
onTextChanged
- called when the text changes- Returns:
- this builder instance
-
dragEnabled
- Parameters:
dragEnabled
- true if automatic drag handling should be enabled- Returns:
- this builder instance
- See Also:
-
focusAccelerator
- Parameters:
focusAcceleratorKey
- the focus accelerator key- Returns:
- this builder instance
- See Also:
-
caretPosition
Specifies the initial caret position for the component in case an initial value is specified. DefaultTextComponentBuilder.CaretPosition.START
- Parameters:
caretPosition
- the initial caret position- Returns:
- this builder instance
- See Also:
-
caretUpdatePolicy
- Parameters:
caretUpdatePolicy
- the caret update policy- Returns:
- this builder instance
- See Also:
-