## org.gjt.sp.jedit.textarea
Class JEditTextArea

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  org.gjt.sp.jedit.textarea.TextArea
                      org.gjt.sp.jedit.textarea.JEditTextArea

All Implemented Interfaces:
  java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

    public class JEditTextArea

extends TextArea

jEdit's text component.

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.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes/interfaces inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes/interfaces inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary

Fields inherited from class org.gjt.sp.jedit.textarea.TextArea
`buffer, caret, caretLine, ELECTRIC_SCROLL, hiddenCursor, multi, NO_SCROLL, NORMAL_SCROLL, painter`

Fields inherited from class javax.swing.JComponent
`accessibleContext, 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 java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`JEditTextArea(View view)` Creates a new JEditTextArea.

Method Summary
`void` `addExplicitFold()` Surrounds the selection with explicit fold markers.
`protected static void` `doWordCount(View view, java.lang.String text)`
`void` `formatParagraph()` Formats the paragraph containing the caret.
`javax.swing.JPopupMenu` `getRightClickPopup()` Returns the right click popup menu.
`int` `getSelectionEnd()` Deprecated. Instead, obtain a Selection instance using any means, and call its `getEnd()` method
`int` `getSelectionEnd(int line)` Deprecated. Instead, obtain a Selection instance using any means, and call its `getEnd(int)` method
`int` `getSelectionEndLine()` Deprecated. Instead, obtain a Selection instance using any means, and call its `getEndLine()` method
`int` `getSelectionStart()` Deprecated. Instead, obtain a Selection instance using any means, and call its `getStart()` method
`int` `getSelectionStart(int line)` Deprecated. Instead, obtain a Selection instance using any means, and call its `getStart(int)` method
`int` `getSelectionStartLine()` Deprecated. Instead, obtain a Selection instance using any means, and call its `getStartLine()` method
`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` `handlePopupTrigger(java.awt.event.MouseEvent evt)` Do the same thing as right-clicking on the text area.
`boolean` `isRightClickPopupEnabled()` Returns if the right click popup menu is enabled.
`boolean` `isSelectionRectangular()` Deprecated. Instead, check if the appropriate Selection is an instance of the Selection.Rect class.
`void` `select(int start, int end)` Deprecated. Instead, call either `addToSelection()`, or `setSelection()` with a new Selection instance.
`void` `select(int start, int end, boolean doElectricScroll)` Deprecated. Instead, call either `addToSelection()`, or `setSelection()` with a new Selection instance.
`void` `setRightClickPopup(javax.swing.JPopupMenu popup)` Sets the right click popup menu.
`void` `setRightClickPopupEnabled(boolean popupEnabled)` Sets if the right click popup menu is enabled.
`void` `setSelectionEnd(int selectionEnd)` Deprecated. Do not use.
`void` `setSelectionStart(int selectionStart)` Deprecated. Do not use.
`void` `showGoToLineDialog()` Displays the 'go to line' dialog box, and moves the caret to the specified line number.
`void` `showPopupMenu()` Shows the popup menu below the current caret position.
`void` `showWordCountDialog()` Displays the 'word count' dialog box.
`void` `smartEnd(boolean select)` On subsequent invocations, first moves the caret to the last non-whitespace character of the line, then the end of the line, then to the last visible line.
`void` `smartHome(boolean select)` On subsequent invocations, first moves the caret to the first non-whitespace character of the line, then the beginning of the line, then to the first visible line.
`void` `userInput(char ch)` Handles the insertion of the specified character.

Methods inherited from class org.gjt.sp.jedit.textarea.TextArea

`_createTextArea, addActionSet, addCaretListener, addExplicitFold, addLeftOfScrollBar, addNotify, addScrollListener, addStatusListener, addStructureMatcher, addTopComponent, addToSelection, addToSelection, backspace, backspaceWord, backspaceWord, blinkCaret, caretAutoScroll, centerCaret, collapseFold, collapseFold, createTextArea, createTextArea, delete, deleteLine, deleteParagraph, deleteToEndOfLine, deleteToStartOfLine, deleteWord, deleteWord, dispose, doWordWrap, expandFold, extendSelection, extendSelection, 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, getMarkLine, getMarkPosition, getPainter, getPhysicalLineOfScreenLine, getScreenLineEndOffset, getScreenLineOfOffset, getScreenLineStartOffset, getSelectedLines, getSelectedText, getSelectedText, getSelectedText, getSelection, getSelection, getSelectionAtOffset, getSelectionCount, getSelectionIterator, getStructureMatch, getText, getText, getText, getVisibleLines, goToEndOfLine, goToEndOfWhiteSpace, goToFirstVisibleLine, goToLastVisibleLine, goToMatchingBracket, goToNextBracket, goToNextCharacter, goToNextFold, goToNextLine, goToNextPage, goToNextParagraph, goToNextWord, goToNextWord, goToParentFold, goToPrevBracket, goToPrevCharacter, goToPrevFold, goToPrevLine, goToPrevPage, goToPrevParagraph, goToPrevWord, goToPrevWord, goToStartOfLine, goToStartOfWhiteSpace, indentSelectedLines, insert, insertEnterAndIndent, insertTabAndIndent, invalidateLine, invalidateLineRange, invalidateScreenLineRange, invertSelection, isCaretBlinkEnabled, isCtrlForRectangularSelection, isDragEnabled, isDragInProgress, isEditable, isMultipleSelectionEnabled, isOverwriteEnabled, isQuickCopyEnabled, isRectangularSelectionEnabled, joinLines, lineComment, lineInStructureScope, main, moveCaretPosition, moveCaretPosition, moveCaretPosition, narrowToFold, narrowToSelection, offsetToXY, offsetToXY, offsetToXY, processKeyEvent, propertiesChanged, rangeComment, removeCaretListener, removeFromSelection, removeFromSelection, removeLeftOfScrollBar, removeNotify, removeScrollListener, removeStatusListener, removeStructureMatcher, removeTopComponent, removeTrailingWhiteSpace, replaceSelection, 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, setDragInProgress, setElectricScroll, setFirstLine, setFirstPhysicalLine, setFirstPhysicalLine, setHorizontalOffset, setJoinNonWordChars, setMagicCaretPosition, setMouseHandler, setMultipleSelectionEnabled, setOverwriteEnabled, setQuickCopyEnabled, setRectangularSelectionEnabled, setSelectedText, setSelectedText, setSelectedText, setSelection, setSelection, setText, setTransferHandler, shiftIndentLeft, shiftIndentRight, spacesToTabs, tabsToSpaces, toggleMultipleSelectionEnabled, toggleOverwriteEnabled, toggleRectangularSelectionEnabled, toLowerCase, toString, toUpperCase, userInputTab, xToScreenLineOffset, xyToOffset, xyToOffset`

Methods inherited from class javax.swing.JComponent

`addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI`

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, 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, 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, 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, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### JEditTextArea

    public JEditTextArea(View view)

  Creates a new JEditTextArea.

Method Detail

### smartHome

    public void smartHome(boolean select)

  On subsequent invocations, first moves the caret to the first non-whitespace character of the line, then the beginning of the line, then to the first visible line.

  Overrides:
    `smartHome` in class `TextArea`
  Parameters:
    `select` - true if you want to extend selection
  Since:
    jEdit 2.7pre2

### smartEnd

    public void smartEnd(boolean select)

  On subsequent invocations, first moves the caret to the last non-whitespace character of the line, then the end of the line, then to the last visible line.

  Overrides:
    `smartEnd` in class `TextArea`
  Parameters:
    `select` - true if you want to extend selection
  Since:
    jEdit 2.7pre2

### goToBufferEnd

    public void goToBufferEnd(boolean select)

  Description copied from class: `TextArea`
  Moves the caret to the end of the buffer.

  Overrides:
    `goToBufferEnd` in class `TextArea`
  Parameters:
    `select` - true if you want to extend selection

### goToBufferStart

    public void goToBufferStart(boolean select)

  Description copied from class: `TextArea`
  Moves the caret to the beginning of the buffer.

  Overrides:
    `goToBufferStart` in class `TextArea`
  Parameters:
    `select` - true if you want to extend selection

### showGoToLineDialog

    public void showGoToLineDialog()

  Displays the 'go to line' dialog box, and moves the caret to the specified line number.

  Since:
    jEdit 2.7pre2

### userInput

    public void userInput(char ch)

  Handles the insertion of the specified character. It performs the following operations in addition to TextArea#userInput(char):
  - Inserting a space with automatic abbrev expansion enabled will try to expand the abbrev

  Overrides:
    `userInput` in class `TextArea`
  Parameters:
    `ch` - The character
  Since:
    jEdit 2.7pre3
  See Also:
    `TextArea.setSelectedText(String)`, `TextArea.isOverwriteEnabled()`

### addExplicitFold

    public void addExplicitFold()

  Surrounds the selection with explicit fold markers.

  Overrides:
    `addExplicitFold` in class `TextArea`
  Since:
    jEdit 4.0pre3

### formatParagraph

    public void formatParagraph()

  Formats the paragraph containing the caret.

  Overrides:
    `formatParagraph` in class `TextArea`
  Since:
    jEdit 2.7pre2

### doWordCount

    protected static void doWordCount(View view,
                                      java.lang.String text)

### showWordCountDialog

    public void showWordCountDialog()

  Displays the 'word count' dialog box.

  Since:
    jEdit 2.7pre2

### getView

    public View getView()

  Returns this text area's view.

  Since:
    jEdit 4.2pre5

### getSelectionStart

    @Deprecated
    public final int getSelectionStart()

  Deprecated. Instead, obtain a Selection instance using any means, and call its `getStart()` method

### getSelectionStart

    @Deprecated
    public int getSelectionStart(int line)

  Deprecated. Instead, obtain a Selection instance using any means, and call its `getStart(int)` method

### getSelectionStartLine

    @Deprecated
    public final int getSelectionStartLine()

  Deprecated. Instead, obtain a Selection instance using any means, and call its `getStartLine()` method

### setSelectionStart

    @Deprecated
    public final void setSelectionStart(int selectionStart)

  Deprecated. Do not use.

### getSelectionEnd

    @Deprecated
    public final int getSelectionEnd()

  Deprecated. Instead, obtain a Selection instance using any means, and call its `getEnd()` method

### getSelectionEnd

    @Deprecated
    public int getSelectionEnd(int line)

  Deprecated. Instead, obtain a Selection instance using any means, and call its `getEnd(int)` method

### getSelectionEndLine

    @Deprecated
    public final int getSelectionEndLine()

  Deprecated. Instead, obtain a Selection instance using any means, and call its `getEndLine()` method

### setSelectionEnd

    @Deprecated
    public final void setSelectionEnd(int selectionEnd)

  Deprecated. Do not use.

### select

    @Deprecated
    public void select(int start,
                                  int end)

  Deprecated. Instead, call either `addToSelection()`, or `setSelection()` with a new Selection instance.

### select

    @Deprecated
    public void select(int start,
                                  int end,
                                  boolean doElectricScroll)

  Deprecated. Instead, call either `addToSelection()`, or `setSelection()` with a new Selection instance.

### isSelectionRectangular

    @Deprecated
    public boolean isSelectionRectangular()

  Deprecated. Instead, check if the appropriate Selection is an instance of the Selection.Rect class.

### isRightClickPopupEnabled

    public boolean isRightClickPopupEnabled()

  Returns if the right click popup menu is enabled. The Gestures plugin uses this API.

  Since:
    jEdit 4.2pre13

### setRightClickPopupEnabled

    public void setRightClickPopupEnabled(boolean popupEnabled)

  Sets if the right click popup menu is enabled. The Gestures plugin uses this API.

  Since:
    jEdit 4.2pre13

### getRightClickPopup

    public final javax.swing.JPopupMenu getRightClickPopup()

  Returns the right click popup menu.

### setRightClickPopup

    public final void setRightClickPopup(javax.swing.JPopupMenu popup)

  Sets the right click popup menu.

  Parameters:
    `popup` - The popup

### handlePopupTrigger

    public void handlePopupTrigger(java.awt.event.MouseEvent evt)

  Do the same thing as right-clicking on the text area. The Gestures plugin uses this API.

  Since:
    jEdit 4.2pre13

### showPopupMenu

    public void showPopupMenu()

  Shows the popup menu below the current caret position.

  Since:
    4.3pre10