pt.moredata.widgets
Class FieldDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended bypt.moredata.widgets.FieldDocument
All Implemented Interfaces:
javax.swing.text.Document, java.io.Serializable

public class FieldDocument
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 ;

Author:
aricardo
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
FieldDocument()
          By default the data type is Char
FieldDocument(int dataType)
          Constructor for the FieldDocument object
 
Method Summary
 java.lang.String getAllowedCharacters()
          Return a String with a set of characters that are allowed to be used in the widget.
static char getDecimalSeparator()
          Devolve o seperador de casas decimais de acordo com as definicoes localizadas do cliente onde o programa esta em execucao
 int getDefaultMaxLength()
          Gets the defaultMaxLength attribute of the FieldDocument object
 java.lang.String getFormat()
           
 boolean getOnlyDigits()
          Gets the onlyDigits attribute of the FieldDocument object
static char getThousandSeparator()
          Devolve o separador dos milhares de acordo com as definições
 boolean getUpshift()
          Gets the upshift attribute of the FieldDocument object
 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
 boolean isAutonext()
          Gets the autonext attribute of the FieldDocument object
 boolean isEditable()
           
 void setAllowedCharacters(java.lang.String allowedCharacters)
          Set the of characters that are allowed to be used in the widget.
 void setAutonext(boolean flag)
          Sets the autonext attribute of the FieldDocument object
 void setDataType(int _dataType)
          Afecta o tipo de dados utilizado
 void setEditable(boolean editable)
           
 void setFormat(java.lang.String format)
           
 void setMaxLength(int numChar)
          Sets the maxLength attribute of the FieldDocument object
 void setOnlyDigits(boolean _onlyDigits)
          Sets the onlyDigits attribute of the FieldDocument object
 void setUpshift(boolean shift)
          Sets the upshift attribute of the FieldDocument object
 
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

FieldDocument

public FieldDocument()
By default the data type is Char


FieldDocument

public FieldDocument(int dataType)
Constructor for the FieldDocument object

Parameters:
dataType - Description of the Parameter
Method Detail

getDefaultMaxLength

public int getDefaultMaxLength()
Gets the defaultMaxLength attribute of the FieldDocument object

Returns:
The defaultMaxLength value

setDataType

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

Parameters:
_dataType - The new dataType value

getDecimalSeparator

public static char getDecimalSeparator()
Devolve o seperador de casas decimais de acordo com as definicoes localizadas do cliente onde o programa esta em execucao

Returns:
The decimalSeparator value

getThousandSeparator

public static char getThousandSeparator()
Devolve o separador dos milhares de acordo com as definições

Returns:
The thousandSeparator value

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

Parameters:
offset - Description of the Parameter
str - Description of the Parameter
a - Description of the Parameter
Throws:
javax.swing.text.BadLocationException - Description of the Exception

setAutonext

public void setAutonext(boolean flag)
Sets the autonext attribute of the FieldDocument object

Parameters:
flag - The new autonext value

setMaxLength

public void setMaxLength(int numChar)
Sets the maxLength attribute of the FieldDocument object

Parameters:
numChar - The new maxLength value

isAutonext

public boolean isAutonext()
Gets the autonext attribute of the FieldDocument object

Returns:
The autonext value

setUpshift

public void setUpshift(boolean shift)
Sets the upshift attribute of the FieldDocument object

Parameters:
shift - The new upshift value

getUpshift

public boolean getUpshift()
Gets the upshift attribute of the FieldDocument object

Returns:
The upshift value

setOnlyDigits

public void setOnlyDigits(boolean _onlyDigits)
Sets the onlyDigits attribute of the FieldDocument object

Parameters:
_onlyDigits - The new onlyDigits value

getOnlyDigits

public boolean getOnlyDigits()
Gets the onlyDigits attribute of the FieldDocument object

Returns:
The onlyDigits value

setFormat

public void setFormat(java.lang.String format)

getFormat

public java.lang.String getFormat()

getAllowedCharacters

public java.lang.String getAllowedCharacters()
Return a String with a set of characters that are allowed to be used in the widget.

Returns:
A String with a set of characters that are allowed to be used in the widget.

setAllowedCharacters

public void setAllowedCharacters(java.lang.String allowedCharacters)
Set the of characters that are allowed to be used in the widget.

Parameters:
allowedCharacters - A string with the allowed characters.

isEditable

public boolean isEditable()

setEditable

public void setEditable(boolean editable)