public class MustTextArea extends javax.swing.JTextArea implements ContextHelp, java.awt.event.KeyListener, Undoable, ModifiedInformer
javax.swing.JTextArea.AccessibleJTextArea
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBinding
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
editBeginValue |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MustTextArea() |
MustTextArea(int rows,
int columns)
Constructs a new text area with a size as specified.
|
MustTextArea(int rows,
int columns,
int maxChars)
Constructs a new text area with a size as specified.
|
MustTextArea(java.lang.String info)
Constructs a new text area with a default width of 60 characters and
default height of 3 rows with the initial text as specified.
|
MustTextArea(java.lang.String text,
int rows,
int columns)
Constructs a new text area with initial text and size as specified.
|
MustTextArea(java.lang.String text,
int rows,
int columns,
int maxChars)
Constructs a new text area with initial text and size as specified.
|
Modifier and Type | Method and Description |
---|---|
void |
free()
Releases external resources.
|
java.lang.String |
getHelpTarget() |
java.lang.String |
getHelpTopic() |
RightMouseProvider |
getRightMouseProvider()
Returns the right mouse provider.
|
boolean |
isFilled()
Indicates whether the component has a value.
|
boolean |
isModified()
Indicates whether the component's value differs from its initial value.
|
boolean |
isRequired()
Returns true if the text field is specified as mandatory.
|
boolean |
isRequirementUnfulfilled()
Returns true if the component's value is mandatory but not filled.
|
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed.
|
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released.
|
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed.
|
void |
setHelpContext(java.lang.String helpTopic)
Sets the component's context help.
|
void |
setHelpContext(java.lang.String helpTopic,
java.lang.String helpTarget)
Sets the component's context help.
|
void |
setMaxChars(int maxChars)
Sets the maximum of characters to be inserted.
|
void |
setRequired(boolean required)
Sets the previously added component to be mandatory.
|
void |
setText(java.lang.String t) |
void |
setTextAsEditBeginValue(java.lang.String text)
Sets the text as edit begin value which causes isModified to return false
as long as user doesn't change the value.
|
void |
undo()
Undo last action.
|
append, createDefaultModel, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, replaceRange, setColumns, setFont, setLineWrap, setRows, setTabSize, setWrapStyleWord
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate, validateTree
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, 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, 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, processFocusEvent, 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, transferFocusBackward, transferFocusUpCycle
public MustTextArea()
public MustTextArea(java.lang.String info)
info
- the initial textpublic MustTextArea(int rows, int columns)
rows
- the number of rows used for renderingcolumns
- the number of columns to determine the widthpublic MustTextArea(int rows, int columns, int maxChars)
rows
- the number of rows used for renderingcolumns
- the number of columns to determine the widthmaxChars
- the maximum number of characters for inputpublic MustTextArea(java.lang.String text, int rows, int columns)
text
- the initial text of the text arearows
- the number of rows used for renderingcolumns
- the number of columns to determine the widthpublic MustTextArea(java.lang.String text, int rows, int columns, int maxChars)
text
- the initial text of the text arearows
- the number of rows used for renderingcolumns
- the number of columns to determine the widthmaxChars
- the maximum number of characters for inputpublic RightMouseProvider getRightMouseProvider()
public void setHelpContext(java.lang.String helpTopic)
helpTopic
- the context help's topicpublic void setHelpContext(java.lang.String helpTopic, java.lang.String helpTarget)
setHelpContext
in interface ContextHelp
helpTopic
- the context help's topichelpTarget
- the context help's targetpublic java.lang.String getHelpTopic()
getHelpTopic
in interface ContextHelp
public java.lang.String getHelpTarget()
getHelpTarget
in interface ContextHelp
public void setMaxChars(int maxChars)
maxChars
- the max characters to be insertedpublic void setRequired(boolean required)
required
- whether the component is mandatory or notpublic boolean isRequired()
public boolean isRequirementUnfulfilled()
public void setTextAsEditBeginValue(java.lang.String text)
newText
- the new textpublic void setText(java.lang.String t)
setText
in class javax.swing.text.JTextComponent
public boolean isFilled()
public boolean isModified()
ModifiedInformer
isModified
in interface ModifiedInformer
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- the key eventpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- the key eventpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- the key eventpublic void undo()
Undoable
public void free()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de