pt.moredata.widgets
Class TextField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.text.JTextComponent
                  extended byjavax.swing.JTextField
                      extended bypt.moredata.widgets.TextField
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.SwingConstants
Direct Known Subclasses:
CellTextField, TextFieldObject

public class TextField
extends javax.swing.JTextField

Title: DataTextField

Description: Beans para cria��o de forms


DataField implementa um campo par arecolha de dados alfanumericos.
Numa primeira fase implementa os tipo de dados do Informix Copyright: Copyright (c) Moredata Company: Moredata

Author:
S�rgio Ferreira, Luis Medalhas, : Pedro Patr�o
See Also:
Serialized Form

Nested Class Summary
 class TextField.DataFieldFocusListener
          Description of the Class
 class TextField.FocusGrabber
          Class para gerir o focus de uma componente
 class TextField.Sendkey
          Class para gerir o ficus de uma componente
 
Nested classes inherited from class javax.swing.JTextField
javax.swing.JTextField.AccessibleJTextField
 
Nested classes inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JTextField
notifyAction
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TextField()
          Construtor
 
Method Summary
 void addAfterField(AfterFieldListener l)
          AfterField event
 void addAllListeners()
          Adds a feature to the AllListeners attribute of the DataTextField object
 void autoScroll(java.awt.Rectangle aRect)
          Description of the Method
protected  boolean domainValidated()
          Valida se o dominio da informacao que o campo contem esta no dominio definido nas propriedades
 void formatValue()
          Formata o valor preenchido de acordo com o formato definido ou com o formato implicito ao tipo de dados ????
 java.lang.String getAllowedCharacters()
          Return a String with a set of characters that are allowed to be used in the widget.
 java.lang.String getDbDataType()
          Devolve o valor da propriedade do text field
static char getDecimalSeparator()
          Devolve o seperador de casas decimais de acordo com as definicoes localizadas do cliente onde o programa esta em execucao
 double getDouble()
          Devolve o valor correspondente ao campo em double
 java.lang.String getFormat()
          Gets the format attribute of the DataTextField object
 java.lang.String getHelpContextId()
          Gets the helpContextId attribute of the DataTextField object
 long getLong()
          Devolve o valor correspondente ao campo em long
 java.lang.String getMaxErrorMessage()
          Mensagem de valida��o do valor maximo
 int getMaxLength()
          Maximum length in characters for the field
 java.lang.Object getMaxObjValue()
          Gets the maxObjValue attribute of the DataTextField object
 long getMaxValue()
           
 java.lang.String getMinErrorMessage()
          Mensagem de valida��o do valor maximo
 java.lang.Object getMinObjValue()
          Gets the minObjValue attribute of the DataTextField object
 long getMinValue()
           
 int getNumDecimais()
          devolve o numero de casas decimais
 java.lang.Object getObject()
          Devolve o valor correspondente ao campo
 boolean getOnlyDigits()
          Gets the onlyDigits attribute of the DataTextField object
 boolean getRequired()
          Gets the required attribute of the DataTextField object
 boolean getValidateOnLostFocus()
          Propriedade que define se o campo deve ou nao ser validado quando perde o focus
 boolean isAutoFormat()
          Gets the autoFormat attribute of the DataTextField object
 boolean isShowMessages()
          Getter for property showMessages.
 void refreshFormat()
          Description of the Method
 void removeAfterField(AfterFieldListener l)
          Description of the Method
 void removeNotify()
          Makes this Container undisplayable by removing its connection to its native screen resource.
 void setAllowedCharacters(java.lang.String allowedCharacters)
          Set the of characters that are allowed to be used in the widget.
 void setAutoFormat(boolean _auto)
          setAutomaticFormat
 void setDbDataType(java.lang.String dbDataType)
          Afecta o valor da propriedade do text field Deveria ser uma propriedade constrained, mas para ja o programador tem de ter cuidado
 void setDocument(javax.swing.text.Document doc)
          Associates the editor with a text document.
 void setFormat(java.lang.String _format)
          Sets the format attribute of the DataTextField object
 void setHelpContextId(java.lang.String _helpContextId)
          Sets the helpContextId attribute of the DataTextField object
 void setMaxErrorMessage(java.lang.String message)
          Altera a mensagem de valida��o do valor maximo o caracter # � utilizado como macro para o valor currente o caracter ^ � utilizado como macro para o valor maximo
 void setMaxLength(int _maxLength)
          Sets the maxLength attribute of the DataTextField object
 void setMaxValue(int _maxValue)
          Sets the maxValue attribute of the DataTextField object
 void setMaxValue(long _maxValue)
          Sets the maxValue attribute of the DataTextField object
 void setMaxValue(java.lang.Object _maxValue)
          Sets the maxValue attribute of the DataTextField object
 void setMinErrorMessage(java.lang.String message)
          Altera a mensagem de valida��o do valor minimo o caracter # � utilizado como macro para o valor currente o caracter ^ � utilizado como macro para o valor minimo
 void setMinValue(int _minValue)
          Sets the minValue attribute of the DataTextField object
 void setMinValue(long _minValue)
          Sets the minValue attribute of the DataTextField object
 void setMinValue(java.lang.Object _minValue)
          Sets the minValue attribute of the DataTextField object
 void setNumDecimais(int _nd)
          Define o numero de casas decimais
 void setObject(java.lang.Object object)
          Afecta o objecto com um valor
 void setOnlyDigits(boolean _onlyDigits)
          Se o string
 void setRequired(boolean _required)
          Sets the required attribute of the DataTextField object
 void setShowMessages(boolean _showMessages)
          Se aparece mensagens de valida��o
 void setText(java.lang.String text)
          Override do setText
 void setValidateOnLostFocus(boolean _validateOnLostFocus)
          Sets the validateOnLostFocus attribute of the DataTextField object
 void startEditing()
          Faz a prepara��o para come�ar a edi��o
 void stopEditing()
          Faz as valida��es e a formata��o do campo
protected  java.lang.String validateMaxMin(java.lang.Object _value)
          Valida��o de um valor
 boolean valueValidated()
          Valida se o valor preenchido eh valido para o tipo de dados
 
Methods inherited from class javax.swing.JTextField
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setFont, setHorizontalAlignment, setScrollOffset
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextField

public TextField()
Construtor

Method Detail

addAllListeners

public void addAllListeners()
Adds a feature to the AllListeners attribute of the DataTextField object


removeNotify

public void removeNotify()
Makes this Container undisplayable by removing its connection to its native screen resource. Making a container undisplayable will cause all of its children to be made undisplayable. This method is called by the toolkit internally and should not be called directly by programs.

See Also:
Component.isDisplayable(), JComponent.addNotify()

setMaxErrorMessage

public void setMaxErrorMessage(java.lang.String message)
Altera a mensagem de valida��o do valor maximo o caracter # � utilizado como macro para o valor currente o caracter ^ � utilizado como macro para o valor maximo

Parameters:
message - The new maxErrorMessage value

getMaxErrorMessage

public java.lang.String getMaxErrorMessage()
Mensagem de valida��o do valor maximo

Returns:
The maxErrorMessage value

setMinErrorMessage

public void setMinErrorMessage(java.lang.String message)
Altera a mensagem de valida��o do valor minimo o caracter # � utilizado como macro para o valor currente o caracter ^ � utilizado como macro para o valor minimo

Parameters:
message - The new minErrorMessage value

getMinErrorMessage

public java.lang.String getMinErrorMessage()
Mensagem de valida��o do valor maximo

Returns:
The minErrorMessage value

setText

public void setText(java.lang.String text)
Override do setText

Parameters:
text - The new text value

setAutoFormat

public void setAutoFormat(boolean _auto)
setAutomaticFormat

Parameters:
_auto - The new autoFormat value

isAutoFormat

public boolean isAutoFormat()
Gets the autoFormat attribute of the DataTextField object

Returns:
The autoFormat value

setNumDecimais

public void setNumDecimais(int _nd)
Define o numero de casas decimais

Parameters:
_nd - The new numDecimais value

getNumDecimais

public int getNumDecimais()
devolve o numero de casas decimais

Returns:
The numDecimais 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

refreshFormat

public void refreshFormat()
Description of the Method


getDbDataType

public java.lang.String getDbDataType()
Devolve o valor da propriedade do text field

Returns:
The dbDataType value

setDbDataType

public void setDbDataType(java.lang.String dbDataType)
Afecta o valor da propriedade do text field Deveria ser uma propriedade constrained, mas para ja o programador tem de ter cuidado

Parameters:
dbDataType - The new dbDataType value

getMaxObjValue

public java.lang.Object getMaxObjValue()
Gets the maxObjValue attribute of the DataTextField object

Returns:
The maxObjValue value

getMaxValue

public long getMaxValue()
Returns:
The maxValue value

setMaxValue

public void setMaxValue(java.lang.Object _maxValue)
Sets the maxValue attribute of the DataTextField object

Parameters:
_maxValue - The new maxValue value

setMaxValue

public void setMaxValue(long _maxValue)
Sets the maxValue attribute of the DataTextField object

Parameters:
_maxValue - The new maxValue value

setMaxValue

public void setMaxValue(int _maxValue)
Sets the maxValue attribute of the DataTextField object

Parameters:
_maxValue - The new maxValue value

getMinObjValue

public java.lang.Object getMinObjValue()
Gets the minObjValue attribute of the DataTextField object

Returns:
The minObjValue value

getMinValue

public long getMinValue()
Returns:
The minValue value

setMinValue

public void setMinValue(java.lang.Object _minValue)
Sets the minValue attribute of the DataTextField object

Parameters:
_minValue - The new minValue value

setMinValue

public void setMinValue(long _minValue)
Sets the minValue attribute of the DataTextField object

Parameters:
_minValue - The new minValue value

setMinValue

public void setMinValue(int _minValue)
Sets the minValue attribute of the DataTextField object

Parameters:
_minValue - The new minValue value

getHelpContextId

public java.lang.String getHelpContextId()
Gets the helpContextId attribute of the DataTextField object

Returns:
The helpContextId value

setHelpContextId

public void setHelpContextId(java.lang.String _helpContextId)
Sets the helpContextId attribute of the DataTextField object

Parameters:
_helpContextId - The new helpContextId value

getRequired

public boolean getRequired()
Gets the required attribute of the DataTextField object

Returns:
The required value

setRequired

public void setRequired(boolean _required)
Sets the required attribute of the DataTextField object

Parameters:
_required - The new required value

getFormat

public java.lang.String getFormat()
Gets the format attribute of the DataTextField object

Returns:
The format value

setFormat

public void setFormat(java.lang.String _format)
Sets the format attribute of the DataTextField object

Parameters:
_format - The new format value

getValidateOnLostFocus

public boolean getValidateOnLostFocus()
Propriedade que define se o campo deve ou nao ser validado quando perde o focus

Returns:
The validateOnLostFocus value

setValidateOnLostFocus

public void setValidateOnLostFocus(boolean _validateOnLostFocus)
Sets the validateOnLostFocus attribute of the DataTextField object

Parameters:
_validateOnLostFocus - The new validateOnLostFocus value

getMaxLength

public int getMaxLength()
Maximum length in characters for the field

Returns:
The maxLength value

setMaxLength

public void setMaxLength(int _maxLength)
Sets the maxLength attribute of the DataTextField object

Parameters:
_maxLength - The new maxLength value

getObject

public java.lang.Object getObject()
Devolve o valor correspondente ao campo

Returns:
The object value

getDouble

public double getDouble()
Devolve o valor correspondente ao campo em double

Returns:
The double value

getLong

public long getLong()
Devolve o valor correspondente ao campo em long

Returns:
The long value

setObject

public void setObject(java.lang.Object object)
Afecta o objecto com um valor

Parameters:
object - The new object value

domainValidated

protected boolean domainValidated()
Valida se o dominio da informacao que o campo contem esta no dominio definido nas propriedades

Returns:
Description of the Return Value

validateMaxMin

protected java.lang.String validateMaxMin(java.lang.Object _value)
Valida��o de um valor

Parameters:
_value - Description of the Parameter
Returns:
Description of the Return Value

valueValidated

public boolean valueValidated()
Valida se o valor preenchido eh valido para o tipo de dados

Returns:
Description of the Return Value

formatValue

public void formatValue()
Formata o valor preenchido de acordo com o formato definido ou com o formato implicito ao tipo de dados ???? Para ja fica o tipo datas a funcionar e sem usar a propriedade ???? format


stopEditing

public void stopEditing()
Faz as valida��es e a formata��o do campo


startEditing

public void startEditing()
Faz a prepara��o para come�ar a edi��o


addAfterField

public void addAfterField(AfterFieldListener l)
AfterField event

Parameters:
l - The feature to be added to the AfterField attribute

removeAfterField

public void removeAfterField(AfterFieldListener l)
Description of the Method

Parameters:
l - Description of the Parameter

isShowMessages

public boolean isShowMessages()
Getter for property showMessages.

Returns:
Value of property showMessages.

setShowMessages

public void setShowMessages(boolean _showMessages)
Se aparece mensagens de valida��o

Parameters:
_showMessages - The new showMessages value

setOnlyDigits

public void setOnlyDigits(boolean _onlyDigits)
Se o string

Parameters:
_onlyDigits - The new onlyDigits value

getOnlyDigits

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

Returns:
The onlyDigits value

autoScroll

public void autoScroll(java.awt.Rectangle aRect)
Description of the Method

Parameters:
aRect - Description of the Parameter

setDocument

public void setDocument(javax.swing.text.Document doc)
Associates the editor with a text document. The currently registered factory is used to build a view for the document, which gets displayed by the editor after revalidation. A PropertyChange event ("document") is propagated to each listener.

Parameters:
doc - A FieldDocument document to display/edit
See Also:
JTextComponent.getDocument()

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.