Class FWTextFieldFilter
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
net.simplace.pipe.util.components.LimitedDocument
net.simplace.pipe.util.components.FWTextFieldFilter
- All Implemented Interfaces:
Serializable, Document
Document for filtering documents.
Copied from http://www.codeguru.com/java/articles/443.shtml
- Author:
- Andreas Enders
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final Stringprotected booleanstatic final Stringstatic final StringFields inherited from class PlainDocument
lineLimitAttribute, tabSizeAttributeFields inherited from class AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameFields inherited from interface Document
StreamDescriptionProperty, TitleProperty -
Constructor Summary
ConstructorsConstructorDescriptionFWTextFieldFilter(String aAcceptedChars) FWTextFieldFilter(String aAcceptedChars, boolean negativeaccepted) FWTextFieldFilter(String aAcceptedChars, boolean negativeaccepted, int aDocumentMaxSize, DocumentListener aListener) FWTextFieldFilter(String aAcceptedChars, int aDocumentMaxSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidinsertString(int offset, String str, AttributeSet attr) Inserts the new string and truncates the text to the maximum size (with a beep) if it gets too long.voidsetAcceptedChars(String aAcceptedChars) voidsetNegativeAccepted(boolean negativeaccepted) Methods inherited from class LimitedDocument
setMaxSizeMethods inherited from class PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdateMethods inherited from class 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
-
LOWERCASE
- See Also:
-
UPPERCASE
- See Also:
-
ALPHA
- See Also:
-
NUMERIC
- See Also:
-
FLOAT
- See Also:
-
ALPHA_NUMERIC
- See Also:
-
iAcceptedChars
-
negativeAccepted
protected boolean negativeAccepted
-
-
Constructor Details
-
FWTextFieldFilter
public FWTextFieldFilter() -
FWTextFieldFilter
-
FWTextFieldFilter
-
FWTextFieldFilter
-
FWTextFieldFilter
public FWTextFieldFilter(String aAcceptedChars, boolean negativeaccepted, int aDocumentMaxSize, DocumentListener aListener)
-
-
Method Details
-
setAcceptedChars
-
setNegativeAccepted
public void setNegativeAccepted(boolean negativeaccepted) -
insertString
Description copied from class:LimitedDocumentInserts the new string and truncates the text to the maximum size (with a beep) if it gets too long.- Specified by:
insertStringin interfaceDocument- Overrides:
insertStringin classLimitedDocument- Throws:
BadLocationException
-