Package com._1c.g5.lwt.controls
Class AbstractLightSpinner<T extends Number & Comparable<T>>
- java.lang.Object
-
- com._1c.g5.lwt.AbstractLightControl
-
- com._1c.g5.lwt.LightComposite
-
- com._1c.g5.lwt.AbstractLightContentComposite<C>
-
- com._1c.g5.lwt.controls.LightEditorBar<LightText>
-
- com._1c.g5.lwt.controls.LightTextEditorBar
-
- com._1c.g5.lwt.controls.AbstractLightSpinner<T>
-
- Type Parameters:
T
- Spinner value type.
- All Implemented Interfaces:
IEditable
,ILightComposite
,ILightContentComposite<LightText>
,ILightControl
- Direct Known Subclasses:
BigDecimalLightSpinner
,DoubleLightSpinner
,LightSpinner
,LongLightSpinner
public abstract class AbstractLightSpinner<T extends Number & Comparable<T>> extends LightTextEditorBar
Abstract parent for all spinners.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLightSpinner(boolean nullable)
The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addValueListener(IChangedListener<AbstractLightSpinner<T>,T> listener)
Adds the value listener.protected abstract T
getDefaultMaximum()
Gets the default maximum value.protected abstract T
getDefaultMinimum()
Gets the default minimum value.protected abstract T
getInvalidValue()
Gets the invalid value.T
getMaximum()
Gets the maximum allowed value.T
getMinimum()
Gets the minimum allowed value.T
getValue()
Gets the value of this spinner.protected abstract Pattern
getVerifyPattern()
Gets the verify pattern for value.protected abstract T
nextValue(T value)
Gets the next value to given value.protected abstract T
parseValue(String text)
Parses value from given text.protected abstract T
previousValue(T value)
Gets the previous value to given value.void
removeValueListener(IChangedListener<AbstractLightSpinner<T>,T> listener)
Removes the value listener.void
setEditable(boolean isEditable, Predicate<LightImageButton> buttonsEnablementPredicate)
Sets control editable state and configures buttons enabled state.void
setMaximum(T maximum)
Sets the maximum allowed value.void
setMinimum(T minimum)
Sets the minimum allowed value.void
setValue(T value)
Sets the value of this spinner.-
Methods inherited from class com._1c.g5.lwt.controls.LightTextEditorBar
addButton, getButtons, isTextEditable, removeButton, setEditable, setTextEditable
-
Methods inherited from class com._1c.g5.lwt.controls.LightEditorBar
contentSet, contentUnset, getBackgroundColor, getBorderColor, getImage, getLeftSide, getRightSide, isEditable, paint, setBackgroundColor, setBorderColor, setEnabled, setImage, setVisible
-
Methods inherited from class com._1c.g5.lwt.AbstractLightContentComposite
getContent, setContent
-
Methods inherited from class com._1c.g5.lwt.LightComposite
addChild, addChild, addChildAfter, addLayerAbove, addLayerBehind, computeSize, controlFromPoint, dispose, getActiveControl, getChildCount, getChildren, getLayers, getLayout, layout, layout, removeChild, removeChild, revealRectangle, setActiveControl, setBounds, setFocus, setLayout, translatePointFromControl, translatePointToControl, translateRectangleFromControl, translateRectangleToControl, traverse, traverse
-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, handleEvent, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setFocusable, setLayoutData, setOverlay, setParent, setTooltip
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.lwt.ILightComposite
getMainLayer
-
Methods inherited from interface com._1c.g5.lwt.ILightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getParent, getTooltip, getVisibleBounds, handleEvent, initialize, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setLayoutData, setParent, setTooltip
-
-
-
-
Method Detail
-
addValueListener
public void addValueListener(IChangedListener<AbstractLightSpinner<T>,T> listener)
Adds the value listener.- Parameters:
listener
- the listener to add, should not benull
.
-
getMaximum
public T getMaximum()
Gets the maximum allowed value.- Returns:
- the maximum value.
-
getMinimum
public T getMinimum()
Gets the minimum allowed value.- Returns:
- the minimum value.
-
getValue
public T getValue()
Gets the value of this spinner.- Returns:
- the value;
-
removeValueListener
public void removeValueListener(IChangedListener<AbstractLightSpinner<T>,T> listener)
Removes the value listener.- Parameters:
listener
- the listener to remove, should not benull
.
-
setMaximum
public void setMaximum(T maximum)
Sets the maximum allowed value.- Parameters:
maximum
- the new maximum value.
-
setMinimum
public void setMinimum(T minimum)
Sets the minimum allowed value.- Parameters:
minimum
- the new minimum value.
-
setValue
public void setValue(T value)
Sets the value of this spinner.- Parameters:
value
- the value to set.
-
setEditable
public void setEditable(boolean isEditable, Predicate<LightImageButton> buttonsEnablementPredicate)
Description copied from class:LightTextEditorBar
Sets control editable state and configures buttons enabled state.- Overrides:
setEditable
in classLightTextEditorBar
- Parameters:
isEditable
- -true
if control is editable.buttonsEnablementPredicate
- - predicate to configure buttons enabled state. Can't benull
.
-
getDefaultMaximum
protected abstract T getDefaultMaximum()
Gets the default maximum value.- Returns:
- The default maximum value.
-
getDefaultMinimum
protected abstract T getDefaultMinimum()
Gets the default minimum value.- Returns:
- The default minimum value.
-
getInvalidValue
protected abstract T getInvalidValue()
Gets the invalid value.- Returns:
- The invalid value.
-
getVerifyPattern
protected abstract Pattern getVerifyPattern()
Gets the verify pattern for value.- Returns:
- The verify pattern.
-
nextValue
protected abstract T nextValue(T value)
Gets the next value to given value.- Parameters:
value
- The given value.- Returns:
- The next value.
-
parseValue
protected abstract T parseValue(String text)
Parses value from given text.- Parameters:
text
- The given text.- Returns:
- The parsed value.
-
-