|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
chrriis.dj.swingsuite.JTextEntryField
chrriis.dj.swingsuite.JNumberEntryField<T>
public class JNumberEntryField<T extends Number & Comparable<T>>
An entry field for number types (Byte, Short, Integer, Long, BigInteger, Float, Double, BigDecimal).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTextField |
---|
JTextField.AccessibleJTextField |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JTextField |
---|
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JNumberEntryField(T number)
Construct a number entry field. |
|
JNumberEntryField(T number,
int columns)
Construct a number entry field. |
|
JNumberEntryField(T number,
int columns,
int decimalCount)
Construct a number entry field. |
|
JNumberEntryField(T number,
int columns,
int decimalCount,
T rangeMin,
T rangeMax)
Construct a number entry field. |
|
JNumberEntryField(T number,
int columns,
int decimalCount,
T rangeMin,
T rangeMax,
boolean isNullAllowed)
Construct a number entry field. |
|
JNumberEntryField(T number,
int columns,
T rangeMin,
T rangeMax)
Construct a number entry field. |
|
JNumberEntryField(T number,
int columns,
T rangeMin,
T rangeMax,
boolean isNullAllowed)
Construct a number entry field. |
|
JNumberEntryField(T number,
T rangeMin,
T rangeMax)
Construct a number entry field. |
|
JNumberEntryField(T number,
T rangeMin,
T rangeMax,
boolean isNullAllowed)
Construct a number entry field. |
Method Summary | |
---|---|
int |
getDecimalCount()
Get the number of decimals. |
T |
getNumber()
Get a valid number, which is the current number if it is valid or the last valid one. |
boolean |
isNullAllowed()
|
void |
replaceSelection(String content)
|
void |
setDecimalCount(int decimalCount)
Set the number of decimals, which has an effect only if the number type accepts decimals. |
void |
setNullAllowed(boolean isNullAllowed)
Set whether this range accepts null. |
void |
setNumber(T number)
Set some number, which only works when the number to set is valid. |
void |
setRange(T rangeMin,
T rangeMax)
Set the range of this field. |
void |
setValidator(TextEntryValidator validator)
Set the text validator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JNumberEntryField(T number)
number
- the default number.public JNumberEntryField(T number, T rangeMin, T rangeMax)
number
- the default number.rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.public JNumberEntryField(T number, T rangeMin, T rangeMax, boolean isNullAllowed)
number
- the default number.rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.isNullAllowed
- true if null is allowed, false otherwise.public JNumberEntryField(T number, int columns)
number
- the default number.columns
- The number of columns used to calculate the preferred width, or zero for the default size calculation.public JNumberEntryField(T number, int columns, int decimalCount)
number
- the default number.columns
- The number of columns used to calculate the preferred width, or zero for the default size calculation.decimalCount
- the number of decimals allowed.public JNumberEntryField(T number, int columns, T rangeMin, T rangeMax)
number
- the default number.columns
- The number of columns used to calculate the preferred width, or zero for the default size calculation.rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.public JNumberEntryField(T number, int columns, T rangeMin, T rangeMax, boolean isNullAllowed)
number
- the default number.columns
- The number of columns used to calculate the preferred width, or zero for the default size calculation.rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.isNullAllowed
- true if null is allowed, false otherwise.public JNumberEntryField(T number, int columns, int decimalCount, T rangeMin, T rangeMax)
number
- the default number.columns
- The number of columns used to calculate the preferred width, or zero for the default size calculation.decimalCount
- the number of decimals allowed.rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.public JNumberEntryField(T number, int columns, int decimalCount, T rangeMin, T rangeMax, boolean isNullAllowed)
number
- the default number.columns
- The number of columns used to calculate the preferred width, or zero for the default size calculation.decimalCount
- the number of decimals allowed.rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.isNullAllowed
- true if null is allowed, false otherwise.Method Detail |
---|
public void replaceSelection(String content)
replaceSelection
in class JTextComponent
public void setValidator(TextEntryValidator validator)
setValidator
in class JTextEntryField
validator
- The new number validator, or null to install the default number validator.public void setRange(T rangeMin, T rangeMax)
rangeMin
- the minimum number authorized by the range.rangeMax
- the maximum number authorized by the range.public void setNullAllowed(boolean isNullAllowed)
isNullAllowed
- true if null is allowed, false otherwise.public boolean isNullAllowed()
public void setDecimalCount(int decimalCount)
decimalCount
- the number of decimals allowed, or a negative value to remove any limitation.public int getDecimalCount()
public T getNumber()
public void setNumber(T number)
number
- The number to set.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |