SilverStream
Application Server 3.5

com.sssw.rt.jform
Class AgcJTextArea

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.text.JTextComponent
                         |
                         +--javax.swing.JTextArea
                               |
                               +--com.sssw.rt.jform.AgcJTextArea
All Implemented Interfaces:
Accessible, AgiHelpInfo, ImageObserver, MenuContainer, Scrollable, Serializable

public class AgcJTextArea
extends JTextArea
implements AgiHelpInfo

A lightweight component that displays multiple lines of text and accepts text input from the user. It can be bound to a database column.

The model class that SilverStream associates with a text area control is PlainDocument, which is the same as for the basic swing component JTextArea.

Properties:
Background Color, Control Type, Data Column, Editable, Enabled, Font Name, Font Size, Font Style, Height, Help Page, Horizontal Scrollbar, Left, Line Wrap, Line Wrap style, Name, Text Color, Tool Tip, Top, Validation Rules, Vertical Scrollbar, Visible, Width
Events:
focusGained, focusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, validationFailed, validationTest, valueChanged
See Also:
AgcJTextField, AgcJEditorPane, Serialized Form

Inner classes inherited from class javax.swing.JTextArea
JTextArea.AccessibleJTextArea
 
Inner classes inherited from class javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
static int NO_LIMIT
          Used to remove a limit on the allowed number of characters.
 
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
 
Constructor Summary
AgcJTextArea()
          Creates an empty text area control.
 
Method Summary
 boolean getEmptyStringIsNull()
          Finds out whether the control stores null or an empty string in the database when the field is empty.
 int getMaxLength()
          Gets the maximum number of characters allowed in the text area.
 int getMinLength()
          Gets the minimum number of characters required in the text area.
 void setEmptyStringIsNull(boolean b)
          Specifies whether the control stores null in the database instead of the empty string when the field is empty.
 void setMaxLength(int length)
          Sets the maximum number of characters the user is allowed to enter in the control.
 void setMinLength(int length)
          Sets the minimum number of characters the user is required to enter in the control.
 
Methods inherited from class javax.swing.JTextArea
append, createDefaultModel, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, isManagingFocus, paramString, processComponentKeyEvent, replaceRange, setColumns, setFont, setLineWrap, setRows, setTabSize, setWrapStyleWord
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretPosition, getDisabledTextColor, getDocument, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, isFocusTraversable, isOpaque, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setDisabledTextColor, setDocument, setEditable, setEnabled, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setOpaque, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiHelpInfo
getHelpInfo, setHelpInfo
 

Field Detail

NO_LIMIT

public static final int NO_LIMIT
Used to remove a limit on the allowed number of characters.
Constructor Detail

AgcJTextArea

public AgcJTextArea()
Creates an empty text area control.
Method Detail

getEmptyStringIsNull

public boolean getEmptyStringIsNull()
Finds out whether the control stores null or an empty string in the database when the field is empty. The setting is used only when the control is bound to a database column. Default is false.

When the control is empty, the actual value is an empty string and getText() returns an empty string, regardless of the value stored in the database.

Returns:
a boolean value, where:
  • true indicates that the control sends a null to the database
  • false indicates that it sends an empty string
See Also:
AgcJTextArea.setEmptyStringIsNull(boolean)

setEmptyStringIsNull

public void setEmptyStringIsNull(boolean b)
Specifies whether the control stores null in the database instead of the empty string when the field is empty. The setting is used only for a data-bound control.
Parameters:
b - a boolean value specifying whether the control sends a null or an empty string to the database. To store null, specify true. To store an empty string, specify false.
See Also:
AgcJTextArea.getEmptyStringIsNull()

getMaxLength

public int getMaxLength()
Gets the maximum number of characters allowed in the text area.
Returns:
an int that is the maximum number of characters. If no maximum has been set, returns the value of the AgcJTextArea.NO_LIMIT constant.
See Also:
AgcJTextArea.setMaxLength(int), AgcJTextArea.getMinLength()

getMinLength

public int getMinLength()
Gets the minimum number of characters required in the text area.
Returns:
an int that is the minimum number of characters. If no minimum has been set, returns the value of the AgcJTextArea.NO_LIMIT constant.
See Also:
AgcJTextArea.setMinLength(int), AgcJTextArea.getMaxLength()

setMaxLength

public void setMaxLength(int length)
Sets the maximum number of characters the user is allowed to enter in the control. Use the constant AgcJTextArea.NO_LIMIT to disable the limit.
Parameters:
length - an int specifying the maximum number of characters If the user tries to enter a longer string, a validationFailed event is fired.
See Also:
AgcJTextArea.getMaxLength()

setMinLength

public void setMinLength(int length)
Sets the minimum number of characters the user is required to enter in the control. Use the constant AgcJTextArea.NO_LIMIT to disable the limit.
Parameters:
length - an int specifying the minimum number of characters
Usage:
If the user tries to enter a shorter string, a validationFailed event is fired.
See Also:
AgcJTextArea.getMinLength()

SilverStream
Application Server 3.5