|
||||||||||
| 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(NumberUtil pNumberUtil)
Constructs a new NumberFormatter with a specific number format. |
|
| Method Summary | |
|---|---|
IDataType |
getDataType()
Gets the data type. |
protected javax.swing.text.DocumentFilter |
getDocumentFilter()
|
java.text.NumberFormat |
getNumberFormat()
Gets the number format. |
java.lang.String |
getNumberPattern()
Gets the number pattern. |
void |
replaceAllowed(javax.swing.text.DocumentFilter.FilterBypass pFb,
int pOffset,
int pLength,
java.lang.String pText,
javax.swing.text.AttributeSet pAttr)
Replaces only the allowed text. |
void |
setDataType(IDataType pDataType)
Sets the data type. |
void |
setNumberFormat(java.text.NumberFormat pNumberFormat)
Gets the number format. |
void |
setNumberPattern(java.lang.String pNumberPattern)
Gets the number pattern. |
java.lang.Object |
stringToValue(java.lang.String pText)
|
java.lang.String |
valueToString(java.lang.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(NumberUtil pNumberUtil)
NumberFormatter with a specific number format.
pNumberUtil - the number format| Method Detail |
|---|
protected javax.swing.text.DocumentFilter getDocumentFilter()
getDocumentFilter in class javax.swing.JFormattedTextField.AbstractFormatter
public java.lang.Object stringToValue(java.lang.String pText)
throws java.text.ParseException
stringToValue in class javax.swing.JFormattedTextField.AbstractFormatterjava.text.ParseException
public java.lang.String valueToString(java.lang.Object pValue)
throws java.text.ParseException
valueToString in class javax.swing.JFormattedTextField.AbstractFormatterjava.text.ParseExceptionpublic IDataType getDataType()
public void setDataType(IDataType pDataType)
pDataType - the data type.public java.text.NumberFormat getNumberFormat()
public void setNumberFormat(java.text.NumberFormat pNumberFormat)
pNumberFormat - the number format.public java.lang.String getNumberPattern()
public void setNumberPattern(java.lang.String pNumberPattern)
pNumberPattern - the number pattern.
public void replaceAllowed(javax.swing.text.DocumentFilter.FilterBypass pFb,
int pOffset,
int pLength,
java.lang.String pText,
javax.swing.text.AttributeSet pAttr)
throws javax.swing.text.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.
javax.swing.text.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 | |||||||||