gov.sns.ca.view
Class ChannelNameDocument

java.lang.Object
  |
  +--javax.swing.text.AbstractDocument
        |
        +--javax.swing.text.PlainDocument
              |
              +--gov.sns.ca.view.ChannelNameDocument
All Implemented Interfaces:
javax.swing.text.Document, java.io.Serializable

public class ChannelNameDocument
extends javax.swing.text.PlainDocument

ChannelNameDocument is a javax.swing.text.Document implementation useful for filtering out invalid characters of a channel name. For example channel names cannot have spaces or non-printing characters. This is useful when implementing intelligent text fields that allow a user to enter a channel name. Invalid characters are thrown away and a system beep warning is heard in its place.

See Also:
Serialized Form

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
ChannelNameDocument()
          Creates a new instance of ChannelField
 
Method Summary
 void insertString(int offset, java.lang.String string, javax.swing.text.AttributeSet attributes)
          Override the inherited method to filter out characters that are not alpha-numeric or a colon, dash, underscore or period.
 
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

ChannelNameDocument

public ChannelNameDocument()
Creates a new instance of ChannelField

Method Detail

insertString

public void insertString(int offset,
                         java.lang.String string,
                         javax.swing.text.AttributeSet attributes)
                  throws javax.swing.text.BadLocationException
Override the inherited method to filter out characters that are not alpha-numeric or a colon, dash, underscore or period.

Specified by:
insertString in interface javax.swing.text.Document
Overrides:
insertString in class javax.swing.text.PlainDocument
Throws:
javax.swing.text.BadLocationException - under the same conditions the inherited method would.