public class NumberDocument extends G9Document
Document model for fields with number formatting.AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElementlineLimitAttribute, tabSizeAttributeBAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameStreamDescriptionProperty, TitleProperty| Constructor and Description |
|---|
NumberDocument(int datatype,
String inputFormat,
String outputFormat,
int maxLength,
int sign,
boolean blankWhenZero,
boolean isG9Numeric)
Creates a new NumberDocument
|
| Modifier and Type | Method and Description |
|---|---|
String |
format()
Default implementation is to return
getValue().toString |
boolean |
getBlankWhenZero()
Determines if the blankWhenZero property is true.
|
String |
getOutputText()
Returns the output text representation of the value object when display
rules are applied.
|
Object |
getValue() |
Object |
getZeroValue() |
void |
insertString(int offset,
String str,
AttributeSet attr) |
Object |
parse(String str)
Parse the number string according to the internal format.
|
void |
setBlankWhenZero(boolean aBlankWhenZero)
Sets the value of the blankWhenZero property.
|
void |
setValue(Object value) |
Object |
transform(Object o)
Internal use! Transform an object to the text version and back.
|
format, getDatatype, getInputFormat, getInputMode, getMaxLength, getName, getOutputFormat, setInputFormat, setInputMode, setMaxLength, setName, setOutputFormat, toStringcreateDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdateaddDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlockpublic NumberDocument(int datatype,
String inputFormat,
String outputFormat,
int maxLength,
int sign,
boolean blankWhenZero,
boolean isG9Numeric)
datatype - the type of datainputFormat - the input formatoutputFormat - the output formatmaxLength - the max lengthsign - the signblankWhenZero - the blank when zero propertypublic boolean getBlankWhenZero()
true if the blankWhenZero property is truepublic void setBlankWhenZero(boolean aBlankWhenZero)
aBlankWhenZero - the new value of the blankWhenZero propertypublic void insertString(int offset,
String str,
AttributeSet attr)
throws BadLocationException
insertString in interface DocumentinsertString in class PlainDocumentBadLocationExceptionpublic void setValue(Object value)
setValue in interface G9FieldValuesetValue in class G9Documentvalue - (missing javadoc)public String getOutputText()
G9DocumentgetOutputText in class G9Documentpublic Object getValue()
getValue in interface G9FieldValuegetValue in class G9Documentpublic Object transform(Object o)
G9Documenttransform in class G9Documento - the object to transformpublic Object parse(String str) throws ParseException
parse in interface G9FieldValueparse in class G9Documentstr - the string to parseParseException - (missing javadoc)G9FieldValue.parse(java.lang.String)public Object getZeroValue()
public String format()
G9DocumentgetValue().toStringformat in interface G9FieldValueformat in class G9DocumentG9FieldValue.format()Copyright © 2006–2017 Esito AS. All rights reserved.