org.gjt.sp.jedit.textarea
Class JEditTextArea

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--org.gjt.sp.jedit.textarea.JEditTextArea
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JEditTextArea
extends javax.swing.JComponent

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.

Version:
$Id: JEditTextArea.java,v 1.188 2003/02/23 04:05:22 spestov Exp $
Author:
Slava Pestov, John Gellene (API documentation)
See Also:
Serialized Form

Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JEditTextArea(View view)
          Creates a new JEditTextArea.
 
Method Summary
 void _setFirstLine(int firstLine)
           
 void _setHorizontalOffset(int horizontalOffset)
           
 void addCaretListener(javax.swing.event.CaretListener listener)
          Adds a caret change listener to this text area.
 void addExplicitFold()
          Surrounds the selection with explicit fold markers.
 void addMarker()
          Adds a marker at the caret position.
 void addNotify()
          Called by the AWT when this component is added to a parent.
 void addScrollListener(ScrollListener listener)
          Adds a scroll listener to this text area.
 void addToSelection(Selection selection)
          Adds to the selection.
 void addToSelection(Selection[] selection)
          Adds to the selection.
 void backspace()
          Deletes the character before the caret, or the selection, if one is active.
 void backspaceWord()
          Deletes the word before the caret.
 void blinkCaret()
          Blinks the caret.
 void centerCaret()
          Centers the caret on the screen.
 void collapseFold()
          Like FoldVisibilityManager.collapseFold(int), but also moves the caret to the first line of the fold.
 void delete()
          Deletes the character after the caret.
 void deleteLine()
          Deletes the line containing the caret.
 void deleteParagraph()
          Deletes the paragraph containing the caret.
 void deleteToEndOfLine()
          Deletes from the caret to the end of the current line.
 void deleteToStartOfLine()
          Deletes from the caret to the beginning of the current line.
 void deleteWord()
          Deletes the word in front of the caret.
 void expandFold(boolean fully)
          Like FoldVisibilityManager.expandFold(int,boolean), but also moves the caret to the first sub-fold.
 void extendSelection(int offset, int end)
          Extends the selection at the specified offset, or creates a new one if there is no selection at the specified offset.
 void formatParagraph()
          Formats the paragraph containing the caret.
 int getBracketLine()
          Returns the line of the highlighted bracket (the bracket matching the one before the caret)
 int getBracketPosition()
          Returns the position of the highlighted bracket (the bracket matching the one before the caret)
 Buffer getBuffer()
          Returns the buffer this text area is editing.
 int getBufferLength()
          Returns the length of the buffer.
 int getCaretLine()
          Returns the line number containing the caret.
 int getCaretPosition()
          Returns a zero-based index of the caret position.
 int getElectricScroll()
          Returns the number of lines from the top and button of the text area that are always visible.
 int getFirstLine()
          Returns the line displayed at the text area's origin.
 int getFirstPhysicalLine()
          Returns the first visible physical line index.
 boolean getFocusTraversalKeysEnabled()
          Java 1.4 compatibility fix to make Tab key work.
 FoldVisibilityManager getFoldVisibilityManager()
          Returns the fold visibility manager used by this text area.
 Gutter getGutter()
          Returns the gutter to the left of the text area or null if the gutter is disabled
 int getHorizontalOffset()
          Returns the horizontal offset of drawn lines.
 int getLastPhysicalLine()
          Returns the last visible physical line index.
 int getLineCount()
          Returns the number of physical lines in the buffer.
 int getLineEndOffset(int line)
          Returns the end offset of the specified line.
 int getLineLength(int line)
          Returns the length of the specified line.
 int getLineOfOffset(int offset)
          Returns the line containing the specified offset.
 int getLineStartOffset(int line)
          Returns the start offset of the specified line.
 java.lang.String getLineText(int lineIndex)
          Returns the text on the specified line.
 void getLineText(int lineIndex, javax.swing.text.Segment segment)
          Copies the text on the specified line into a segment.
 int getMagicCaretPosition()
          Deprecated. Do not call this method.
 int getMarkLine()
          Deprecated. Do not use.
 int getMarkPosition()
          Deprecated. Do not use.
 TextAreaPainter getPainter()
          Returns the object responsible for painting this text area.
 int getPhysicalLineOfScreenLine(int screenLine)
          Returns the physical line number that contains the specified screen line.
 javax.swing.JPopupMenu getRightClickPopup()
          Returns the right click popup menu.
 int getScreenLineEndOffset(int line)
          Returns the end offset of the specified screen (wrapped) line.
 int getScreenLineOfOffset(int offset)
          Returns the screen (wrapped) line containing the specified offset.
 int getScreenLineStartOffset(int line)
          Returns the start offset of the specified screen (wrapped) line.
 int[] getSelectedLines()
          Returns a sorted array of line numbers on which a selection or selections are present.
 java.lang.String getSelectedText()
          Returns the text in all active selections, with a newline between each text chunk.
 java.lang.String getSelectedText(Selection s)
          Returns the text in the specified selection.
 java.lang.String getSelectedText(java.lang.String separator)
          Returns the text in all active selections.
 Selection[] getSelection()
          Returns the current selection.
 Selection getSelectionAtOffset(int offset)
          Returns the selection containing the specific offset, or null if there is no selection at that offset.
 int getSelectionCount()
          Returns the number of selections.
 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
 java.lang.String getText()
          Returns the entire text of this text area.
 java.lang.String getText(int start, int len)
          Returns the specified substring of the buffer.
 void getText(int start, int len, javax.swing.text.Segment segment)
          Copies the specified substring of the buffer into a segment.
 int getVirtualLineCount()
          Returns the number of virtual lines in the buffer.
 int getVisibleLines()
          Returns the number of lines visible in this text area.
 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 goToEndOfLine(boolean select)
          Moves the caret to the end of the current line.
 void goToEndOfWhiteSpace(boolean select)
          Moves the caret to the last non-whitespace character of the current line.
 void goToFirstVisibleLine(boolean select)
          Moves the caret to the first visible line.
 void goToLastVisibleLine(boolean select)
          Moves the caret to the last visible line.
 void goToMarker(char shortcut, boolean select)
          Moves the caret to the marker with the specified shortcut.
 void goToMatchingBracket()
          Moves the caret to the bracket matching the one before the caret.
 void goToNextBracket(boolean select)
          Moves the caret to the next closing bracket.
 void goToNextCharacter(boolean select)
          Moves the caret to the next character.
 void goToNextFold(boolean select)
          Moves the caret to the next fold.
 void goToNextLine(boolean select)
          Movse the caret to the next line.
 void goToNextMarker(boolean select)
          Moves the caret to the next marker.
 void goToNextPage(boolean select)
          Moves the caret to the next screenful.
 void goToNextParagraph(boolean select)
          Moves the caret to the start of the next paragraph.
 void goToNextWord(boolean select)
          Moves the caret to the start of the next word.
 void goToNextWord(boolean select, boolean stdNextPrevWord)
          Moves the caret to the start of the next word.
 void goToParentFold()
          Moves the caret to the fold containing the one at the caret position.
 void goToPrevBracket(boolean select)
          Moves the caret to the previous bracket.
 void goToPrevCharacter(boolean select)
          Moves the caret to the previous character.
 void goToPrevFold(boolean select)
          Moves the caret to the previous fold.
 void goToPrevLine(boolean select)
          Moves the caret to the previous line.
 void goToPrevMarker(boolean select)
          Moves the caret to the previous marker.
 void goToPrevPage(boolean select)
          Moves the caret to the previous screenful.
 void goToPrevParagraph(boolean select)
          Moves the caret to the start of the previous paragraph.
 void goToPrevWord(boolean select)
          Moves the caret to the start of the previous word.
 void goToPrevWord(boolean select, boolean stdNextPrevWord)
          Moves the caret to the start of the previous word.
 void goToStartOfLine(boolean select)
          Moves the caret to the beginning of the current line.
 void goToStartOfWhiteSpace(boolean select)
          Moves the caret to the first non-whitespace character of the current line.
 void grabFocus()
          Bug workarounds.
 boolean hasFocus()
          Bug workarounds.
 void indentSelectedLines()
          Indents all selected lines.
 void insertEnterAndIndent()
           
 void insertTabAndIndent()
           
 void invalidateLine(int line)
          Marks a line as needing a repaint.
 void invalidateLineRange(int start, int end)
          Marks a range of physical lines as needing a repaint.
 void invalidateScreenLineRange(int start, int end)
          Marks a range of screen lines as needing a repaint.
 void invalidateSelectedLines()
          Repaints the lines containing the selection.
 void invertSelection()
          Inverts the selection.
 boolean isCaretBlinkEnabled()
          Returns true if the caret is blinking, false otherwise.
 boolean isEditable()
          Returns true if this text area is editable, false otherwise.
 boolean isMultipleSelectionEnabled()
          Returns if multiple selection is enabled.
 boolean isOverwriteEnabled()
          Returns true if overwrite mode is enabled, false otherwise.
 boolean isQuickCopyEnabled()
          Returns if clicking the middle mouse button pastes the most recent selection (% register), and if Control-dragging inserts the selection at the caret.
 boolean isSelectionRectangular()
          Deprecated. Instead, check if the appropriate Selection is an instance of the Selection.Rect class.
 void joinLines()
          Joins the current and the next line.
 void lineComment()
          Prepends each line of the selection with the line comment string.
 void moveCaretPosition(int newCaret)
          Sets the caret position without deactivating the selection.
 void moveCaretPosition(int newCaret, boolean doElectricScroll)
          Sets the caret position without deactivating the selection.
 void narrowToFold()
          Hides all lines except those in the fold containing the caret.
 void narrowToSelection()
          Hides all lines except those in the selection.
 int offsetToX(int line, int offset)
          Deprecated. Call offsetToXY() instead. Converts an offset in a line into an x co-ordinate.
 java.awt.Point offsetToXY(int offset)
          Converts an offset into a point in the text area painter's co-ordinate space.
 java.awt.Point offsetToXY(int line, int offset, java.awt.Point retVal)
          Converts an offset into a point in the text area painter's co-ordinate space.
 int physicalToVirtual(int line)
          Converts a physical line number to a virtual line number.
 void processKeyEvent(java.awt.event.KeyEvent evt)
           
 void propertiesChanged()
          Called by jEdit when necessary.
 void rangeComment()
          Adds comment start and end strings to the beginning and end of the selection.
 void removeCaretListener(javax.swing.event.CaretListener listener)
          Removes a caret change listener from this text area.
 void removeFromSelection(int offset)
           
 void removeFromSelection(Selection sel)
          Deactivates the specified selection.
 void removeNotify()
          Called by the AWT when this component is removed from it's parent.
 void removeScrollListener(ScrollListener listener)
          Removes a scroll listener from this text area.
 void removeTrailingWhiteSpace()
          Removes trailing whitespace from all lines in the selection.
 void resizeSelection(int offset, int end, int extraEndVirt, boolean rect)
          Resizes the selection at the specified offset, or creates a new one if there is no selection at the specified offset.
 void scrollDownLine()
          Scrolls down by one line.
 void scrollDownPage()
          Scrolls down by one page.
 void scrollTo(int line, int offset, boolean doElectricScroll)
          Ensures that the specified location in the buffer is visible.
 void scrollToCaret(boolean doElectricScroll)
          Ensures that the caret is visible by scrolling the text area if necessary.
 void scrollUpLine()
          Scrolls up by one line.
 void scrollUpPage()
          Scrolls up by one page.
 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 selectAll()
          Selects all text in the buffer.
 void selectBlock()
          Selects the code block surrounding the caret.
 void selectFold()
          Selects the fold that contains the caret line number.
 void selectFold(int line)
          Selects the fold that contains the specified line number.
 void selectLine()
          Selects the current line.
 void selectNone()
          Deselects everything.
 void selectParagraph()
          Selects the paragraph at the caret position.
 void selectToMatchingBracket()
          Selects from the bracket at the caret position to the corresponding bracket.
 boolean selectToMatchingBracket(int position)
          Selects from the bracket at the specified position to the corresponding bracket.
 void selectWord()
          Selects the word at the caret position.
 void setBuffer(Buffer buffer)
          Sets the buffer this text area is editing.
 void setCaretBlinkEnabled(boolean caretBlinks)
          Toggles caret blinking.
 void setCaretPosition(int newCaret)
          Sets the caret position and deactivates the selection.
 void setCaretPosition(int newCaret, boolean doElectricScroll)
          Sets the caret position and deactivates the selection.
 void setElectricScroll(int electricScroll)
          Sets the number of lines from the top and bottom of the text area that are always visible
 void setFirstLine(int firstLine)
          Sets the line displayed at the text area's origin.
 void setHorizontalOffset(int horizontalOffset)
          Sets the horizontal offset of drawn lines.
 void setMagicCaretPosition(int magicCaret)
          Sets the `magic' caret position.
 void setMultipleSelectionEnabled(boolean multi)
          Set multiple selection on or off according to the value of multi.
 void setOverwriteEnabled(boolean overwrite)
          Sets overwrite mode.
 void setQuickCopyEnabled(boolean quickCopy)
          Sets if clicking the middle mouse button pastes the most recent selection (% register), and if Control-dragging inserts the selection at the caret.
 void setRightClickPopup(javax.swing.JPopupMenu popup)
          Sets the right click popup menu.
 void setSelectedText(Selection s, java.lang.String selectedText)
          Replaces the selection with the specified text.
 void setSelectedText(java.lang.String selectedText)
          Replaces the selection at the caret with the specified text.
 void setSelection(Selection selection)
          Sets the selection.
 void setSelection(Selection[] selection)
          Sets the selection.
 void setSelectionEnd(int selectionEnd)
          Deprecated. Do not use.
 void setSelectionStart(int selectionStart)
          Deprecated. Do not use.
 void setText(java.lang.String text)
          Sets the entire text of this text area.
 void shiftIndentLeft()
          Shifts the indent to the left.
 void shiftIndentRight()
          Shifts the indent to the right.
 void showGoToLineDialog()
          Displays the 'go to line' dialog box, and moves the caret to the specified line number.
 void showSelectLineRangeDialog()
          Displays the 'select line range' dialog box, and selects the specified range of lines.
 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 spacesToTabs()
          Converts spaces to tabs in the selection.
 void swapMarkerAndCaret(char shortcut)
          Moves the caret to the marker with the specified shortcut, then sets the marker position to the former caret position.
 void tabsToSpaces()
          Converts tabs to spaces in the selection.
 void toggleMultipleSelectionEnabled()
          Toggles multiple selection.
 void toggleOverwriteEnabled()
          Toggles overwrite mode.
 void toLowerCase()
          Converts the selected text to lower case.
 void toUpperCase()
          Converts the selected text to upper case.
 void updateScrollBars()
          Updates the state of the scroll bars.
 void userInput(char ch)
          Handles the insertion of the specified character.
 int virtualToPhysical(int line)
          Converts a virtual line number to a physical line number.
 int xToOffset(int line, int x)
          Deprecated. Call xyToOffset() instead. Converts an x co-ordinate to an offset within a line.
 int xToOffset(int line, int x, boolean round)
          Deprecated. Call xyToOffset() instead. Converts an x co-ordinate to an offset within a line.
 int xyToOffset(int x, int y)
          Converts a point to an offset.
 int xyToOffset(int x, int y, boolean round)
          Converts a point to an offset.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, 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
 

Constructor Detail

JEditTextArea

public JEditTextArea(View view)
Creates a new JEditTextArea.

Method Detail

getPainter

public final TextAreaPainter getPainter()
Returns the object responsible for painting this text area.


getGutter

public final Gutter getGutter()
Returns the gutter to the left of the text area or null if the gutter is disabled


getFoldVisibilityManager

public FoldVisibilityManager getFoldVisibilityManager()
Returns the fold visibility manager used by this text area.

Since:
jEdit 4.0pre1

isCaretBlinkEnabled

public final boolean isCaretBlinkEnabled()
Returns true if the caret is blinking, false otherwise.


setCaretBlinkEnabled

public void setCaretBlinkEnabled(boolean caretBlinks)
Toggles caret blinking.

Parameters:
caretBlinks - True if the caret should blink, false otherwise

getElectricScroll

public final int getElectricScroll()
Returns the number of lines from the top and button of the text area that are always visible.


setElectricScroll

public final void setElectricScroll(int electricScroll)
Sets the number of lines from the top and bottom of the text area that are always visible

Parameters:
electricScroll - The number of lines always visible from the top or bottom

isQuickCopyEnabled

public final boolean isQuickCopyEnabled()
Returns if clicking the middle mouse button pastes the most recent selection (% register), and if Control-dragging inserts the selection at the caret.


setQuickCopyEnabled

public final void setQuickCopyEnabled(boolean quickCopy)
Sets if clicking the middle mouse button pastes the most recent selection (% register), and if Control-dragging inserts the selection at the caret.

Parameters:
quickCopy - A boolean flag

getBuffer

public final Buffer getBuffer()
Returns the buffer this text area is editing.


setBuffer

public void setBuffer(Buffer buffer)
Sets the buffer this text area is editing. Do not call this method - use EditPane.setBuffer(Buffer) instead.

Parameters:
buffer - The buffer

isEditable

public final boolean isEditable()
Returns true if this text area is editable, false otherwise.


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

getFirstLine

public final int getFirstLine()
Returns the line displayed at the text area's origin. This is a virtual, not a physical, line number. See FoldVisibilityManager.virtualToPhysical(int).


setFirstLine

public void setFirstLine(int firstLine)
Sets the line displayed at the text area's origin.

Parameters:
firstLine - A virtual, not a physical, line number. See FoldVisibilityManager.physicalToVirtual(int).

_setFirstLine

public void _setFirstLine(int firstLine)

getVisibleLines

public final int getVisibleLines()
Returns the number of lines visible in this text area.


getFirstPhysicalLine

public final int getFirstPhysicalLine()
Returns the first visible physical line index.

Since:
jEdit 4.0pre4

getLastPhysicalLine

public final int getLastPhysicalLine()
Returns the last visible physical line index.

Since:
jEdit 4.0pre4

getHorizontalOffset

public final int getHorizontalOffset()
Returns the horizontal offset of drawn lines.


setHorizontalOffset

public void setHorizontalOffset(int horizontalOffset)
Sets the horizontal offset of drawn lines. This can be used to implement horizontal scrolling.

Parameters:
horizontalOffset - offset The new horizontal offset

_setHorizontalOffset

public void _setHorizontalOffset(int horizontalOffset)

updateScrollBars

public void updateScrollBars()
Updates the state of the scroll bars. This should be called if the number of lines in the buffer changes, or when the size of the text are changes.


scrollUpLine

public void scrollUpLine()
Scrolls up by one line.

Since:
jEdit 2.7pre2

scrollUpPage

public void scrollUpPage()
Scrolls up by one page.

Since:
jEdit 2.7pre2

scrollDownLine

public void scrollDownLine()
Scrolls down by one line.

Since:
jEdit 2.7pre2

scrollDownPage

public void scrollDownPage()
Scrolls down by one page.

Since:
jEdit 2.7pre2

scrollToCaret

public void scrollToCaret(boolean doElectricScroll)
Ensures that the caret is visible by scrolling the text area if necessary.

Parameters:
doElectricScroll - If true, electric scrolling will be performed

scrollTo

public void scrollTo(int line,
                     int offset,
                     boolean doElectricScroll)
Ensures that the specified location in the buffer is visible.

Parameters:
line - The line number
offset - The offset from the start of the line
doElectricScroll - If true, electric scrolling will be performed
Since:
jEdit 4.0pre6

addScrollListener

public final void addScrollListener(ScrollListener listener)
Adds a scroll listener to this text area.

Parameters:
listener - The listener
Since:
jEdit 3.2pre2

removeScrollListener

public final void removeScrollListener(ScrollListener listener)
Removes a scroll listener from this text area.

Parameters:
listener - The listener
Since:
jEdit 3.2pre2

getPhysicalLineOfScreenLine

public int getPhysicalLineOfScreenLine(int screenLine)
Returns the physical line number that contains the specified screen line.

Parameters:
screenLine - The screen line
Since:
jEdit 4.0pre6

getScreenLineOfOffset

public int getScreenLineOfOffset(int offset)
Returns the screen (wrapped) line containing the specified offset.

Parameters:
offset - The offset
Since:
jEdit 4.0pre4

getScreenLineStartOffset

public int getScreenLineStartOffset(int line)
Returns the start offset of the specified screen (wrapped) line.

Parameters:
line - The line
Since:
jEdit 4.0pre4

getScreenLineEndOffset

public int getScreenLineEndOffset(int line)
Returns the end offset of the specified screen (wrapped) line.

Parameters:
line - The line
Since:
jEdit 4.0pre4

xyToOffset

public int xyToOffset(int x,
                      int y)
Converts a point to an offset. Note that unlike in previous jEdit versions, this method now returns -1 if the y co-ordinate is out of bounds.

Parameters:
x - The x co-ordinate of the point
y - The y co-ordinate of the point

xyToOffset

public int xyToOffset(int x,
                      int y,
                      boolean round)
Converts a point to an offset. Note that unlike in previous jEdit versions, this method now returns -1 if the y co-ordinate is out of bounds.

Parameters:
x - The x co-ordinate of the point
y - The y co-ordinate of the point
round - Round up to next letter if past the middle of a letter?
Since:
jEdit 3.2pre6

offsetToXY

public java.awt.Point offsetToXY(int offset)
Converts an offset into a point in the text area painter's co-ordinate space.

Parameters:
offset - The offset
Returns:
The location of the offset on screen, or null if the specified offset is not visible

offsetToXY

public java.awt.Point offsetToXY(int line,
                                 int offset,
                                 java.awt.Point retVal)
Converts an offset into a point in the text area painter's co-ordinate space.

Parameters:
line - The physical line number
offset - The offset, from the start of the line
retVal - The point to store the return value in
Returns:
retVal for convenience, or null if the specified offset is not visible
Since:
jEdit 4.0pre4

invalidateScreenLineRange

public void invalidateScreenLineRange(int start,
                                      int end)
Marks a range of screen lines as needing a repaint.

Parameters:
start - The first line
end - The last line
Since:
jEdit 4.0pre4

invalidateLine

public void invalidateLine(int line)
Marks a line as needing a repaint.

Parameters:
line - The physical line to invalidate

invalidateLineRange

public void invalidateLineRange(int start,
                                int end)
Marks a range of physical lines as needing a repaint.

Parameters:
start - The first line to invalidate
end - The last line to invalidate

invalidateSelectedLines

public void invalidateSelectedLines()
Repaints the lines containing the selection.


physicalToVirtual

public int physicalToVirtual(int line)
Converts a physical line number to a virtual line number. See FoldVisibilityManager for details.

Parameters:
line - A physical line index
Since:
jEdit 4.0pre1

virtualToPhysical

public int virtualToPhysical(int line)
Converts a virtual line number to a physical line number. See FoldVisibilityManager for details.

Parameters:
line - A virtual line index
Since:
jEdit 4.0pre1

getBufferLength

public final int getBufferLength()
Returns the length of the buffer.


getLineCount

public final int getLineCount()
Returns the number of physical lines in the buffer.


getVirtualLineCount

public final int getVirtualLineCount()
Returns the number of virtual lines in the buffer.


getLineOfOffset

public final int getLineOfOffset(int offset)
Returns the line containing the specified offset.

Parameters:
offset - The offset

getLineStartOffset

public int getLineStartOffset(int line)
Returns the start offset of the specified line.

Parameters:
line - The line
Returns:
The start offset of the specified line, or -1 if the line is invalid

getLineEndOffset

public int getLineEndOffset(int line)
Returns the end offset of the specified line.

Parameters:
line - The line
Returns:
The end offset of the specified line, or -1 if the line is invalid.

getLineLength

public int getLineLength(int line)
Returns the length of the specified line.

Parameters:
line - The line

getText

public final java.lang.String getText(int start,
                                      int len)
Returns the specified substring of the buffer.

Parameters:
start - The start offset
len - The length of the substring
Returns:
The substring

getText

public final void getText(int start,
                          int len,
                          javax.swing.text.Segment segment)
Copies the specified substring of the buffer into a segment.

Parameters:
start - The start offset
len - The length of the substring
segment - The segment

getLineText

public final java.lang.String getLineText(int lineIndex)
Returns the text on the specified line.

Parameters:
lineIndex - The line
Returns:
The text, or null if the line is invalid

getLineText

public final void getLineText(int lineIndex,
                              javax.swing.text.Segment segment)
Copies the text on the specified line into a segment. If the line is invalid, the segment will contain a null string.

Parameters:
lineIndex - The line

getText

public java.lang.String getText()
Returns the entire text of this text area.


setText

public void setText(java.lang.String text)
Sets the entire text of this text area.


selectAll

public final void selectAll()
Selects all text in the buffer.


selectLine

public void selectLine()
Selects the current line.

Since:
jEdit 2.7pre2

selectParagraph

public void selectParagraph()
Selects the paragraph at the caret position.

Since:
jEdit 2.7pre2

selectWord

public void selectWord()
Selects the word at the caret position.

Since:
jEdit 2.7pre2

selectToMatchingBracket

public boolean selectToMatchingBracket(int position)
Selects from the bracket at the specified position to the corresponding bracket. Returns true if successful (i.e. there's a bracket at the specified position and there's a matching bracket for it), false otherwise.

Since:
jEdit 4.1pre1

selectToMatchingBracket

public void selectToMatchingBracket()
Selects from the bracket at the caret position to the corresponding bracket.

Since:
jEdit 4.0pre2

selectBlock

public void selectBlock()
Selects the code block surrounding the caret.

Since:
jEdit 2.7pre2

invertSelection

public final void invertSelection()
Inverts the selection.

Since:
jEdit 4.0pre1

getSelectionCount

public int getSelectionCount()
Returns the number of selections. This can be used to test for the existence of selections.

Since:
jEdit 3.2pre2

getSelection

public Selection[] getSelection()
Returns the current selection.

Since:
jEdit 3.2pre1

selectNone

public void selectNone()
Deselects everything.


setSelection

public void setSelection(Selection[] selection)
Sets the selection. Nested and overlapping selections are merged where possible.

Parameters:
selection - The new selection since jEdit 3.2pre1

setSelection

public void setSelection(Selection selection)
Sets the selection. Nested and overlapping selections are merged where possible.

Parameters:
selection - The new selection since jEdit 3.2pre1

addToSelection

public void addToSelection(Selection[] selection)
Adds to the selection. Nested and overlapping selections are merged where possible.

Parameters:
selection - The new selection since jEdit 3.2pre1

addToSelection

public void addToSelection(Selection selection)
Adds to the selection. Nested and overlapping selections are merged where possible.

Parameters:
selection - The new selection since jEdit 3.2pre1

getSelectionAtOffset

public Selection getSelectionAtOffset(int offset)
Returns the selection containing the specific offset, or null if there is no selection at that offset.

Parameters:
offset - The offset
Since:
jEdit 3.2pre1

removeFromSelection

public void removeFromSelection(Selection sel)
Deactivates the specified selection.

Since:
jEdit 3.2pre1

removeFromSelection

public void removeFromSelection(int offset)

resizeSelection

public void resizeSelection(int offset,
                            int end,
                            int extraEndVirt,
                            boolean rect)
Resizes the selection at the specified offset, or creates a new one if there is no selection at the specified offset. This is a utility method that is mainly useful in the mouse event handler because it handles the case of end being before offset gracefully (unlike the rest of the selection API).

Parameters:
offset - The offset
end - The new selection end
extraEndVirt - Only for rectangular selections - specifies how far it extends into virtual space.
rect - Make the selection rectangular?
Since:
jEdit 3.2pre1

extendSelection

public void extendSelection(int offset,
                            int end)
Extends the selection at the specified offset, or creates a new one if there is no selection at the specified offset. This is different from resizing in that the new chunk is added to the selection in question, instead of replacing it.

Parameters:
offset - The offset
end - The new selection end
Since:
jEdit 3.2pre1

getSelectedText

public java.lang.String getSelectedText(Selection s)
Returns the text in the specified selection.

Parameters:
s - The selection
Since:
jEdit 3.2pre1

getSelectedText

public java.lang.String getSelectedText(java.lang.String separator)
Returns the text in all active selections.

Parameters:
separator - The string to insert between each text chunk (for example, a newline)
Since:
jEdit 3.2pre1

getSelectedText

public java.lang.String getSelectedText()
Returns the text in all active selections, with a newline between each text chunk.


setSelectedText

public void setSelectedText(Selection s,
                            java.lang.String selectedText)
Replaces the selection with the specified text.

Parameters:
s - The selection
selectedText - The new text
Since:
jEdit 3.2pre1

setSelectedText

public void setSelectedText(java.lang.String selectedText)
Replaces the selection at the caret with the specified text. If there is no selection at the caret, the text is inserted at the caret position.


getSelectedLines

public int[] getSelectedLines()
Returns a sorted array of line numbers on which a selection or selections are present.

This method is the most convenient way to iterate through selected lines in a buffer. The line numbers in the array returned by this method can be passed as a parameter to such methods as Buffer.getLineText(int).

Since:
jEdit 3.2pre1

showSelectLineRangeDialog

public void showSelectLineRangeDialog()
Displays the 'select line range' dialog box, and selects the specified range of lines.

Since:
jEdit 2.7pre2

blinkCaret

public final void blinkCaret()
Blinks the caret.


centerCaret

public void centerCaret()
Centers the caret on the screen.

Since:
jEdit 2.7pre2

setCaretPosition

public void setCaretPosition(int newCaret)
Sets the caret position and deactivates the selection.


setCaretPosition

public void setCaretPosition(int newCaret,
                             boolean doElectricScroll)
Sets the caret position and deactivates the selection.

Parameters:
doElectricScroll - Do electric scrolling?

moveCaretPosition

public void moveCaretPosition(int newCaret)
Sets the caret position without deactivating the selection.


moveCaretPosition

public void moveCaretPosition(int newCaret,
                              boolean doElectricScroll)
Sets the caret position without deactivating the selection.

Parameters:
doElectricScroll - Do electric scrolling?

getCaretPosition

public int getCaretPosition()
Returns a zero-based index of the caret position.


getCaretLine

public int getCaretLine()
Returns the line number containing the caret.


getMagicCaretPosition

public final int getMagicCaretPosition()
Deprecated. Do not call this method.


setMagicCaretPosition

public final void setMagicCaretPosition(int magicCaret)
Sets the `magic' caret position. This can be used to preserve the column position when moving up and down lines.

Parameters:
magicCaret - The magic caret position

addCaretListener

public final void addCaretListener(javax.swing.event.CaretListener listener)
Adds a caret change listener to this text area.

Parameters:
listener - The listener

removeCaretListener

public final void removeCaretListener(javax.swing.event.CaretListener listener)
Removes a caret change listener from this text area.

Parameters:
listener - The listener

getBracketPosition

public final int getBracketPosition()
Returns the position of the highlighted bracket (the bracket matching the one before the caret)


getBracketLine

public final int getBracketLine()
Returns the line of the highlighted bracket (the bracket matching the one before the caret)


goToNextBracket

public void goToNextBracket(boolean select)
Moves the caret to the next closing bracket.

Since:
jEdit 2.7pre2.

goToNextCharacter

public void goToNextCharacter(boolean select)
Moves the caret to the next character.

Since:
jEdit 2.7pre2.

goToNextLine

public void goToNextLine(boolean select)
Movse the caret to the next line.

Since:
jEdit 2.7pre2

goToNextMarker

public void goToNextMarker(boolean select)
Moves the caret to the next marker.

Since:
jEdit 2.7pre2

goToNextPage

public void goToNextPage(boolean select)
Moves the caret to the next screenful.

Since:
jEdit 2.7pre2.

goToNextParagraph

public void goToNextParagraph(boolean select)
Moves the caret to the start of the next paragraph.

Since:
jEdit 2.7pre2

goToNextWord

public void goToNextWord(boolean select)
Moves the caret to the start of the next word. Note that if the "view.stdNextPrevWord" boolean propery is false, this method moves the caret to the end of the current word instead.

Since:
jEdit 2.7pre2

goToNextWord

public void goToNextWord(boolean select,
                         boolean stdNextPrevWord)
Moves the caret to the start of the next word. Note that if the "view.stdNextPrevWord" boolean propery is false, this method moves the caret to the end of the current word instead.

Since:
jEdit 4.1pre5

goToPrevBracket

public void goToPrevBracket(boolean select)
Moves the caret to the previous bracket.

Since:
jEdit 2.7pre2

goToPrevCharacter

public void goToPrevCharacter(boolean select)
Moves the caret to the previous character.

Since:
jEdit 2.7pre2.

goToPrevLine

public void goToPrevLine(boolean select)
Moves the caret to the previous line.

Since:
jEdit 2.7pre2

goToPrevMarker

public void goToPrevMarker(boolean select)
Moves the caret to the previous marker.

Since:
jEdit 2.7pre2

goToPrevPage

public void goToPrevPage(boolean select)
Moves the caret to the previous screenful.

Since:
jEdit 2.7pre2

goToPrevParagraph

public void goToPrevParagraph(boolean select)
Moves the caret to the start of the previous paragraph.

Since:
jEdit 2.7pre2

goToPrevWord

public void goToPrevWord(boolean select)
Moves the caret to the start of the previous word. Note that if the "view.stdNextPrevWord" boolean propery is false, this method moves the caret to the start of the current word instead.

Since:
jEdit 2.7pre2

goToPrevWord

public void goToPrevWord(boolean select,
                         boolean stdNextPrevWord)
Moves the caret to the start of the previous word. Note that if the "view.stdNextPrevWord" boolean propery is false, this method moves the caret to the start of the current word instead.

Since:
jEdit 4.1pre5

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.

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.

Since:
jEdit 2.7pre2

goToStartOfLine

public void goToStartOfLine(boolean select)
Moves the caret to the beginning of the current line.

Since:
jEdit 2.7pre2

goToEndOfLine

public void goToEndOfLine(boolean select)
Moves the caret to the end of the current line.

Since:
jEdit 2.7pre2

goToStartOfWhiteSpace

public void goToStartOfWhiteSpace(boolean select)
Moves the caret to the first non-whitespace character of the current line.

Since:
jEdit 2.7pre2

goToEndOfWhiteSpace

public void goToEndOfWhiteSpace(boolean select)
Moves the caret to the last non-whitespace character of the current line.

Since:
jEdit 2.7pre2

goToFirstVisibleLine

public void goToFirstVisibleLine(boolean select)
Moves the caret to the first visible line.

Since:
jEdit 2.7pre2

goToLastVisibleLine

public void goToLastVisibleLine(boolean select)
Moves the caret to the last visible line.

Since:
jEdit 2.7pre2

goToBufferStart

public void goToBufferStart(boolean select)
Moves the caret to the beginning of the buffer.

Since:
jEdit 4.0pre3

goToBufferEnd

public void goToBufferEnd(boolean select)
Moves the caret to the end of the buffer.

Since:
jEdit 4.0pre3

goToMatchingBracket

public void goToMatchingBracket()
Moves the caret to the bracket matching the one before the caret.

Since:
jEdit 2.7pre3

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. Performs auto indent, expands abbreviations, does word wrap, etc.

Parameters:
ch - The character
Since:
jEdit 2.7pre3
See Also:
setSelectedText(String), isOverwriteEnabled()

isOverwriteEnabled

public final boolean isOverwriteEnabled()
Returns true if overwrite mode is enabled, false otherwise.


setOverwriteEnabled

public final void setOverwriteEnabled(boolean overwrite)
Sets overwrite mode.


toggleOverwriteEnabled

public final void toggleOverwriteEnabled()
Toggles overwrite mode.

Since:
jEdit 2.7pre2

backspace

public void backspace()
Deletes the character before the caret, or the selection, if one is active.

Since:
jEdit 2.7pre2

backspaceWord

public void backspaceWord()
Deletes the word before the caret.

Since:
jEdit 2.7pre2

delete

public void delete()
Deletes the character after the caret.

Since:
jEdit 2.7pre2

deleteToEndOfLine

public void deleteToEndOfLine()
Deletes from the caret to the end of the current line.

Since:
jEdit 2.7pre2

deleteLine

public void deleteLine()
Deletes the line containing the caret.

Since:
jEdit 2.7pre2

deleteParagraph

public void deleteParagraph()
Deletes the paragraph containing the caret.

Since:
jEdit 2.7pre2

deleteToStartOfLine

public void deleteToStartOfLine()
Deletes from the caret to the beginning of the current line.

Since:
jEdit 2.7pre2

deleteWord

public void deleteWord()
Deletes the word in front of the caret.

Since:
jEdit 2.7pre2

isMultipleSelectionEnabled

public final boolean isMultipleSelectionEnabled()
Returns if multiple selection is enabled.

Since:
jEdit 3.2pre1

toggleMultipleSelectionEnabled

public final void toggleMultipleSelectionEnabled()
Toggles multiple selection.

Since:
jEdit 3.2pre1

setMultipleSelectionEnabled

public final void setMultipleSelectionEnabled(boolean multi)
Set multiple selection on or off according to the value of multi. This only affects the ability to make multiple selections in the user interface; macros and plugins can manipulate them regardless of the setting of this flag. In fact, in most cases, calling this method should not be necessary.

Parameters:
multi - Should multiple selection be enabled?
Since:
jEdit 3.2pre1

goToMarker

public void goToMarker(char shortcut,
                       boolean select)
Moves the caret to the marker with the specified shortcut.

Parameters:
shortcut - The shortcut
select - True if the selection should be extended, false otherwise
Since:
jEdit 3.2pre2

addMarker

public void addMarker()
Adds a marker at the caret position.

Since:
jEdit 3.2pre1

swapMarkerAndCaret

public void swapMarkerAndCaret(char shortcut)
Moves the caret to the marker with the specified shortcut, then sets the marker position to the former caret position.

Parameters:
shortcut - The shortcut
Since:
jEdit 3.2pre2

goToParentFold

public void goToParentFold()
Moves the caret to the fold containing the one at the caret position.

Since:
jEdit 4.0pre3

goToNextFold

public void goToNextFold(boolean select)
Moves the caret to the next fold.

Since:
jEdit 4.0pre3

goToPrevFold

public void goToPrevFold(boolean select)
Moves the caret to the previous fold.

Since:
jEdit 4.0pre3

collapseFold

public void collapseFold()
Like FoldVisibilityManager.collapseFold(int), but also moves the caret to the first line of the fold.

Since:
jEdit 4.0pre3

expandFold

public void expandFold(boolean fully)
Like FoldVisibilityManager.expandFold(int,boolean), but also moves the caret to the first sub-fold.

Since:
jEdit 4.0pre3

selectFold

public void selectFold()
Selects the fold that contains the caret line number.

Since:
jEdit 3.1pre3

selectFold

public void selectFold(int line)
Selects the fold that contains the specified line number.

Parameters:
line - The line number
Since:
jEdit 4.0pre1

narrowToFold

public void narrowToFold()
Hides all lines except those in the fold containing the caret.

Since:
jEdit 4.0pre1

narrowToSelection

public void narrowToSelection()
Hides all lines except those in the selection.

Since:
jEdit 4.0pre1

addExplicitFold

public void addExplicitFold()
Surrounds the selection with explicit fold markers.

Since:
jEdit 4.0pre3

lineComment

public void lineComment()
Prepends each line of the selection with the line comment string.

Since:
jEdit 3.2pre1

rangeComment

public void rangeComment()
Adds comment start and end strings to the beginning and end of the selection.

Since:
jEdit 3.2pre1

formatParagraph

public void formatParagraph()
Formats the paragraph containing the caret.

Since:
jEdit 2.7pre2

spacesToTabs

public void spacesToTabs()
Converts spaces to tabs in the selection.

Since:
jEdit 2.7pre2

tabsToSpaces

public void tabsToSpaces()
Converts tabs to spaces in the selection.

Since:
jEdit 2.7pre2

toUpperCase

public void toUpperCase()
Converts the selected text to upper case.

Since:
jEdit 2.7pre2

toLowerCase

public void toLowerCase()
Converts the selected text to lower case.

Since:
jEdit 2.7pre2

removeTrailingWhiteSpace

public void removeTrailingWhiteSpace()
Removes trailing whitespace from all lines in the selection.

Since:
jEdit 2.7pre2

insertEnterAndIndent

public void insertEnterAndIndent()

insertTabAndIndent

public void insertTabAndIndent()

indentSelectedLines

public void indentSelectedLines()
Indents all selected lines.

Since:
jEdit 3.1pre3

shiftIndentLeft

public void shiftIndentLeft()
Shifts the indent to the left.

Since:
jEdit 2.7pre2

shiftIndentRight

public void shiftIndentRight()
Shifts the indent to the right.

Since:
jEdit 2.7pre2

joinLines

public void joinLines()
Joins the current and the next line.

Since:
jEdit 2.7pre2

showWordCountDialog

public void showWordCountDialog()
Displays the 'word count' dialog box.

Since:
jEdit 2.7pre2

addNotify

public void addNotify()
Called by the AWT when this component is added to a parent. Adds document listener.

Overrides:
addNotify in class javax.swing.JComponent

removeNotify

public void removeNotify()
Called by the AWT when this component is removed from it's parent. This clears the pointer to the currently focused component. Also removes document listener.

Overrides:
removeNotify in class javax.swing.JComponent

hasFocus

public boolean hasFocus()
Bug workarounds.

Overrides:
hasFocus in class java.awt.Component
Since:
jEdit 2.7pre1

grabFocus

public void grabFocus()
Bug workarounds.

Overrides:
grabFocus in class javax.swing.JComponent
Since:
jEdit 2.7pre1

getFocusTraversalKeysEnabled

public boolean getFocusTraversalKeysEnabled()
Java 1.4 compatibility fix to make Tab key work.

Overrides:
getFocusTraversalKeysEnabled in class java.awt.Component
Since:
jEdit 3.2pre4

processKeyEvent

public void processKeyEvent(java.awt.event.KeyEvent evt)
Overrides:
processKeyEvent in class javax.swing.JComponent

propertiesChanged

public void propertiesChanged()
Called by jEdit when necessary. Plugins should not call this method.


offsetToX

public int offsetToX(int line,
                     int offset)
Deprecated. Call offsetToXY() instead. Converts an offset in a line into an x co-ordinate.

Parameters:
line - The line
offset - The offset, from the start of the line

xToOffset

public int xToOffset(int line,
                     int x)
Deprecated. Call xyToOffset() instead. Converts an x co-ordinate to an offset within a line.

Parameters:
line - The physical line index
x - The x co-ordinate

xToOffset

public int xToOffset(int line,
                     int x,
                     boolean round)
Deprecated. Call xyToOffset() instead. Converts an x co-ordinate to an offset within a line.

Parameters:
line - The physical line index
x - The x co-ordinate
round - Round up to next letter if past the middle of a letter?
Since:
jEdit 3.2pre6

getSelectionStart

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


getSelectionStart

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


getSelectionStartLine

public final int getSelectionStartLine()
Deprecated. Instead, obtain a Selection instance using any means, and call its getStartLine() method


setSelectionStart

public final void setSelectionStart(int selectionStart)
Deprecated. Do not use.


getSelectionEnd

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


getSelectionEnd

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


getSelectionEndLine

public final int getSelectionEndLine()
Deprecated. Instead, obtain a Selection instance using any means, and call its getEndLine() method


setSelectionEnd

public final void setSelectionEnd(int selectionEnd)
Deprecated. Do not use.


getMarkPosition

public final int getMarkPosition()
Deprecated. Do not use.


getMarkLine

public final int getMarkLine()
Deprecated. Do not use.


select

public void select(int start,
                   int end)
Deprecated. Instead, call either addToSelection(), or setSelection() with a new Selection instance.


select

public void select(int start,
                   int end,
                   boolean doElectricScroll)
Deprecated. Instead, call either addToSelection(), or setSelection() with a new Selection instance.


isSelectionRectangular

public boolean isSelectionRectangular()
Deprecated. Instead, check if the appropriate Selection is an instance of the Selection.Rect class.