pt.moredata.widgets.table
Class CellField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bypt.moredata.widgets.Field
                  extended bypt.moredata.widgets.table.CellField
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class CellField
extends Field

See Also:
Serialized Form

Nested Class Summary
protected  class CellField.DDataFieldDocumentListener
          Classe utilizada quando o valor do campo é alterado
 class CellField.ddataFieldFocusListener
           
 class CellField.FocusGrabber
          Class para gerir o ficus de uma componente
 
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
protected  java.util.Vector afterFieldListenersList
           
 int dataType
           
protected  java.util.Vector errorInValidationList
           
protected  java.lang.Object oldValue
          Valor Antigo
protected  java.lang.Object value
          Valor que o campo contem
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CellField()
          Construtor
 
Method Summary
 void addAfterField(AfterFieldListener l)
          AfterField event
 void autoScroll(java.awt.Rectangle aRect)
           
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 getDbDataType()
          Devolve o valor da propriedade do text field
 double getDouble()
          Devolve o valor correspondente ao campo em double
 java.lang.String getErrorMessages()
           
 java.lang.String getFormat()
          Gets the format attribute of the DataField object
 java.lang.String getHelpContextId()
          Gets the helpContextId attribute of the DataField 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
 long getMaxValue()
           
 java.lang.String getMinErrorMessage()
          Mensagem de validação do valor maximo
 long getMinValue()
           
 int getNumDecimais()
          devolve o numero de casas decimais
 java.lang.Object getObject()
          Devolve o valor correspondente ao campo
 boolean getOnlyDigits()
           
 boolean getRequired()
          Gets the required attribute of the DataField 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 DataField object
 boolean isManagingFocus()
           
 java.lang.String makeFormat(int type, boolean separador)
          define o formato
 java.lang.String numberMask(int _nd, boolean separador)
          Faz mascara
 void refreshFormat()
           
 void removeAfterField(AfterFieldListener l)
           
 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 setEditable(boolean _editable)
          Define se o utilizador pode ou não alterar a informação disponivel no TextField
 void setFormat(java.lang.String _format)
          Afecta o formato para formatacao de valores numericos e(ou) datas apos perda de focus
 void setHelpContextId(java.lang.String _helpContextId)
          Afecta a URL do help sensivel ao contexto deste campo
 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 DataField object
 void setMaxValue(int _maxValue)
           
 void setMaxValue(long _maxValue)
          Sets the maxValue attribute of the DataField 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)
           
 void setMinValue(long _minValue)
          Sets the minValue attribute of the DataField 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)
          Se required a true o campo eh de preenchimento obrigatorio
 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 DataField 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 pt.moredata.widgets.Field
addActionListener, addCaretListener, addComboElement, addComponentListener, addContainerListener, addFieldListener, addFocListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, clear, copy, cut, foreignKeyLookup, getAccessibleContext, getActions, getAllowedCharacters, getCaretPosition, getColumn, getColumns, getComponentType, getDataFieldSize, getDataSource, getDecimals, getDescriptionColumn, getDocument, getFocusAccelerator, getFont, getHorizontalAlignment, getHorizontalVisibility, getMaxColumns, getMaxLines, getMaxObjValue, getMinObjValue, getPreferredScrollableViewportSize, getReferencedColumn, getReferencedTable, getScrollableBlockIncrement, getScrollableUnitIncrement, getScrollOffset, getSelectedText, getSelectionEnd, getSelectionStart, getTable, getText, getText, getWhereString, grabFocus, hasFocus, isContainer, isEditable, isFk, isFocusable, isLookupOnSetObject, isOnlyDigits, isPk, isQueryState, isShowCode, isShowDescription, isShowExpansionButton, isValidateRoot, modelToView, moveCaretPosition, paste, postActionEvent, read, removeActionListener, removeCaretListener, removeComponentListener, removeContainerListener, removeFieldListener, removeFocListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, requestFocus, select, selectAll, setActionCommand, setAllowedCharacters, setBackground, setBackgroundDisabledColor, setBackgroundEnabledColor, setBorder, setBounds, setCaretPosition, setColumn, setColumns, setComboElements, setComponentType, setDataFieldSize, setDataSource, setDecimals, setDescriptionColumn, setDisabledTextColor, setDocument, setEnabled, setFk, setFocusAccelerator, setFont, setHorizontalAlignment, setLookupOnSetObject, setMaxColumns, setMaxLines, setMaxValue, setMinValue, setNextFocusableComponent, setPk, setQueryState, setReferencedColumn, setReferencedTable, setScrollOffset, setSelectionEnd, setSelectionStart, setShowCode, setShowDescription, setShowExpansionButton, setTable, setWhereString, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, isDoubleBuffered, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, 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, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addFocusListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeFocusListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, 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
 

Field Detail

errorInValidationList

protected java.util.Vector errorInValidationList

dataType

public int dataType

value

protected java.lang.Object value
Valor que o campo contem


oldValue

protected java.lang.Object oldValue
Valor Antigo


afterFieldListenersList

protected java.util.Vector afterFieldListenersList
Constructor Detail

CellField

public CellField()
Construtor

Method Detail

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

Overrides:
setMaxErrorMessage in class Field
Parameters:
message - Mensagem mostrada após validar máximo

getMaxErrorMessage

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

Overrides:
getMaxErrorMessage in class Field
Returns:
Mensagem

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

Overrides:
setMinErrorMessage in class Field
Parameters:
message - The new minErrorMessage value

getMinErrorMessage

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

Overrides:
getMinErrorMessage in class Field
Returns:
The minErrorMessage value

setText

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

Overrides:
setText in class Field
Parameters:
text - Texto a mostrar no caso de TextField

setAutoFormat

public void setAutoFormat(boolean _auto)
setAutomaticFormat

Overrides:
setAutoFormat in class Field
Parameters:
_auto - true para que exista formatação automática, false não faz qualquer formatação

isAutoFormat

public boolean isAutoFormat()
Description copied from class: Field
Gets the autoFormat attribute of the DataField object

Overrides:
isAutoFormat in class Field
Returns:
The autoFormat value

setEditable

public void setEditable(boolean _editable)
Define se o utilizador pode ou não alterar a informação disponivel no TextField

Overrides:
setEditable in class Field
Parameters:
_editable - true se o campo fôr editável, false caso contrário

setNumDecimais

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


getNumDecimais

public int getNumDecimais()
devolve o numero de casas decimais


numberMask

public java.lang.String numberMask(int _nd,
                                   boolean separador)
Faz mascara


refreshFormat

public void refreshFormat()

makeFormat

public java.lang.String makeFormat(int type,
                                   boolean separador)
define o formato


getDbDataType

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

Overrides:
getDbDataType in class Field
Returns:
Tipo de dados conforme definido em DataType

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

Overrides:
setDbDataType in class Field
Parameters:
_dbDataType - Tipo de dados devolvido

getMaxValue

public long getMaxValue()
Overrides:
getMaxValue in class Field
Returns:
The maxValue value

setMaxValue

public void setMaxValue(long _maxValue)
Description copied from class: Field
Sets the maxValue attribute of the DataField object

Overrides:
setMaxValue in class Field
Parameters:
_maxValue - The new maxValue value

setMaxValue

public void setMaxValue(int _maxValue)

getMinValue

public long getMinValue()
Overrides:
getMinValue in class Field
Returns:
The minValue value

setMinValue

public void setMinValue(long _minValue)
Description copied from class: Field
Sets the minValue attribute of the DataField object

Overrides:
setMinValue in class Field
Parameters:
_minValue - The new minValue value

setMinValue

public void setMinValue(int _minValue)

getHelpContextId

public java.lang.String getHelpContextId()
Description copied from class: Field
Gets the helpContextId attribute of the DataField object

Overrides:
getHelpContextId in class Field
Returns:
The helpContextId value

setHelpContextId

public void setHelpContextId(java.lang.String _helpContextId)
Description copied from class: Field
Afecta a URL do help sensivel ao contexto deste campo

Overrides:
setHelpContextId in class Field
Parameters:
_helpContextId - The new helpContextId value

getRequired

public boolean getRequired()
Description copied from class: Field
Gets the required attribute of the DataField object

Overrides:
getRequired in class Field
Returns:
The required value

setRequired

public void setRequired(boolean _required)
Description copied from class: Field
Se required a true o campo eh de preenchimento obrigatorio

Overrides:
setRequired in class Field
Parameters:
_required - The new required value

getFormat

public java.lang.String getFormat()
Description copied from class: Field
Gets the format attribute of the DataField object

Overrides:
getFormat in class Field
Returns:
The format value

setFormat

public void setFormat(java.lang.String _format)
Description copied from class: Field
Afecta o formato para formatacao de valores numericos e(ou) datas apos perda de focus

Overrides:
setFormat in class Field
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

Overrides:
getValidateOnLostFocus in class Field
Returns:
The validateOnLostFocus value

setValidateOnLostFocus

public void setValidateOnLostFocus(boolean _validateOnLostFocus)
Description copied from class: Field
Sets the validateOnLostFocus attribute of the DataField object

Overrides:
setValidateOnLostFocus in class Field
Parameters:
_validateOnLostFocus - The new validateOnLostFocus value

getMaxLength

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

Overrides:
getMaxLength in class Field
Returns:
The maxLength value

setMaxLength

public void setMaxLength(int _maxLength)
Description copied from class: Field
Sets the maxLength attribute of the DataField object

Overrides:
setMaxLength in class Field
Parameters:
_maxLength - The new maxLength value

getObject

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

Overrides:
getObject in class Field
Returns:
The object value

getDouble

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

Overrides:
getDouble in class Field
Returns:
The double value

getLong

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

Overrides:
getLong in class Field
Returns:
The long value

setObject

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

Overrides:
setObject in class Field
Parameters:
object - Objecto que contem o valor a mostrar no campo

domainValidated

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


validateMaxMin

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


valueValidated

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


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


startEditing

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


addAfterField

public void addAfterField(AfterFieldListener l)
AfterField event

Overrides:
addAfterField in class Field
Parameters:
l - The feature to be added to the AfterField attribute

removeAfterField

public void removeAfterField(AfterFieldListener l)

setShowMessages

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


setOnlyDigits

public void setOnlyDigits(boolean _onlyDigits)
Se o string

Overrides:
setOnlyDigits in class Field
Parameters:
_onlyDigits - The new onlyDigits value

getOnlyDigits

public boolean getOnlyDigits()

autoScroll

public void autoScroll(java.awt.Rectangle aRect)

getErrorMessages

public java.lang.String getErrorMessages()

isManagingFocus

public boolean isManagingFocus()

stopEditing

public void stopEditing()
Faz as validações e a formatação do campo