com.myjavaworld.gui
Class MPlainDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by com.myjavaworld.gui.MPlainDocument
All Implemented Interfaces:
Serializable, Document
Direct Known Subclasses:
SingleLineDocument

public class MPlainDocument
extends PlainDocument

An extension of javax.swing.text.PlainDocument.

Version:
1.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com
See Also:
Serialized Form

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
 
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
MPlainDocument()
          Created an instance of MPlainDocument.
 
Method Summary
 int getCharacterCase()
          Returns the current character case in use by this document.
 int getMaximumLength()
          Returns the maximum length allowed by this document.
 void insertString(int offset, String str, AttributeSet a)
           
 void setCharacterCase(int characterCase)
          Sets the character case of this doocument to the given case.
 void setMaximumLength(int maximumLength)
          Sets the maximum length of this document to the given maximumLength.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPlainDocument

public MPlainDocument()
Created an instance of MPlainDocument.

Method Detail

setMaximumLength

public void setMaximumLength(int maximumLength)
Sets the maximum length of this document to the given maximumLength.

Parameters:
maximumLength - Maximum number of characters to allow

getMaximumLength

public int getMaximumLength()
Returns the maximum length allowed by this document.

Returns:
maximum length

setCharacterCase

public void setCharacterCase(int characterCase)
Sets the character case of this doocument to the given case.

Parameters:
characterCase - Character case to force on this document

getCharacterCase

public int getCharacterCase()
Returns the current character case in use by this document.

Returns:
character case

insertString

public void insertString(int offset,
                         String str,
                         AttributeSet a)
                  throws BadLocationException
Specified by:
insertString in interface Document
Overrides:
insertString in class PlainDocument
Throws:
BadLocationException


Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.