com.gargoylesoftware.base.util
Class DocumentUtil

java.lang.Object
  extended bycom.gargoylesoftware.base.util.DocumentUtil

public class DocumentUtil
extends Object

Various utility methods relating to documents.

Version:
$Revision: 1.5 $
Author:
Mike Bowler

Method Summary
static Document lengthLimitedDocument(Document document, int maxLength)
          Return a wrapper document that prevents the user from typing more than a specified number of characters.
static Document lengthLimitedDocument(int maxLength)
          Return a PlainDocument wrappered so that it is length limited.
static Document upperCaseDocument()
          Return a PlainDocument wrappered so that it accepts uppercase input only.
static Document upperCaseDocument(Document document)
          Return a wrapper document that converts all input to uppercase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

upperCaseDocument

public static Document upperCaseDocument(Document document)
Return a wrapper document that converts all input to uppercase.

Parameters:
document - The document to wrapper.
Returns:
The new wrapper document.

upperCaseDocument

public static Document upperCaseDocument()
Return a PlainDocument wrappered so that it accepts uppercase input only.

Returns:
The new wrapper document.

lengthLimitedDocument

public static Document lengthLimitedDocument(Document document,
                                             int maxLength)
Return a wrapper document that prevents the user from typing more than a specified number of characters.

Parameters:
document - The document to wrapper.
maxLength - The maximum number of characters that can be placed in this document.
Returns:
The new wrapper document.

lengthLimitedDocument

public static Document lengthLimitedDocument(int maxLength)
Return a PlainDocument wrappered so that it is length limited.

Parameters:
maxLength - The maximum number of characters that can be placed in this document.
Returns:
The new wrapper document.


Copyright © 1998-2005 Gargoyle Software Inc.. All Rights Reserved.