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.
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptioncaretListener
(CaretListener caretListener) 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) upperCase
(boolean upperCase) Methods 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, linkedValue, linkedValue, 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
-
Method Details
-
editable
- Parameters:
editable
- false if the component should not be editable- Returns:
- this builder instance
- See Also:
-
updateOn
- 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:
-