pt.moredata.widgets
Class TextFieldObject

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
                          extended bypt.moredata.widgets.TextFieldObject
All Implemented Interfaces:
javax.accessibility.Accessible, FieldObject, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.SwingConstants

public class TextFieldObject
extends TextField
implements FieldObject

Author:
aricardo
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class pt.moredata.widgets.TextField
TextField.DataFieldFocusListener, TextField.FocusGrabber, TextField.Sendkey
 
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
protected  java.lang.String format
           
protected  java.lang.Object value
          Valor que o campo contem.
 
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 pt.moredata.widgets.FieldObject
CHECK_BOX, COMBO_BOX, EDITOR_PANE, IMAGE_FIELD, RADIO_BUTTONS, TEXT_FIELD
 
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
TextFieldObject()
          Creates a new instance of TextFieldObject
 
Method Summary
 void addComboElement(java.lang.Object code, java.lang.Object description)
          Adiciona um elemento a combobox.
 void addFocListener(java.awt.event.FocusListener l)
          Adds the specified focus listener to receive focus events from this component when this component gains input focus.
 void clearImageScreen()
          Clears all references to previously added image.
 java.awt.Component getComponent()
          Devolve o Component associado a um FieldObject
 int getDecimals()
          Devolve o numero de casas decimais que se permite digitar
 java.lang.String getDescriptionColumn()
          Coluna de descricao de chave estrangeira
 int getMaxColumns()
          Numero maximo de caracteres numa linha
 int getMaxLines()
          Numero maximo de linhas do painel de texto.
 java.lang.Object getObject()
          Devolve o valor que esta preenchido no campo ???
 boolean getRequired()
          Gets the required attribute of the DataField object
 boolean isAutoFormat()
          Gets the autoFormat attribute of the DataField object
 void removeAllItems()
          Remove todos os dados que estao na combo e o vector de chaves primarias e acaba com a chave primaria corrente que se calhar ate deveria vir do data control e nao ser mantido na combobox
 void removeFocListener(java.awt.event.FocusListener l)
          Removes the specified focus listener so that it no longer receives focus events from this component.
 void setCodeColumn(java.lang.String referencedColumn)
           
 void setDecimals(int _nd)
          Define o numero de casas decimais
 void setDescriptionColumn(java.lang.String descriptionColumn)
          Sets the descriptionColumn attribute of the DataField object
 void setEditable(boolean editable)
          setEditable
 void setEnabled(boolean b)
           
 void setForeground(java.awt.Color fg)
           
 void setFormat(java.lang.String _format)
          Afecta o formato para formatacao de valores numericos e(ou) datas apos perda de focus
 void setMaxColumns(int _maxColumns)
          Sets the maxColumns attribute of the DataEditorPane object
 void setMaxLines(int _maxLines)
          Sets the maxLines attribute of the DataEditorPane object
 void setObject(java.lang.Object object)
          Afecta o objecto com um valor e mostra no Field o seu conteudo
Se a coluna a que o campo pertence fôr chave estrangeira efectua o lookup da descodificação correspondente.
 void setShowCode(boolean showCode)
          Sets the showCode attribute of the DataField object
 void setTable(java.lang.String table)
           
 void setValidateOnLostFocus(boolean _validateOnLostFocus)
          Sets the validateOnLostFocus attribute of the DataField object
 
Methods inherited from class pt.moredata.widgets.TextField
addAfterField, addAllListeners, autoScroll, domainValidated, formatValue, getAllowedCharacters, getDbDataType, getDecimalSeparator, getDouble, getFormat, getHelpContextId, getLong, getMaxErrorMessage, getMaxLength, getMaxObjValue, getMaxValue, getMinErrorMessage, getMinObjValue, getMinValue, getNumDecimais, getOnlyDigits, getValidateOnLostFocus, isShowMessages, refreshFormat, removeAfterField, removeNotify, setAllowedCharacters, setAutoFormat, setDbDataType, setDocument, setHelpContextId, setMaxErrorMessage, setMaxLength, setMaxValue, setMaxValue, setMaxValue, setMinErrorMessage, setMinValue, setMinValue, setMinValue, setNumDecimais, setOnlyDigits, setRequired, setShowMessages, setText, startEditing, stopEditing, validateMaxMin, valueValidated
 
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, 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, 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
 
Methods inherited from interface pt.moredata.widgets.FieldObject
addActionListener, addAfterField, addCaretListener, addComponentListener, addContainerListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, copy, cut, getAccessibleContext, getActions, getAllowedCharacters, getCaretPosition, getColumns, getDbDataType, getDocument, getDouble, getFocusAccelerator, getFont, getFormat, getHelpContextId, getHorizontalAlignment, getHorizontalVisibility, getKeymap, getLong, getMaxErrorMessage, getMaxLength, getMaxValue, getMinErrorMessage, getMinValue, getOnlyDigits, getPreferredScrollableViewportSize, getPreferredSize, getScrollableBlockIncrement, getScrollableUnitIncrement, getScrollOffset, getSelectedText, getSelectionEnd, getSelectionStart, getText, getText, getValidateOnLostFocus, grabFocus, hasFocus, isEditable, isValidateRoot, modelToView, moveCaretPosition, paste, postActionEvent, read, removeActionListener, removeCaretListener, removeComponentListener, removeContainerListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, requestFocus, scrollRectToVisible, select, selectAll, setActionCommand, setAllowedCharacters, setAutoFormat, setBackground, setBorder, setBounds, setCaretPosition, setColumns, setDbDataType, setDisabledTextColor, setDocument, setFocusAccelerator, setFont, setHelpContextId, setHorizontalAlignment, setMaxErrorMessage, setMaxLength, setMaxValue, setMinErrorMessage, setMinValue, setOnlyDigits, setPreferredSize, setRequired, setScrollOffset, setSelectionEnd, setSelectionStart, setText, viewToModel, write
 

Field Detail

format

protected java.lang.String format

value

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

Se combo box ou com descodifica��o contem sempre o valor da chave estrangeira.

Constructor Detail

TextFieldObject

public TextFieldObject()
Creates a new instance of TextFieldObject

Method Detail

getDecimals

public int getDecimals()
Description copied from interface: FieldObject
Devolve o numero de casas decimais que se permite digitar

Specified by:
getDecimals in interface FieldObject
Returns:
The decimals value

getDescriptionColumn

public java.lang.String getDescriptionColumn()
Description copied from interface: FieldObject
Coluna de descricao de chave estrangeira

Specified by:
getDescriptionColumn in interface FieldObject
Returns:
O valor de descriptionColumn

getObject

public java.lang.Object getObject()
Description copied from interface: FieldObject
Devolve o valor que esta preenchido no campo ??? Ainda nao esta a funcionar com combos

Specified by:
getObject in interface FieldObject
Overrides:
getObject in class TextField
Returns:
The object value

setDecimals

public void setDecimals(int _nd)
Description copied from interface: FieldObject
Define o numero de casas decimais

Specified by:
setDecimals in interface FieldObject
Parameters:
_nd - Número de casas decimais

setEditable

public void setEditable(boolean editable)
Description copied from interface: FieldObject
setEditable

Specified by:
setEditable in interface FieldObject

setEnabled

public void setEnabled(boolean b)
Specified by:
setEnabled in interface FieldObject

setFormat

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

Specified by:
setFormat in interface FieldObject
Overrides:
setFormat in class TextField
Parameters:
_format - The new format value

setObject

public void setObject(java.lang.Object object)
Description copied from interface: FieldObject
Afecta o objecto com um valor e mostra no Field o seu conteudo
Se a coluna a que o campo pertence fôr chave estrangeira efectua o lookup da descodificação correspondente.

Specified by:
setObject in interface FieldObject
Overrides:
setObject in class TextField
Parameters:
object - The new object value

setValidateOnLostFocus

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

Specified by:
setValidateOnLostFocus in interface FieldObject
Overrides:
setValidateOnLostFocus in class TextField
Parameters:
_validateOnLostFocus - The new validateOnLostFocus value

getComponent

public java.awt.Component getComponent()
Description copied from interface: FieldObject
Devolve o Component associado a um FieldObject

Specified by:
getComponent in interface FieldObject
Returns:
O Component respectivo

clearImageScreen

public void clearImageScreen()
Clears all references to previously added image.

Specified by:
clearImageScreen in interface FieldObject

getRequired

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

Specified by:
getRequired in interface FieldObject
Overrides:
getRequired in class TextField
Returns:
The required value

isAutoFormat

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

Specified by:
isAutoFormat in interface FieldObject
Overrides:
isAutoFormat in class TextField
Returns:
The autoFormat value

setCodeColumn

public void setCodeColumn(java.lang.String referencedColumn)
Specified by:
setCodeColumn in interface FieldObject

setDescriptionColumn

public void setDescriptionColumn(java.lang.String descriptionColumn)
Sets the descriptionColumn attribute of the DataField object

Specified by:
setDescriptionColumn in interface FieldObject
Parameters:
descriptionColumn - The new descriptionColumn value

setForeground

public void setForeground(java.awt.Color fg)
Specified by:
setForeground in interface FieldObject

setShowCode

public void setShowCode(boolean showCode)
Sets the showCode attribute of the DataField object

Specified by:
setShowCode in interface FieldObject

setTable

public void setTable(java.lang.String table)
Specified by:
setTable in interface FieldObject

addFocListener

public void addFocListener(java.awt.event.FocusListener l)
Description copied from interface: FieldObject
Adds the specified focus listener to receive focus events from this component when this component gains input focus. If listener l is null, no exception is thrown and no action is performed.

Specified by:
addFocListener in interface FieldObject
Parameters:
l - - the focus listener

removeFocListener

public void removeFocListener(java.awt.event.FocusListener l)
Description copied from interface: FieldObject
Removes the specified focus listener so that it no longer receives focus events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.

Specified by:
removeFocListener in interface FieldObject
Parameters:
l - - the focus listener

addComboElement

public void addComboElement(java.lang.Object code,
                            java.lang.Object description)
Description copied from interface: FieldObject
Adiciona um elemento a combobox. Se o field nao for uma combobox, o metodo nao produz qualquer efeito.

Specified by:
addComboElement in interface FieldObject

setMaxColumns

public void setMaxColumns(int _maxColumns)
Sets the maxColumns attribute of the DataEditorPane object

Specified by:
setMaxColumns in interface FieldObject
Parameters:
_maxColumns - The new maxColumns value

getMaxColumns

public int getMaxColumns()
Numero maximo de caracteres numa linha

Specified by:
getMaxColumns in interface FieldObject
Returns:
The maxColumns value

getMaxLines

public int getMaxLines()
Numero maximo de linhas do painel de texto.

Specified by:
getMaxLines in interface FieldObject
Returns:
The maxLines value

setMaxLines

public void setMaxLines(int _maxLines)
Sets the maxLines attribute of the DataEditorPane object

Specified by:
setMaxLines in interface FieldObject
Parameters:
_maxLines - The new maxLines value

removeAllItems

public void removeAllItems()
Remove todos os dados que estao na combo e o vector de chaves primarias e acaba com a chave primaria corrente que se calhar ate deveria vir do data control e nao ser mantido na combobox

Specified by:
removeAllItems in interface FieldObject