pt.despodata.java.ddata
Class DDataFieldDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended bypt.despodata.java.ddata.DDataFieldDocument
All Implemented Interfaces:
javax.swing.text.Document, java.io.Serializable

public class DDataFieldDocument
extends javax.swing.text.PlainDocument

Document for Swing input of database type specific text fields such as: Integer ; Smallint ; BigInt ; Decimal ; Double ; Float ; Date ; TinyInt ; Numeric ; Real ; Char ; VarChar ; LongVarChar ; Time ; TimeStamp ; Null ;

See Also:
Serialized Form

Nested Class Summary
 
Nested classes 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
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
DDataFieldDocument()
          By default the data type is Char
DDataFieldDocument(int dataType)
           
 
Method Summary
 void charInsertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
          Char field insert string
 int countDigits(java.lang.String texto)
           
 void dateInsertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
          Date specific insertString Aqui devia existir validacao in key para as datas
 void decimalInsertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
          Insercao de valores no meio da string do text field Devia-se preocupar com casas decimais e respectiva configuracao localizada
 int getDefaultMaxLength()
           
 boolean getEditable()
           
 java.lang.String getFormat()
           
 boolean getOnlyDigits()
           
 boolean getUpshift()
           
 void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
          Executado sempre que ocorre um evento de insercao no textField Tem comportamentos diferentes consoante o tipo de dados a inserir
 void integerInsertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
           
 boolean isAutonext()
           
 java.lang.String onlyDigits(java.lang.String texto)
           
 void setAutonext(boolean flag)
           
 void setDataType(int _dataType)
          Afecta o tipo de dados utilizado
 void setEditable(boolean _editable)
           
 void setFormat(java.lang.String format)
           
 void setMaxLength(int numChar)
           
 void setOnlyDigits(boolean _onlyDigits)
           
 void setUpshift(boolean shift)
           
 void smallintInsertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
           
 void timeInsertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
           
 
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

DDataFieldDocument

public DDataFieldDocument()
By default the data type is Char


DDataFieldDocument

public DDataFieldDocument(int dataType)
Method Detail

getDefaultMaxLength

public int getDefaultMaxLength()

setDataType

public void setDataType(int _dataType)
Afecta o tipo de dados utilizado


onlyDigits

public java.lang.String onlyDigits(java.lang.String texto)

countDigits

public int countDigits(java.lang.String texto)

insertString

public void insertString(int offset,
                         java.lang.String str,
                         javax.swing.text.AttributeSet a)
                  throws javax.swing.text.BadLocationException
Executado sempre que ocorre um evento de insercao no textField Tem comportamentos diferentes consoante o tipo de dados a inserir

Throws:
javax.swing.text.BadLocationException

charInsertString

public void charInsertString(int offset,
                             java.lang.String str,
                             javax.swing.text.AttributeSet a)
                      throws javax.swing.text.BadLocationException
Char field insert string

Throws:
javax.swing.text.BadLocationException

dateInsertString

public void dateInsertString(int offset,
                             java.lang.String str,
                             javax.swing.text.AttributeSet a)
                      throws javax.swing.text.BadLocationException
Date specific insertString Aqui devia existir validacao in key para as datas

Throws:
javax.swing.text.BadLocationException

timeInsertString

public void timeInsertString(int offset,
                             java.lang.String str,
                             javax.swing.text.AttributeSet a)
                      throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException

integerInsertString

public void integerInsertString(int offset,
                                java.lang.String str,
                                javax.swing.text.AttributeSet a)
                         throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException

smallintInsertString

public void smallintInsertString(int offset,
                                 java.lang.String str,
                                 javax.swing.text.AttributeSet a)
                          throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException

decimalInsertString

public void decimalInsertString(int offset,
                                java.lang.String str,
                                javax.swing.text.AttributeSet a)
                         throws javax.swing.text.BadLocationException
Insercao de valores no meio da string do text field Devia-se preocupar com casas decimais e respectiva configuracao localizada

Throws:
javax.swing.text.BadLocationException

setAutonext

public void setAutonext(boolean flag)

setMaxLength

public void setMaxLength(int numChar)

isAutonext

public boolean isAutonext()

setUpshift

public void setUpshift(boolean shift)

getUpshift

public boolean getUpshift()

setEditable

public void setEditable(boolean _editable)

getEditable

public boolean getEditable()

setOnlyDigits

public void setOnlyDigits(boolean _onlyDigits)

getOnlyDigits

public boolean getOnlyDigits()

setFormat

public void setFormat(java.lang.String format)

getFormat

public java.lang.String getFormat()