|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
com.retek.commons.gui.widget.RTextField
This class sub-classes the standard JTextField class in the Swing package to provide custom functionality for the Rcom client application.
This widgets has the ability to limit the number of character allowed in the field. RTextFields will remain disabled until and entry length is specified.
Retek Inc. Copyright (c) 2002
Nested Class Summary |
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 Mask |
formatMask
|
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 | |
RTextField()
Returns a new RTextField object. |
Method Summary | |
void |
clear()
Clears the text field of input. |
java.lang.String |
getClusterName()
Retrieves the cluster name of the widget. |
int |
getLength()
Returns the allowable text length. |
java.lang.String |
getText()
Retrieves the text string from the text field and returns the unformatted and trimmed version of the text. |
java.lang.String |
getUnformattedText()
Retrieves the text string from the text field. |
boolean |
isEmpty()
Retrieves whether or not the text field is empty. |
boolean |
isErrorState()
Retrieves whether or not the text field is in an error state. |
boolean |
isFormatInvalid()
Retrieves whether or not the information in the text field fails the format validation. |
boolean |
isTextModified()
Retrieves whether or not the text field has been modified since the last setText() occurred or focus was gained. |
void |
keyPressed(java.awt.event.KeyEvent event)
Implements the key listener interface "key pressed" method. |
void |
keyReleased(java.awt.event.KeyEvent event)
Implements the key listener interface "key released" method. |
void |
keyTyped(java.awt.event.KeyEvent event)
Implements the key listener interface "key typed" method. |
void |
paste()
Overrides paste() to make sure they do not paste more text than the field is allowed. |
void |
refresh()
Refreshes the text field (this will trigger the formatting and line length logic) and reset the value of the field. |
void |
removeMask()
Removes the mask assigned to this text field. |
void |
resetModifiedState()
Sets the modified state of the widget. |
void |
setBackground(java.awt.Color color)
|
void |
setClusterName(java.lang.String clusterName)
Sets the cluster name of the widget. |
void |
setDefaultSize(int width,
int height,
int length)
Sets the minimum and preferred width and height of the text field as well as the number of characters allowed in the field. |
void |
setEnabled(boolean enabled)
Overrides the superclass method in order to not only set the enabled state, but also update the color state of the text field. |
void |
setErrorState(boolean errorState)
Sets the colors of the text field to an error state. |
void |
setFocusedState()
Sets the text field to focused state, updating colors. |
void |
setForeground(java.awt.Color color)
|
void |
setFormatInvalid(boolean formatInvalid)
Sets whether or not the text field has invalidly formatted data in the field. |
void |
setLength(int textLength)
Sets the allowable text length. |
void |
setMask(Mask formatMask)
Assigns a format mask to the text field. |
void |
setMinimumSize(int width,
int height)
Sets the minimum and preferred width and height of the text field. |
void |
setMinimumWidth(int width)
Sets the minimum and preferred width of the text field. |
void |
setQuickEntries(java.util.Map map)
Sets the quick entry keystroke to replacement string mapping for the text field. |
void |
setText(java.lang.String text)
Assigns the text in the field. |
void |
setText(java.lang.String[] textArray)
Assigns the text in the text field, formatted from a string array through a mask. |
void |
setUseInactiveColor(boolean useColor)
Sets whether or not to use the inactive color state of the text field. |
void |
updateColorState()
Updates the color state. |
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, setDocument, 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, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, 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, 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 com.retek.commons.gui.core.WidgetInterface |
getName, setName |
Field Detail |
protected Mask formatMask
Constructor Detail |
public RTextField()
Method Detail |
public void setMinimumWidth(int width)
width
- The width in pixels.public void setMinimumSize(int width, int height)
width
- The width in pixels.height
- The height in pixels.public void setDefaultSize(int width, int height, int length)
width
- The width in pixels.height
- The height in pixels.length
- The length in characters that the text field should allow.public void setLength(int textLength)
public int getLength()
public void setUseInactiveColor(boolean useColor)
useColor
- True if inactive colors should be used, false if not.public void setEnabled(boolean enabled)
enabled
- True if the field should be enabled, false if it should be disabled.public void setMask(Mask formatMask)
formatMask
- A format mask to assign to this text field.public void removeMask()
public void paste()
public void refresh()
public void setText(java.lang.String text)
text
- The text to place in the text field.public void setText(java.lang.String[] textArray)
textArray
- An array of strings to format through a mask.public java.lang.String getText()
public java.lang.String getUnformattedText()
public boolean isTextModified()
public void resetModifiedState()
public boolean isEmpty()
public void clear()
public void setFormatInvalid(boolean formatInvalid)
formatInvalid
- True if the text field currently has invalid data, false if not.public boolean isFormatInvalid()
public void keyReleased(java.awt.event.KeyEvent event)
keyReleased
in interface java.awt.event.KeyListener
event
- Details about the key event that occurred.public void keyPressed(java.awt.event.KeyEvent event)
keyPressed
in interface java.awt.event.KeyListener
event
- Details about the key event that occurred.public void keyTyped(java.awt.event.KeyEvent event)
If the text in the field is selected, a new keystroke would replace the selected text and by default that means we cannot allow the event to continue.
If quick entry has been activated, the system must look for SHIFT/ALT and then find if the sequence of characters in the built up word exists in the quickmap. If it does the information should replace the text in the text area.
keyTyped
in interface java.awt.event.KeyListener
event
- Details about the key event that occurred.public void setQuickEntries(java.util.Map map)
public void setClusterName(java.lang.String clusterName)
setClusterName
in interface WidgetInterface
clusterName
- The cluster name to assign to the widget.public java.lang.String getClusterName()
getClusterName
in interface WidgetInterface
public void setBackground(java.awt.Color color)
in JTextField.
public void setForeground(java.awt.Color color)
in JTextField.
public void setErrorState(boolean errorState)
setErrorState
in interface WidgetInterface
public boolean isErrorState()
isErrorState
in interface WidgetInterface
public void setFocusedState()
setFocusedState
in interface WidgetInterface
public void updateColorState()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |