Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.ui
Class JFormattedTextField

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.ibm.etools.iseries.ui.JFormattedTextField
All Implemented Interfaces:
EditmaskAttributesChangeListener, JFormattedComponent, FocusListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, Scrollable, SwingConstants
Direct Known Subclasses:
JFormattedTextFieldCellEditor

public class JFormattedTextField
extends JTextField
implements JFormattedComponent, EditmaskAttributesChangeListener, FocusListener

JFormattedTextField extends javax.swing.JTextField and implements com.ibm.etools.iseries.ui.JFormattedComponent. It is a text field that allows you to define a field model, from which a formatter, validator, keystroke verifier, and data attributes can be specified. By default, JFormattedTextField uses AS400FieldModel. By default, the AS400FieldModel uses EditcodeEditwordFormatter, ComparisonRangeValidator, NumericCharacterDocument, character data type, a data length of 10, and 0 decimal places.

A formatter defines how a string can be formatted. Any data that the you enter will be validated by the validator and formatted automatically in the format defined by the formatter. Using the EditcodeEditwordFormatter class allows you to select an editcode or set a user-defined editword. If none of the editcodes or editwords provided meet your requirements, you can create your own formatter class and set the field model of the JFormattedTextField to use your defined formatter.

A validator is a class that can validate field values. Text that is set to the field is passed to a validator for validation before being formatted and set. In addition to validating data, the JFormattedTextField also validates the data type, data length, and decimal places of the data. There is a ComparisonRangeValidator class which performs a comparison validation or range validation. A comparison validation compares a field value in relation to another value. A range validation validates against a range of values. Again, if ComparisonRangeValidator does not meet your requirements, you can write your own validator class and set the JFormattedTextField's field model to use the newly-defined validator.

A keystroke verifier is a document class that is used to verify keystroke entry. A document is a data model in a Model-View-Controller (MVC) relationship that controls the data input. Characters that are not defined in the data model are not allowed to be entered; there will be a beep to notify you at a keystroke level. There are two predefined keystroke verifier classes: NumericCharacterDocument and UpperCaseDocument. If none of these keystroke verifier document classes meet your requirements, you can write your own document class and set the JFormattedTextField's field model to use that class.

DataAttributes is a used to hold the field attributes such as auto advance flag, data type, data length, decimal point symbol, size of decimal places, and background color when invalid entry occurs. By default, auto advance flag is set to false, which means that the control will not automatically advance to the next component when the maximum data length of the field is reached. Additionally, the data type is set to character; data length is set to 10; the decimal point symbol will automatically pick up the locale value of a decimal point; the decimal places are set to 0; and the reverseImageColor is set to java.awt.Color.red. These are "bound" properties, so you can change these values as you wish. Please note that the Attributes field must be an instance of com.ibm.etools.iseries.ui.DataAttributes; otherwise java.beans.PropertyVetoException will be thrown at run time.

There is a property called editmaskAttributes. When editmask is set together with editword in an EditmaskAttributes property, the view (i.e. the look of the textfield component) will change with the editmask characters appearing as part of the field. For example, if editword is "(bbb)bbb-bbbb" (where b is a blank) and editmask is "&bbb&bbb&bbbb", then the parentheses, ( and ), and hyphen (-) characters will appear in the field prior to any data entry. These characters will stay anchored in the field and you will not be able to change or delete them. You can only enter characters where a blank is specified, and the cursor will automatically skip over the editmask characters. Note: the editmask feature can only work with an editword that is specified in EditmaskAttributes. It can work for both numeric and character data types.The length of both editmask and editword should be identical and their number of blanks should be equal to the dataLength set in DataAttributes; otherwise unpredictable results may occur. Please also note that the editmaskAttributes property must be set to an instance of com.ibm.etools.iseries.ui.EditmaskAttributes; otherwise, java.beans.PropertyVetoException will be thrown at run time.

The editmask feature has to change the view (i.e. the look of a textfield component) of the JFormattedTextField and will automatically change its UI to EditmaskViewMetalTextFieldUI by default. It is not necessary for you to change the EditmaskViewUI, however, experienced users can explicitly set the appropriate UI. EditmaskViewUI should be set after EditmaskAttributes is set. Experienced users can even create their own UI class to completely change the look of the textfield component as they like. If both editword and editmask are set to "" in editmaskAttributes, then JFormattedTextField will use the default UI of JTextField, which is normally MetalTextFieldUI. There are three predefined UIs for EditmaskPlainView. They are: EditmaskViewMetalTextFieldUI, EditmaskViewBasicTextFieldUI and EditmaskViewWindowsTextFieldUI.

        // JFormattedTextField in numeric data type with length of 9 and
        // size of decimal places is 2, and with editcode '1' format
        // and validity check in range from "1000.00" to "4999999.99".
  // The field is right aligned.
        Attributes dataAtt1   = new DataAttributes(DataAttributes.DATATYPE_NUMERIC, 9, 2, '.');
        Formatter  formatter1 = new EditcodeEditwordFormatter(dataAtt1,'1',
                                                                EditcodeEditwordFormatter.EDITCODEPARM_CURRENCY,
                                                                null);
        Validator  val1       = new ComparisonRangeValidator(dataAtt1, 
                                                                ComparisonRangeValidator.VALIDITYTYPE_RANGE,
                                                                ComparisonRangeValidator.COMPARISON_NONE, 
                                                                null,
                                                                "1000.00",
                                                                "4999999.99");
        JFormattedTextField jfTextField1 = new JFormattedTextField(new AS400FieldModel(dataAtt1, formatter1, val1));
  jfTextField1.setHorizontalAlignment(JTextField.RIGHT);
        jfTextField1.setPreferredSize(new Dimension(150,25));
        panel.add(jfTextField1);

 

        // JFormattedTextField in numeric data type with length of 10 and 
        // using editmask feature, without formatting and validation.
        // The default keystroke verifier is NumericCharacterDocument
        // in AS400FieldModel.
        Attributes dataAtt2     = new DataAttributes(DataAttributes.DATATYPE_NUMERIC, 10);
        Attributes editmaskAtt2 = new EditmaskAttributes("(   )   -    ", "&   &   &    ");
        JFormattedTextField jfTextField2 = new JFormattedTextField(new AS400FieldModel(dataAtt2));
        try
        {
                jfTextField2.setEditmaskAttributes(editmaskAtt2);
        }
        catch (Exception ex)
        {
                ex.printStackTrace();
        }
        jfTextField2.setPreferredSize(new Dimension(150,25));
        panel.add(jfTextField2);

 

        // JFormattedTextField in character data type of length 15, 
        // use UpperCaseDocument as the keystroke verifier. No formatting and
        // validation.
        Attributes dataAtt3   = new DataAttributes(DataAttributes.DATATYPE_CHARACTER, 15);
        javax.swing.text.Document keyVer = new UpperCaseDocument(dataAtt3);
        JFormattedTextField jfTextField3 = new JFormattedTextField(new AS400FieldModel(dataAtt3, null, null, keyVer));
        jfTextField3.setPreferredSize(new Dimension(150,25));
        panel.add(jfTextField3);        

 

See Also:
FieldModel, AS400FieldModel, JFormattedTextField, FormattedComboBoxEditor, DataAttributes, EditcodeEditwordFormatter, ComparisonRangeValidator, NumericCharacterDocument, UpperCaseDocument, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTextField
JTextField.AccessibleJTextField
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String Copyright
           
 
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 com.ibm.etools.iseries.ui.JFormattedComponent
copyright
 
Fields inherited from interface com.ibm.etools.iseries.ui.EditmaskAttributesChangeListener
copyright
 
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
JFormattedTextField()
          Constructs a new JFormattedTextField.
JFormattedTextField(Document doc, String text, int columns)
          Constructs a new JFormattedTextField.
JFormattedTextField(Document doc, String text, int columns, FieldModel fieldModel)
          Constructs a new JFormattedTextField.
JFormattedTextField(FieldModel fieldModel)
          Creates a JFormattedTextField with the specified field model.
JFormattedTextField(int columns)
          Constructs a new JFormattedTextField with the specified number of columns.
JFormattedTextField(String text)
          Constructs a new JFormattedTextField.
JFormattedTextField(String text, int columns)
          Constructs a new JFormattedTextField.
 
Method Summary
 String convertInternalToUnformatted(String value)
          Convert an internal value to an unformatted value.
 String convertUnformattedToInternal(String text)
          Convert an unformatted value to an internal value.
static String Copyright()
          This method returns the copyright notice for this class.
 void editmaskAttributesChanged(EditmaskAttributesChangeEvent evt)
          Whenever a bound property of EditmaskAttributes changes, a EditmaskAttributesChangeEvent is fired and this method will be called by the EditmaskAttributesChangeListener.
 void focusGained(FocusEvent e)
          Called when the component gain focus.
 void focusLost(FocusEvent e)
          Called when the component lost focus.
 Color getBackground()
          Get the current background color of the component.
 Attributes getEditmaskAttributes()
           
 EditmaskViewInterface getEditmaskViewUI()
          Gets the editmaskViewUI property (com.ibm.etools.iseries.ui.EditmaskViewInterface) value.
 FieldModel getFieldModel()
           
 String getInternalValue()
           
 String getText()
          Get the current text with format.
 String getUnformattedText()
           
protected  boolean isValueValid(String strText)
           
protected  boolean isValueValidForNumeric(String strText)
           
protected  void processFocusEvent(FocusEvent fEvent)
           
 void setBackground(Color c)
          Set the background color of the component.
 void setEditmaskAttributes(Attributes ea)
          Sets the editmaskAttributes property (com.ibm.etools.iseries.ui.Attributes) value.
 void setEditmaskViewUI(EditmaskViewInterface newui)
          Sets the editmaskViewUI property value.
 void setFieldModel(FieldModel fm)
          Sets the fieldModel property (com.ibm.etools.iseries.ui.FieldModel) value.
 void setInternalValue(String value)
          The specified value will be validated by calling isValueValid method and by the validator, then it will be formatted by the formatter before setting it to the component.
 void setText(String text)
          Whatever specified in the parameter string will be formatted only if data is valid.
 void setUnformattedText(String text)
          The specified text will be validated by calling isValueValid method and by the validator, then it will be formatted by the formatter before setting it to the component.
 
Methods inherited from class javax.swing.JTextField
actionPropertyChanged, 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, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, 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, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

JFormattedTextField

public JFormattedTextField()
Constructs a new JFormattedTextField.


JFormattedTextField

public JFormattedTextField(int columns)
Constructs a new JFormattedTextField with the specified number of columns.

Parameters:
columns - the number of columns to use to calculate the preferred width. If columns is set to zero, the preferred width will be whatever naturally results from the component implementation.

JFormattedTextField

public JFormattedTextField(FieldModel fieldModel)
Creates a JFormattedTextField with the specified field model.

Parameters:
fieldModel - The field model for formatting, validating and keystroke verifying.

JFormattedTextField

public JFormattedTextField(String text)
Constructs a new JFormattedTextField.

Parameters:
text - the initial string to display, or null.

JFormattedTextField

public JFormattedTextField(String text,
                           int columns)
Constructs a new JFormattedTextField.

Parameters:
text - the initial string to display, or null.
columns - the number of columns to use to calculate the preferred width. If columns is set to zero, the preferred width will be whatever naturally results from the component implementation.

JFormattedTextField

public JFormattedTextField(Document doc,
                           String text,
                           int columns)
Constructs a new JFormattedTextField.

Parameters:
doc - the text storage to use.
text - the initial string to display, or null.
columns - the number of columns to use to calculate the preferred width. If columns is set to zero, the preferred width will be whatever naturally results from the component implementation.

JFormattedTextField

public JFormattedTextField(Document doc,
                           String text,
                           int columns,
                           FieldModel fieldModel)
Constructs a new JFormattedTextField.

Parameters:
doc - the text storage to use.
text - the initial string to display, or null.
columns - the number of columns to use to calculate the preferred width. If columns is set to zero, the preferred width will be whatever naturally results from the component implementation.
fieldModel - The field model for formatting, validating and keystroke verifying.
Method Detail

convertInternalToUnformatted

public String convertInternalToUnformatted(String value)
Convert an internal value to an unformatted value.

Parameters:
value - java.lang.String
Returns:
java.lang.String

convertUnformattedToInternal

public String convertUnformattedToInternal(String text)
Convert an unformatted value to an internal value.

Parameters:
value - java.lang.String
Returns:
java.lang.String

Copyright

public static String Copyright()
This method returns the copyright notice for this class.

Returns:
java.lang.String

editmaskAttributesChanged

public void editmaskAttributesChanged(EditmaskAttributesChangeEvent evt)
Whenever a bound property of EditmaskAttributes changes, a EditmaskAttributesChangeEvent is fired and this method will be called by the EditmaskAttributesChangeListener.

Specified by:
editmaskAttributesChanged in interface EditmaskAttributesChangeListener
Parameters:
evt - com.ibm.etools.iseries.ui.EditmaskAttributesChangeEvent

focusGained

public void focusGained(FocusEvent e)
Called when the component gain focus.

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

focusLost

public void focusLost(FocusEvent e)
Called when the component lost focus.

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

getBackground

public Color getBackground()
Get the current background color of the component.

Overrides:
getBackground in class Component
Returns:
java.awt.Color

getEditmaskAttributes

public Attributes getEditmaskAttributes()

getEditmaskViewUI

public EditmaskViewInterface getEditmaskViewUI()
Gets the editmaskViewUI property (com.ibm.etools.iseries.ui.EditmaskViewInterface) value.

Returns:
The UI with editmask feature.

getFieldModel

public FieldModel getFieldModel()
Specified by:
getFieldModel in interface JFormattedComponent

getInternalValue

public String getInternalValue()

getText

public String getText()
Get the current text with format.

Overrides:
getText in class JTextComponent
Returns:
java.lang.String

getUnformattedText

public String getUnformattedText()

isValueValid

protected boolean isValueValid(String strText)

isValueValidForNumeric

protected boolean isValueValidForNumeric(String strText)

processFocusEvent

protected void processFocusEvent(FocusEvent fEvent)
Overrides:
processFocusEvent in class Component

setBackground

public void setBackground(Color c)
Set the background color of the component.

Overrides:
setBackground in class JComponent
Parameters:
c - java.awt.Color
See Also:
getBackground()

setEditmaskAttributes

public void setEditmaskAttributes(Attributes ea)
                           throws PropertyVetoException
Sets the editmaskAttributes property (com.ibm.etools.iseries.ui.Attributes) value. Please note that the parameter must be an instance of com.ibm.etools.iseries.ui.EditmaskAttributes; otherwise java.beans.PropertyVetoException will be thrown at run time.

Parameters:
ea - The new value for the property.
Throws:
PropertyVetoException
See Also:
getEditmaskAttributes()

setEditmaskViewUI

public void setEditmaskViewUI(EditmaskViewInterface newui)
Sets the editmaskViewUI property value. The editmaskViewUI has to be set only if editmaskAttributes is set and is for editmask feature only. By default, the UI delegate of a JFormattedTextField is the default UI of javax.swing.JTextField.

Parameters:
newui - The new value for the property.
See Also:
getEditmaskViewUI()

setFieldModel

public void setFieldModel(FieldModel fm)
Sets the fieldModel property (com.ibm.etools.iseries.ui.FieldModel) value.

Specified by:
setFieldModel in interface JFormattedComponent
Parameters:
fm - The new value for the property.
See Also:
getFieldModel()

setInternalValue

public void setInternalValue(String value)
                      throws InvalidDataException
The specified value will be validated by calling isValueValid method and by the validator, then it will be formatted by the formatter before setting it to the component. If the text string is an invalid data, InvalidDataException will be thrown.

Parameters:
value - java.lang.String
Throws:
InvalidDataException
See Also:
getInternalValue()

setText

public void setText(String text)
Whatever specified in the parameter string will be formatted only if data is valid. If data is invalid exception will not be thrown as in setUnformattedText().

Overrides:
setText in class JTextComponent
Parameters:
text - java.lang.String
See Also:
getText()

setUnformattedText

public void setUnformattedText(String text)
                        throws InvalidDataException
The specified text will be validated by calling isValueValid method and by the validator, then it will be formatted by the formatter before setting it to the component. If the text string is an invalid data, InvalidDataException will be thrown.

Parameters:
text - java.lang.String
Throws:
InvalidDataException
See Also:
getUnformattedText()

Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.