com.nqadmin.swingSet
Class SSTextDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by com.nqadmin.swingSet.SSTextDocument
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.Document

public class SSTextDocument
extends javax.swing.text.PlainDocument

SSTextDocument.java

SwingSet - Open Toolkit For Making Swing Controls Database-Aware

 Java PlainDocument that is 'database-aware'.  When developing a database
 application the SSTextDocument can be used in conjunction with the
 SSDataNavigator to allow for both editing and navigation of the rows in a
 database table.

 The SSTextDocument takes a SSRowSet and either a column index or a column name
 as arguments.  Whenever the cursor is moved (e.g. navigation occurs on the
 SSDataNavigator), the document property of the bound Swing control changes to
 reflect the new value for the database column.

 Note that a SSRowSet insert doesn't implicitly modify the cursor which is why
 the SSDBNavImp is provided for clearing controls following an insert.

Version:
$Revision: 1.24 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
 
Field Summary
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
BidiElementName, ContentElementName, ElementNameAttribute, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
SSTextDocument(SSRowSet _sSRowSet, int _columnIndex)
          Constructs a SSTextDocument with the given SSRowSet and column index.
SSTextDocument(SSRowSet _sSRowSet, java.lang.String _columnName)
          Constructs a SSTextDocument with the given SSRowSet and column name.
 
Method Summary
 int getColumnIndex()
          Returns the index of the column to which the document is bound.
 java.lang.String getColumnName()
          Returns the column name to which the document is bound.
 SSRowSet getSSRowSet()
          Returns the SSRowSet to which the document is bound.
 void setColumnIndex(int _columnIndex)
          Sets the column index to which the document is to be bound.
 void setColumnName(java.lang.String _columnName)
          Sets the column name to which the document is to be bound.
 void setSSRowSet(SSRowSet _sSRowSet)
          Sets the SSRowSet to which the document is bound.
 
Methods inherited from class javax.swing.text.PlainDocument
getDefaultRootElement, getParagraphElement, insertString
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSTextDocument

public SSTextDocument(SSRowSet _sSRowSet,
                      java.lang.String _columnName)
Constructs a SSTextDocument with the given SSRowSet and column name. The document is bound to the specified column in the SSRowSet

Parameters:
_sSRowSet - SSRowSet upon which document will be based
_columnName - column name within SSRowSet upon which document will be based

SSTextDocument

public SSTextDocument(SSRowSet _sSRowSet,
                      int _columnIndex)
Constructs a SSTextDocument with the given SSRowSet and column index. The document is bound to the specified column in the SSRowSet.

Parameters:
_sSRowSet - SSRowSet upon which document will be based
_columnIndex - column index within SSRowSet upon which document will be based
Method Detail

setColumnName

public void setColumnName(java.lang.String _columnName)
Sets the column name to which the document is to be bound.

Parameters:
_columnName - column Name to which the document is to be bound

getColumnName

public java.lang.String getColumnName()
Returns the column name to which the document is bound.

Returns:
returns the column name to which the document is bound.

setColumnIndex

public void setColumnIndex(int _columnIndex)
Sets the column index to which the document is to be bound.

Parameters:
_columnIndex - column index to which the document is to be bound

getColumnIndex

public int getColumnIndex()
Returns the index of the column to which the document is bound.

Returns:
returns the index of the column to which the document is bound

setSSRowSet

public void setSSRowSet(SSRowSet _sSRowSet)
Sets the SSRowSet to which the document is bound.

Parameters:
_sSRowSet - SSRowSet to which the component is bound

getSSRowSet

public SSRowSet getSSRowSet()
Returns the SSRowSet to which the document is bound.

Returns:
SSRowSet to which the document is bound