Package rma.swing.text
Class RmaDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
rma.swing.text.RmaDocument
- All Implemented Interfaces:
Serializable
,Document
- Direct Known Subclasses:
AlphaDocument
,AlphaNumericDocument
,DateDocument
,DecimalNumberDocument
,DssPathnamePartDocument
,JythonNameDocument
,MilitaryTimeDocument
,PathnameDocument
,ZipCodeDocument
an abstract PathName document for JTextFields, and other components that use
PlainDocument
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractDocument.Content
protected boolean
protected boolean
protected int
protected Toolkit
protected StringBuffer
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckValidChars
(String str, int offs, boolean beep) protected String
get the String currently being inserted/added to this document.int
getLength
(int length) boolean
boolean
void
insertString
(int offs, String str, AttributeSet a) protected boolean
isValidChar
(char c, int offs) void
setLength
(int length) void
void
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, 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, writeUnlock
-
Field Details
-
_length
protected int _length -
_content
-
_toolkit
-
_isUppercaseOnly
protected boolean _isUppercaseOnly -
_isLowercaseOnly
protected boolean _isLowercaseOnly -
tempBuf
-
-
Constructor Details
-
RmaDocument
public RmaDocument() -
RmaDocument
-
RmaDocument
public RmaDocument(int len)
-
-
Method Details
-
setLength
public void setLength(int length) -
getLength
public int getLength(int length) -
setUppercase
public void setUppercase() -
getUppercase
public boolean getUppercase() -
setLowercase
public void setLowercase() -
getLowercase
public boolean getLowercase() -
insertString
- Specified by:
insertString
in interfaceDocument
- Overrides:
insertString
in classPlainDocument
- Throws:
BadLocationException
-
checkValidChars
-
getCurrentInsertString
get the String currently being inserted/added to this document. Note that the String returned may or maynot be the same as the String that ends up getting inserted into this document. This is useful when a String of more than 1 character is being inserted and theisValidChar(char, int)
method needs the context that the particular character it's checking.- Returns:
- the current String or the empty "" String if nothing is being inserted
-
isValidChar
protected boolean isValidChar(char c, int offs)
-