Module is.codion.swing.common.ui
Interface NumberField.Builder<T extends Number>
- Type Parameters:
T
- the value type
- All Superinterfaces:
ComponentBuilder<T,
,NumberField<T>, NumberField.Builder<T>> TextComponentBuilder<T,
,NumberField<T>, NumberField.Builder<T>> TextFieldBuilder<T,
NumberField<T>, NumberField.Builder<T>>
- Enclosing class:
- NumberField<T extends Number>
public static interface NumberField.Builder<T extends Number>
extends TextFieldBuilder<T,NumberField<T>,NumberField.Builder<T>>
Builds a NumberField
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.swing.common.ui.component.text.TextComponentBuilder
TextComponentBuilder.CaretPosition
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
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 fieldgroupingSeparator
(char groupingSeparator) groupingUsed
(boolean groupingUsed) Note that this is overridden byTextFieldBuilder.format(java.text.Format)
.maximumFractionDigits
(int maximumFractionDigits) maximumValue
(Number maximumValue) minimumValue
(Number minimumValue) nullable
(boolean nullable) Specifies whether theComponentValue
created by this builder is nullable, default true.silentValidation
(boolean silentValidation) valueRange
(Number minimumValue, Number maximumValue) 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
Methods inherited from interface is.codion.swing.common.ui.component.text.TextComponentBuilder
caretListener, caretPosition, caretUpdatePolicy, controlDeleteWord, disabledTextColor, dragEnabled, editable, focusAccelerator, lowerCase, margin, maximumLength, moveCaretToEndOnFocusGained, moveCaretToStartOnFocusGained, onTextChanged, selectAllOnFocusGained, selectedTextColor, selectionColor, updateOn, upperCase
Methods inherited from interface is.codion.swing.common.ui.component.text.TextFieldBuilder
action, actionListener, columns, format, hint, horizontalAlignment, selector
-
Method Details
-
nullable
Specifies whether theComponentValue
created 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 theComponentValue
returns 0 when the field contains no value- Returns:
- this builder instance
-
valueRange
- Parameters:
minimumValue
- the minimum valuemaximumValue
- the maximum value- Returns:
- this builder instance
-
minimumValue
- Parameters:
minimumValue
- the minimum numerical value- Returns:
- this builder instance
-
maximumValue
- Parameters:
maximumValue
- the maximum numerical value- Returns:
- this builder instance
-
silentValidation
- Parameters:
silentValidation
- true if invalid input should be silently prevented instead of throwing validation exceptions- Returns:
- this builder instance
-
groupingSeparator
- Parameters:
groupingSeparator
- the grouping separator- Returns:
- this builder instance
-
groupingUsed
Note that this is overridden byTextFieldBuilder.format(java.text.Format)
.- Parameters:
groupingUsed
- true if grouping should be used- Returns:
- this builder instance
-
maximumFractionDigits
- Parameters:
maximumFractionDigits
- 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:
-