com.levigo.util.swing.text
Class NColumnsTextDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.levigo.util.swing.text.NColumnsTextDocument
- All Implemented Interfaces:
- Serializable, Document
- Direct Known Subclasses:
- NColumsRangeSetDocument, UppercaseDocument
public class NColumnsTextDocument
- extends PlainDocument
A Plain Text Document for Text Components with restricted columns length
User can enter only "numberOfColumns" letters, extra letters will be ignored.
If "numberOfColumns" is smaller than/equals zero, this Document behaves like
a normal Plain Text Document;
- Author:
- Carolin Köhler
- See Also:
- Serialized Form
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NColumnsTextDocument
public NColumnsTextDocument()
- Constructor for NColumnsTextDocument.
NColumnsTextDocument
public NColumnsTextDocument(int cols)
- Constructor for NColumnsTextDocument.
insertString
public void insertString(int offs,
String str,
AttributeSet a)
throws BadLocationException
- Specified by:
insertString
in interface Document
- Overrides:
insertString
in class PlainDocument
- Throws:
BadLocationException
getNumberOfColumns
public int getNumberOfColumns()
- Returns the numberOfColumns.
- Returns:
- int
setNumberOfColumns
public void setNumberOfColumns(int numberOfColumns)
- Sets the numberOfColumns.
- Parameters:
numberOfColumns
- The numberOfColumns to set
Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.