Module is.codion.swing.common.ui
Interface NumberField.Builder<T extends Number>
- Type Parameters:
T- the value type
- All Superinterfaces:
ComponentBuilder<NumberField<T>,,NumberField.Builder<T>> ComponentValueBuilder<NumberField<T>,,T, NumberField.Builder<T>> Supplier<NumberField<T>>,TextComponentBuilder<NumberField<T>,,T, NumberField.Builder<T>> TextFieldBuilder<NumberField<T>,T, NumberField.Builder<T>>
- Enclosing class:
NumberField<T extends Number>
public static interface NumberField.Builder<T extends Number>
extends TextFieldBuilder<NumberField<T>,T,NumberField.Builder<T>>
Builds a NumberField
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface is.codion.swing.common.ui.component.text.TextComponentBuilder
TextComponentBuilder.CaretPositionNested classes/interfaces inherited from interface is.codion.swing.common.ui.component.text.TextFieldBuilder
TextFieldBuilder.ValueClassStep -
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentValueBuilder
COMPONENT_VALUEFields inherited from interface is.codion.swing.common.ui.component.text.TextFieldBuilder
SELECT_ALL_ON_FOCUS_GAINED -
Method Summary
Modifier and TypeMethodDescriptionconvertGroupingToDecimalSeparator(boolean convertGroupingToDecimalSeparator) Specifies whether the number field should convert a grouping separator symbol to a decimal separator symbol when typed.decimalSeparator(char decimalSeparator) Set the decimal separator for this fieldfractionDigits(int fractionDigits) grouping(boolean grouping) Note that this is overridden byTextFieldBuilder.format(java.text.Format).groupingSeparator(char groupingSeparator) nullable(boolean nullable) Specifies whether theComponentValuecreated by this builder is nullable, default true.Specifies the range of valid values, a Short, Integer or Long based field is always limited to the range of its type.Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
ancestorListener, background, border, build, build, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusable, focusCycleRoot, focusListener, font, font, foreground, get, hierarchyListener, keyEvent, keyListener, label, label, label, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onSetVisible, opaque, popupControl, popupControls, popupControls, popupMenu, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, toolTipText, transferFocusOnEnter, transferFocusOnEnter, transferHandler, visible, visibleMethods inherited from interface is.codion.swing.common.ui.component.builder.ComponentValueBuilder
buildValue, buildValue, changeConsumer, changeListener, consumer, link, link, listener, modified, modifiedIndicator, onBuildValue, valid, valid, validationIndicator, validator, value, warned, weakChangeConsumer, weakChangeListener, weakConsumer, weakListener, when, when, when, whenMethods inherited from interface is.codion.swing.common.ui.component.text.TextComponentBuilder
caretListener, caretPosition, caretUpdatePolicy, controlDeleteWord, disabledTextColor, documentListener, dragEnabled, editable, focusAccelerator, lowerCase, margin, maximumLength, moveCaretToEndOnFocusGained, moveCaretToStartOnFocusGained, selectAllOnFocusGained, selectedTextColor, selectionColor, updateOn, upperCaseMethods inherited from interface is.codion.swing.common.ui.component.text.TextFieldBuilder
action, actionListener, columns, format, hint, horizontalAlignment
-
Method Details
-
nullable
Specifies whether theComponentValuecreated by this builder is nullable, default true. Note that setting this to false does not prevent the field from containing no value.- Parameters:
nullable- if false then theComponentValuereturns 0 when the field contains no value- Returns:
- this builder instance
-
range
Specifies the range of valid values, a Short, Integer or Long based field is always limited to the range of its type.
Typing is rejected silently when it results in a value outside the range, while a longer edit, such as a paste, or setting a value outside the range throws
IllegalArgumentException.Note that a value is typed one digit at a time, starting from zero, so a typed value may be between zero and the range, such as 5 on the way to 50 in a field with the range 10 to 100.
- Parameters:
minimum- the minimum valuemaximum- the maximum value- Returns:
- this builder instance
-
minimum
- Parameters:
minimum- the minimum numerical value- Returns:
- this builder instance
- See Also:
-
maximum
- Parameters:
maximum- the maximum numerical value- Returns:
- this builder instance
- See Also:
-
groupingSeparator
- Parameters:
groupingSeparator- the grouping separator- Returns:
- this builder instance
-
grouping
Note that this is overridden byTextFieldBuilder.format(java.text.Format).- Parameters:
grouping- true if grouping should be used- Returns:
- this builder instance
- See Also:
-
fractionDigits
- Parameters:
fractionDigits- the maximum fraction digits- Returns:
- this builder instance
-
decimalSeparator
Set the decimal separator for this field- Parameters:
decimalSeparator- the decimal separator- Returns:
- this builder instance
- Throws:
IllegalArgumentException- in case the decimal separator is the same as the grouping separator
-
convertGroupingToDecimalSeparator
Specifies whether the number field should convert a grouping separator symbol to a decimal separator symbol when typed. This solves the problem of locale controlling whether the numpad comma acts as a decimal symbol, which is usually what we want.- Parameters:
convertGroupingToDecimalSeparator- true if grouping separators should be converted to decimal separators when typed- Returns:
- this builder instance
- See Also:
-