planetj.gui
Class CMTextFieldJ

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 byplanetj.gui.CMTextFieldJ
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.SwingConstants
Direct Known Subclasses:
CMAs400Field, CMLimitedField, CMNumberField

public class CMTextFieldJ
extends javax.swing.JTextField
implements java.awt.event.FocusListener

Supports I18N and provides some focus handling events and other common functionality

See Also:
Serialized Form

Nested Class Summary
 
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
 
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
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
CMTextFieldJ()
          Constructor
CMTextFieldJ(javax.swing.text.Document doc, java.lang.String text, int columns)
          CMTextFieldJ constructor comment.
CMTextFieldJ(int columns)
          CMTextFieldJ constructor comment.
CMTextFieldJ(java.lang.String text)
          CMTextFieldJ constructor comment.
CMTextFieldJ(java.lang.String text, int columns)
          CMTextFieldJ constructor comment.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          The addPropertyChangeListener method was generated to support the propertyChange field.
 void clearText()
          clears out the text field *NOTE* this will make DAX bomb becasue DAX cannot handle an "" empty string
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          The firePropertyChange method was generated to support the propertyChange field.
 void focusGained(java.awt.event.FocusEvent e)
          Method to handle events for the FocusListener interface.
 void focusLost(java.awt.event.FocusEvent e)
          Method to handle events for the FocusListener interface.
 boolean getApplicable()
          adds a bit more functionality than enabled alone
 boolean getEditable()
          adds a bit more functionality than enabled alone
 boolean getEnabled()
          adds a bit more functionality than enabled alone
 java.lang.String getText()
          Overrides the getText method and trims the text if the automaticallyTrimContents property is true.
 java.lang.String getTranslation()
          Gets the translated String.
 java.lang.String getTranslationId()
          Gets the key of the translated String.
 void grabFocusGained()
          grabFocusedGained method traps the focusGained event and takes a snapshot of the current text to be evaluated for equality upon focusLost.
 void grabFocusLost()
          grabFocusedLost method traps the focusLost event and checks to see if the value for the object has changed.
 boolean isAutomaticallyTrimContents()
          Tells whether or not to trim the contents and also make sure an empty string is changed to " ".
 boolean isBlank()
          Returns true if this TextField is blank or contains no text.
 boolean isSelectAllTextOnFocusGained()
          return true if you want the entire text field's text to be selected on focus gained.
static void main(java.lang.String[] args)
          main entrypoint - starts the part when it is run as an application
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          The removePropertyChangeListener method was generated to support the propertyChange field.
 void setApplicable(boolean e)
          adds a bit more functionality than enabled alone
 void setAutomaticallyTrimContents(boolean value)
          sets whether or not to trim the text on get and set
 void setEditable(boolean e)
          override the super method to do a bit more
 void setEnabled(boolean e)
          override the super method to do a bit more
 void setSelectAllTextOnFocusGained(boolean value)
          sets if you want all the text to be selected on focus gained.
 void setText(java.lang.String key)
          Overrides the superclass to set the key for the translated String.
 void setToolTipText(java.lang.String toolTip)
          Sets the toolTipText property (java.lang.String) value.
 void setTranslation(java.lang.String newTranslation)
          Sets the String without translating it.
 
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, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, read, removeCaretListener, removeKeymap, removeNotify, 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, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CMTextFieldJ

public CMTextFieldJ()
Constructor


CMTextFieldJ

public CMTextFieldJ(int columns)
CMTextFieldJ constructor comment.

Parameters:
columns - int

CMTextFieldJ

public CMTextFieldJ(java.lang.String text)
CMTextFieldJ constructor comment.

Parameters:
text - java.lang.String

CMTextFieldJ

public CMTextFieldJ(java.lang.String text,
                    int columns)
CMTextFieldJ constructor comment.

Parameters:
text - java.lang.String
columns - int

CMTextFieldJ

public CMTextFieldJ(javax.swing.text.Document doc,
                    java.lang.String text,
                    int columns)
CMTextFieldJ constructor comment.

Parameters:
doc - javax.swing.text.Document
text - java.lang.String
columns - int
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field.


clearText

public void clearText()
clears out the text field *NOTE* this will make DAX bomb becasue DAX cannot handle an "" empty string


firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
The firePropertyChange method was generated to support the propertyChange field.


focusGained

public void focusGained(java.awt.event.FocusEvent e)
Method to handle events for the FocusListener interface.

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
e - java.awt.event.FocusEvent

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Method to handle events for the FocusListener interface.

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
e - java.awt.event.FocusEvent

getApplicable

public boolean getApplicable()
adds a bit more functionality than enabled alone


getEditable

public boolean getEditable()
adds a bit more functionality than enabled alone


getEnabled

public boolean getEnabled()
adds a bit more functionality than enabled alone


getText

public java.lang.String getText()
Overrides the getText method and trims the text if the automaticallyTrimContents property is true. If the trim results in the string becoming an empty string, " " is returned.

Returns:
java.lang.String

getTranslation

public java.lang.String getTranslation()
Gets the translated String.


getTranslationId

public java.lang.String getTranslationId()
Gets the key of the translated String.


grabFocusGained

public void grabFocusGained()
grabFocusedGained method traps the focusGained event and takes a snapshot of the current text to be evaluated for equality upon focusLost.


grabFocusLost

public void grabFocusLost()
grabFocusedLost method traps the focusLost event and checks to see if the value for the object has changed. If so, a propertyChangeEvent is fired.


isAutomaticallyTrimContents

public boolean isAutomaticallyTrimContents()
Tells whether or not to trim the contents and also make sure an empty string is changed to " ".

Returns:
boolean

isSelectAllTextOnFocusGained

public boolean isSelectAllTextOnFocusGained()
return true if you want the entire text field's text to be selected on focus gained.


main

public static void main(java.lang.String[] args)
main entrypoint - starts the part when it is run as an application

Parameters:
args - java.lang.String[]

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field.


setApplicable

public void setApplicable(boolean e)
adds a bit more functionality than enabled alone


setAutomaticallyTrimContents

public void setAutomaticallyTrimContents(boolean value)
sets whether or not to trim the text on get and set

Parameters:
value - boolean

setEditable

public void setEditable(boolean e)
override the super method to do a bit more


setEnabled

public void setEnabled(boolean e)
override the super method to do a bit more


setSelectAllTextOnFocusGained

public void setSelectAllTextOnFocusGained(boolean value)
sets if you want all the text to be selected on focus gained.


setText

public void setText(java.lang.String key)
Overrides the superclass to set the key for the translated String.


setToolTipText

public void setToolTipText(java.lang.String toolTip)
Sets the toolTipText property (java.lang.String) value.

Parameters:
toolTip - The new value for the property.
See Also:
JTextComponent.getToolTipText(java.awt.event.MouseEvent)

setTranslation

public void setTranslation(java.lang.String newTranslation)
Sets the String without translating it.


isBlank

public boolean isBlank()
Returns true if this TextField is blank or contains no text. This will return true if this TextField only contains spaces Creation date: (7/8/2003 2:37:18 PM)