public class JEditTextArea extends TextArea
Unlike most other text editors, the selection API permits selection and
concurrent manipulation of multiple, non-contiguous regions of text.
Methods in this class that deal with selecting text rely upon classes derived
the Selection
class.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_FOLD_PAINTER_SERVICE |
static java.lang.String |
FOLD_PAINTER_PROPERTY
Fold painter service.
|
static java.lang.String |
FOLD_PAINTER_SERVICE |
buffer, caret, caretLine, ELECTRIC_SCROLL, inputHandlerProvider, multi, NO_SCROLL, NORMAL_SCROLL, painter, popup
TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JEditTextArea(View view)
Creates a new JEditTextArea.
|
Modifier and Type | Method and Description |
---|---|
void |
addExplicitFold()
Surrounds the selection with explicit fold markers.
|
void |
createPopupMenu(java.awt.event.MouseEvent evt)
Creates the popup menu.
|
void |
dispose()
Plugins and macros should not call this method.
|
protected static void |
doWordCount(View view,
java.lang.String text) |
void |
end(boolean select)
An override to record the acutual action taken for end().
|
void |
formatParagraph()
Formats the paragraph containing the caret.
|
FoldPainter |
getFoldPainter() |
static java.lang.String |
getFoldPainterName() |
View |
getView()
Returns this text area's view.
|
void |
goToBufferEnd(boolean select)
Moves the caret to the end of the buffer.
|
void |
goToBufferStart(boolean select)
Moves the caret to the beginning of the buffer.
|
void |
goToMatchingBracket()
Moves the caret to the bracket matching the one before the caret.
|
void |
handlePopupTrigger(java.awt.event.MouseEvent evt)
Do the same thing as right-clicking on the text area.
|
void |
handlePropertiesChanged(PropertiesChanged msg) |
void |
home(boolean select)
An override to record the acutual action taken for home().
|
int |
replaceSelection(java.lang.String selectedText)
Set the selection, but does not deactivate it, and does not move the
caret.
|
void |
showGoToLineDialog()
Displays the 'go to line' dialog box, and moves the caret to the
specified line number, or moves the caret back or forward by the offset provided.
|
void |
showWordCountDialog()
Displays the 'word count' dialog box.
|
void |
smartEnd(boolean select)
An override to record the acutual action taken for smartHome().
|
void |
smartHome(boolean select)
An override to record the acutual action taken for smartHome().
|
void |
userInput(char ch)
Handles the insertion of the specified character.
|
addActionSet, addBottomLeftComponent, addBottomRightComponent, addCaretListener, addExplicitFold, addLeftOfScrollBar, addNotify, addScrollListener, addStatusListener, addStructureMatcher, addTopComponent, addTopLeftComponent, addTopRightComponent, addToSelection, addToSelection, backspace, backspaceWord, backspaceWord, backspaceWord, blinkCaret, caretAutoScroll, centerCaret, collapseFold, collapseFold, delete, deleteLine, deleteParagraph, deleteToEndOfLine, deleteToStartOfLine, deleteWord, deleteWord, doWordWrap, expandFold, extendSelection, extendSelection, getActionContext, getBuffer, getBufferLength, getCaretLine, getCaretPosition, getDisplayManager, getElectricScroll, getFirstLine, getFirstPhysicalLine, getFocusCycleRoot, getFocusTraversalKeysEnabled, getGutter, getHorizontalOffset, getInputHandler, getInputMethodRequests, getJoinNonWordChars, getLastPhysicalLine, getLastScreenLine, getLineCount, getLineEndOffset, getLineLength, getLineOfOffset, getLineStartOffset, getLineText, getLineText, getMagicCaretPosition, getMarkPosition, getPainter, getPhysicalLineOfScreenLine, getRightClickPopup, getScreenLineEndOffset, getScreenLineOfOffset, getScreenLineStartOffset, getSelectedLines, getSelectedText, getSelectedText, getSelectedText, getSelection, getSelection, getSelectionAtOffset, getSelectionCount, getSelectionIterator, getStructureMatch, getTabExpander, getText, getText, getText, getVisibleLines, getVisibleLineSegment, getVisibleLineText, getVisibleLineText, goToEndOfCode, goToEndOfLine, goToEndOfWhiteSpace, goToFirstVisibleLine, goToLastVisibleLine, goToNextBracket, goToNextCharacter, goToNextFold, goToNextLine, goToNextPage, goToNextParagraph, goToNextWord, goToNextWord, goToParentFold, goToPrevBracket, goToPrevCharacter, goToPrevFold, goToPrevLine, goToPrevPage, goToPrevParagraph, goToPrevWord, goToPrevWord, goToPrevWord, goToStartOfLine, goToStartOfWhiteSpace, indentSelectedLines, initInputHandler, insert, insertEnterAndIndent, insertTabAndIndent, invalidateLine, invalidateLineRange, invalidateScreenLineRange, invertSelection, isCaretBlinkEnabled, isCaretVisible, isCtrlForRectangularSelection, isDragEnabled, isEditable, isMultipleSelectionEnabled, isOverwriteEnabled, isQuickCopyEnabled, isRectangularSelectionEnabled, isRightClickPopupEnabled, joinLines, lineComment, lineInStructureScope, moveCaretPosition, moveCaretPosition, moveCaretPosition, narrowToFold, narrowToSelection, offsetToXY, offsetToXY, offsetToXY, processKeyEvent, propertiesChanged, rangeComment, removeCaretListener, removeFromSelection, removeFromSelection, removeLeftOfScrollBar, removeNotify, removeScrollListener, removeStatusListener, removeStructureMatcher, removeTopComponent, removeTrailingWhiteSpace, resizeSelection, scrollAndCenterCaret, scrollDownLine, scrollDownPage, scrollTo, scrollTo, scrollToCaret, scrollUpLine, scrollUpPage, selectAll, selectBlock, selectFold, selectFold, selectLine, selectNone, selectParagraph, selectToMatchingBracket, selectToMatchingBracket, selectWord, setBuffer, setCaretBlinkEnabled, setCaretPosition, setCaretPosition, setCtrlForRectangularSelection, setDragEnabled, setElectricScroll, setFirstLine, setFirstPhysicalLine, setFirstPhysicalLine, setHorizontalOffset, setJoinNonWordChars, setMagicCaretPosition, setMouseHandler, setMultipleSelectionEnabled, setOverwriteEnabled, setQuickCopyEnabled, setRectangularSelectionEnabled, setRightClickPopup, setRightClickPopupEnabled, setSelectedText, setSelectedText, setSelectedText, setSelection, setSelection, setText, setTransferHandler, shiftIndentLeft, shiftIndentRight, showPopupMenu, showPopupMenu, spacesToTabs, tabsToSpaces, toggleMultipleSelectionEnabled, toggleOverwriteEnabled, toggleRectangularSelectionEnabled, toLowerCase, toString, toUpperCase, turnOnElasticTabstops, userInputTab, xToScreenLineOffset, xyToOffset, xyToOffset
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, 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, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, 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, addInputMethodListener, 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, 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, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String FOLD_PAINTER_PROPERTY
public static final java.lang.String FOLD_PAINTER_SERVICE
public static final java.lang.String DEFAULT_FOLD_PAINTER_SERVICE
public JEditTextArea(View view)
public void dispose()
TextArea
public FoldPainter getFoldPainter()
getFoldPainter
in class TextArea
public void home(boolean select)
public void end(boolean select)
public void smartHome(boolean select)
public void smartEnd(boolean select)
public void goToBufferEnd(boolean select)
TextArea
goToBufferEnd
in class TextArea
select
- true if you want to extend selectionpublic void goToMatchingBracket()
goToMatchingBracket
in class TextArea
public void goToBufferStart(boolean select)
TextArea
goToBufferStart
in class TextArea
select
- true if you want to extend selectionpublic int replaceSelection(java.lang.String selectedText)
TextArea
TextArea.setSelectedText(String)
instead.replaceSelection
in class TextArea
selectedText
- The new selectionpublic void showGoToLineDialog()
public void userInput(char ch)
userInput
in class TextArea
ch
- The characterTextArea.setSelectedText(String)
,
TextArea.isOverwriteEnabled()
public void addExplicitFold()
addExplicitFold
in class TextArea
public void formatParagraph()
formatParagraph
in class TextArea
protected static void doWordCount(View view, java.lang.String text)
public void showWordCountDialog()
public View getView()
public static java.lang.String getFoldPainterName()
public void handlePopupTrigger(java.awt.event.MouseEvent evt)
handlePopupTrigger
in class TextArea
public void createPopupMenu(java.awt.event.MouseEvent evt)
createPopupMenu
in class TextArea
public void handlePropertiesChanged(PropertiesChanged msg)