com.nqadmin.swingSet
Class SSTextField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JTextField
                      extended by com.nqadmin.swingSet.SSTextField
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, javax.swing.SwingConstants

public class SSTextField
extends javax.swing.JTextField

SSTextField.java

SwingSet - Open Toolkit For Making Swing Controls Database-Aware

 SSTextField extends the JTextField. This class provides different masks
 like date mask, SSN mask etc.

Version:
$Revision: 1.24 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int DDMMYYYY
          Use this mask if mm/dd/yyyy format is required.
static int DECIMAL
          Use this if the text field contains decimal number and want to limit number of decimal places.
static int MMDDYYYY
          Use this mask if mm/dd/yyyy format is required.
static int SSN
          Use this if the text field contains SSN
 
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
TOOL_TIP_TEXT_KEY, 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
SSTextField()
          Constructs a new, empty text field.
SSTextField(int _mask)
          Constructs a new, empty text field with the specified mask.
SSTextField(int _mask, int _numberOfDecimalPlaces)
          Constructs a new, empty text field with the specified mask & number of decimal places.
SSTextField(int _mask, int _numberOfDecimalPlaces, int _align)
          Constructs a new, empty text field with the specified mask, number of decimal places, & alignment.
SSTextField(SSRowSet _sSRowSet, java.lang.String _columnName)
          Creates a SSTextField instance and binds it to the specified SSRowSet column.
SSTextField(java.lang.String _text, int _mask)
          Constructs a new text field with the specified text & mask.
 
Method Summary
 void bind(SSRowSet _sSRowSet, java.lang.String _columnName)
          Sets the SSRowSet and column name to which the component is to be bound.
 java.lang.String getColumnName()
          Returns the SSRowSet column name to which the component is bound.
 int getMask()
          Returns the text field mask.
 int getNumberOfDecimalPlaces()
          Returns the number of decimal places required.
 SSRowSet getSSRowSet()
          Returns the SSRowSet to which the component is bound.
 void setColumnName(java.lang.String _columnName)
          Sets the SSRowSet column name to which the component is bound.
 void setMask(int _mask)
          Sets the text field mask.
 void setNumberOfDecimalPlaces(int _numberOfDecimalPlaces)
          Sets the number of decimal places required.
 void setSSRowSet(SSRowSet _sSRowSet)
          Sets the SSRowSet to which the component is bound.
 
Methods inherited from class javax.swing.JTextField
addActionListener, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, 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, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MMDDYYYY

public static final int MMDDYYYY
Use this mask if mm/dd/yyyy format is required.

See Also:
Constant Field Values

DDMMYYYY

public static final int DDMMYYYY
Use this mask if mm/dd/yyyy format is required.

See Also:
Constant Field Values

SSN

public static final int SSN
Use this if the text field contains SSN

See Also:
Constant Field Values

DECIMAL

public static final int DECIMAL
Use this if the text field contains decimal number and want to limit number of decimal places.

See Also:
Constant Field Values
Constructor Detail

SSTextField

public SSTextField(java.lang.String _text,
                   int _mask)
Constructs a new text field with the specified text & mask.

Parameters:
_text - the text to be displayed.
_mask - the mask required for this textfield.

SSTextField

public SSTextField(int _mask)
Constructs a new, empty text field with the specified mask.

Parameters:
_mask - the mask required for this textfield.

SSTextField

public SSTextField()
Constructs a new, empty text field.


SSTextField

public SSTextField(int _mask,
                   int _numberOfDecimalPlaces)
Constructs a new, empty text field with the specified mask & number of decimal places. Use this constructor only if you are using a decimal mask.

Parameters:
_mask - the mask required for this textfield.
_numberOfDecimalPlaces - number of decimal places required

SSTextField

public SSTextField(int _mask,
                   int _numberOfDecimalPlaces,
                   int _align)
Constructs a new, empty text field with the specified mask, number of decimal places, & alignment. Use this constructor only if you are using a decimal mask.
 (Horizontal alignment).
 Valid aligmnets are:
  JTextField.LEFT
  JTextField.CENTER
  JTextField.RIGHT
  JTextField.LEADING
  JTextField.TRAILING

 Use this constructor only if you are using a decimal mask.

Parameters:
_mask - the mask required for this text field.
_numberOfDecimalPlaces - number of decimal places required
_align - alignment required

SSTextField

public SSTextField(SSRowSet _sSRowSet,
                   java.lang.String _columnName)
Creates a SSTextField instance and binds it to the specified SSRowSet column.

Parameters:
_sSRowSet - datasource to be used.
_columnName - name of the column to which this label should be bound
Method Detail

setColumnName

public void setColumnName(java.lang.String _columnName)
Sets the SSRowSet column name to which the component is bound.

Parameters:
_columnName - column name in the SSRowSet to which the component is bound

getColumnName

public java.lang.String getColumnName()
Returns the SSRowSet column name to which the component is bound.

Returns:
column name to which the component is bound

setSSRowSet

public void setSSRowSet(SSRowSet _sSRowSet)
Sets the SSRowSet to which the component is bound.

Parameters:
_sSRowSet - SSRowSet to which the component is bound

getSSRowSet

public SSRowSet getSSRowSet()
Returns the SSRowSet to which the component is bound.

Returns:
SSRowSet to which the component is bound

setMask

public void setMask(int _mask)
Sets the text field mask.

Parameters:
_mask - the mask required for this text field.

getMask

public int getMask()
Returns the text field mask.

Returns:
editing mask for text field

setNumberOfDecimalPlaces

public void setNumberOfDecimalPlaces(int _numberOfDecimalPlaces)
Sets the number of decimal places required. This number is used only when mask is set to DECIMAL. Default value is 2.

Parameters:
_numberOfDecimalPlaces - desired # of decimal places

getNumberOfDecimalPlaces

public int getNumberOfDecimalPlaces()
Returns the number of decimal places required. This number is used only when mask is set to DECIMAL. Default value is 2.

Returns:
desired # of decimal places

bind

public void bind(SSRowSet _sSRowSet,
                 java.lang.String _columnName)
Sets the SSRowSet and column name to which the component is to be bound.

Parameters:
_sSRowSet - datasource to be used.
_columnName - Name of the column to which this check box should be bound