|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.JFormattedTextField.AbstractFormatter
com.sibvisions.rad.ui.swing.ext.text.NumberFormatter
public class NumberFormatter
The NumberFormatter
can handle null values and empty Strings and handle complex number formats.
Constructor Summary | |
---|---|
NumberFormatter()
Constructs a new NumberFormatter with default number format. |
|
NumberFormatter(NumberFormat pNumberFormat)
Constructs a new NumberFormatter with a specific number format. |
Method Summary | |
---|---|
IDataType |
getDataType()
Gets the data type. |
protected DocumentFilter |
getDocumentFilter()
|
NumberFormat |
getNumberFormat()
Gets the number format. |
String |
getNumberPattern()
Gets the number pattern. |
void |
replaceAllowed(DocumentFilter.FilterBypass pFb,
int pOffset,
int pLength,
String pText,
AttributeSet pAttr)
Replaces only the allowed text. |
void |
setDataType(IDataType pDataType)
Sets the data type. |
void |
setNumberFormat(NumberFormat pNumberFormat)
Gets the number format. |
void |
setNumberPattern(String pNumberPattern)
Gets the number pattern. |
Object |
stringToValue(String pText)
|
String |
valueToString(Object pValue)
|
Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter |
---|
clone, getActions, getFormattedTextField, getNavigationFilter, install, invalidEdit, setEditValid, uninstall |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumberFormatter()
NumberFormatter
with default number format.
public NumberFormatter(NumberFormat pNumberFormat)
NumberFormatter
with a specific number format.
pNumberFormat
- the number formatMethod Detail |
---|
protected DocumentFilter getDocumentFilter()
getDocumentFilter
in class JFormattedTextField.AbstractFormatter
public Object stringToValue(String pText) throws ParseException
stringToValue
in class JFormattedTextField.AbstractFormatter
ParseException
public String valueToString(Object pValue) throws ParseException
valueToString
in class JFormattedTextField.AbstractFormatter
ParseException
public IDataType getDataType()
public void setDataType(IDataType pDataType)
pDataType
- the data type.public NumberFormat getNumberFormat()
public void setNumberFormat(NumberFormat pNumberFormat)
pNumberFormat
- the number format.public String getNumberPattern()
public void setNumberPattern(String pNumberPattern)
pNumberPattern
- the number pattern.public void replaceAllowed(DocumentFilter.FilterBypass pFb, int pOffset, int pLength, String pText, AttributeSet pAttr) throws BadLocationException
pFb
- Filter bypasspOffset
- Location in DocumentpLength
- Length of text to deletepText
- Text to insert, null indicates no text to insertpAttr
- AttributeSet indicating attributes of inserted text, null is legal.
BadLocationException
- the given insert is not a valid position within the document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |