Package docking.widgets.values
Class LongValue
Value class for Long Values with an option for display the value as decimal or hex. The
editor component uses an
IntegerTextField
for display and editing the value. This
value supports the concept of no value which is represented by the text field being empty. If
the text field is not empty, then the field only allows valid numeric values.
This class and other subclasses of AbstractValue
are part of a subsystem for easily
defining a set of values that can be displayed in an input dialog (ValuesMapDialog
).
Typically, these values are created indirectly using a GValuesMap
which is then
given to the constructor of the dialog. However, an alternate approach is to create the
dialog without a ValuesMap and then use its ValuesMapDialog.addValue(AbstractValue)
method directly.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromString
(String valueString) Parses the given string into a value of type TReturns a string representation for the value.Returns a JComponent for entering or editing a value of this type.protected void
Updates the JComponent returned fromAbstractValue.getComponent()
to represent the current value of this object.protected void
Causes the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()
-
Constructor Details
-
LongValue
-
LongValue
-
LongValue
-
LongValue
-
-
Method Details
-
getComponent
Description copied from class:AbstractValue
Returns a JComponent for entering or editing a value of this type.- Specified by:
getComponent
in classAbstractValue<Long>
- Returns:
- a JComponent for entering or editing a value of this type.
-
updateValueFromComponent
protected void updateValueFromComponent()Description copied from class:AbstractValue
Causes the stored value for this object to be updated based on the state of the JComponent returned fromAbstractValue.getComponent()
- Specified by:
updateValueFromComponent
in classAbstractValue<Long>
-
updateComponentFromValue
protected void updateComponentFromValue()Description copied from class:AbstractValue
Updates the JComponent returned fromAbstractValue.getComponent()
to represent the current value of this object.- Specified by:
updateComponentFromValue
in classAbstractValue<Long>
-
fromString
Description copied from class:AbstractValue
Parses the given string into a value of type T- Specified by:
fromString
in classAbstractValue<Long>
- Parameters:
valueString
- the string to parse- Returns:
- a value of type T
-
getAsText
Description copied from class:AbstractValue
Returns a string representation for the value. It is expected that the string returned from this method can be parsed by the correspondingAbstractValue.setAsText(String)
method. If the value of this object is null, null will be returned.- Overrides:
getAsText
in classAbstractValue<Long>
- Returns:
- a string representation for the value or null if the value is null
-