org.fife.ui.rsyntaxtextarea

## Class TextEditorPane

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.text.JTextComponent
        - - javax.swing.JTextArea
          - - org.fife.ui.rtextarea.RTextArea
            - - org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
              - - org.fife.ui.rsyntaxtextarea.TextEditorPane

All Implemented Interfaces:
  ImageObserver, MenuContainer, Printable, Serializable, EventListener, Accessible, DocumentListener, Scrollable, SyntaxConstants

    public class TextEditorPane
    extends RSyntaxTextArea
    implements DocumentListener

An extension of `RSyntaxTextArea` that adds information about the file being edited, such as:

- Its name and location.
- Is it dirty?
- Is it read-only?
- The last time it was loaded or saved to disk (local files only).
- The file's encoding on disk.
- Easy access to the line separator.

Loading and saving is also built into the editor.

Both local and remote files (e.g. ftp) are supported. See the `FileLocation` class for more information.

Version:
  1.0
Author:
  Robert Futrell
See Also:
  `FileLocation`, Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.fife.ui.rtextarea.RTextArea

`RTextArea.RTextAreaMutableCaretEvent`

### Nested classes/interfaces inherited from class javax.swing.JTextArea

`JTextArea.AccessibleJTextArea`

### Nested classes/interfaces inherited from class javax.swing.text.JTextComponent

`JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding`

### Nested classes/interfaces inherited from class javax.swing.JComponent

`JComponent.AccessibleJComponent`

### Nested classes/interfaces inherited from class java.awt.Container

`Container.AccessibleAWTContainer`

### Nested classes/interfaces inherited from class java.awt.Component

`Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy`

### Field Summary

Fields
`static String` `BACKGROUND_IMAGE_PROPERTY`
`static String` `CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY`
`static String` `CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY`
`static String` `DIRTY_PROPERTY`
`static String` `FULL_PATH_PROPERTY`
`static String` `HIGHLIGHT_CURRENT_LINE_PROPERTY`
`static long` `LAST_MODIFIED_UNKNOWN` The value returned by `getLastSaveOrLoadTime()` for remote files.
`static String` `READ_ONLY_PROPERTY`
`static String` `ROUNDED_SELECTION_PROPERTY`

### Fields inherited from class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea

`ANIMATE_BRACKET_MATCHING_PROPERTY, ANTIALIAS_PROPERTY, AUTO_INDENT_PROPERTY, BRACKET_MATCHING_PROPERTY, CLEAR_WHITESPACE_LINES_PROPERTY, CLOSE_CURLY_BRACES_PROPERTY, CLOSE_MARKUP_TAGS_PROPERTY, CODE_FOLDING_PROPERTY, EOL_VISIBLE_PROPERTY, FOCUSABLE_TIPS_PROPERTY, FRACTIONAL_FONTMETRICS_PROPERTY, HIGHLIGHT_SECONDARY_LANGUAGES_PROPERTY, HYPERLINKS_ENABLED_PROPERTY, MARK_OCCURRENCES_PROPERTY, MARKED_OCCURRENCES_CHANGED_PROPERTY, PAINT_MATCHED_BRACKET_PAIR_PROPERTY, PARSER_NOTICES_PROPERTY, SYNTAX_SCHEME_PROPERTY, SYNTAX_STYLE_PROPERTY, TAB_LINE_COLOR_PROPERTY, TAB_LINES_PROPERTY, USE_SELECTED_TEXT_COLOR_PROPERTY, VISIBLE_WHITESPACE_PROPERTY`

### Fields inherited from class org.fife.ui.rtextarea.RTextArea

`COPY_ACTION, CUT_ACTION, DELETE_ACTION, INSERT_MODE, MARK_ALL_COLOR_PROPERTY, OVERWRITE_MODE, PASTE_ACTION, REDO_ACTION, SELECT_ALL_ACTION, UNDO_ACTION`

### Fields inherited from class javax.swing.text.JTextComponent

`DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY`

### Fields inherited from class javax.swing.JComponent

`accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

### Fields inherited from class java.awt.Component

`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

### Fields inherited from interface org.fife.ui.rsyntaxtextarea.SyntaxConstants

`SYNTAX_STYLE_ACTIONSCRIPT, SYNTAX_STYLE_ASSEMBLER_X86, SYNTAX_STYLE_BBCODE, SYNTAX_STYLE_C, SYNTAX_STYLE_CLOJURE, SYNTAX_STYLE_CPLUSPLUS, SYNTAX_STYLE_CSHARP, SYNTAX_STYLE_CSS, SYNTAX_STYLE_DELPHI, SYNTAX_STYLE_DTD, SYNTAX_STYLE_FORTRAN, SYNTAX_STYLE_GROOVY, SYNTAX_STYLE_HTACCESS, SYNTAX_STYLE_HTML, SYNTAX_STYLE_JAVA, SYNTAX_STYLE_JAVASCRIPT, SYNTAX_STYLE_JSON, SYNTAX_STYLE_JSP, SYNTAX_STYLE_LATEX, SYNTAX_STYLE_LISP, SYNTAX_STYLE_LUA, SYNTAX_STYLE_MAKEFILE, SYNTAX_STYLE_MXML, SYNTAX_STYLE_NONE, SYNTAX_STYLE_NSIS, SYNTAX_STYLE_PERL, SYNTAX_STYLE_PHP, SYNTAX_STYLE_PROPERTIES_FILE, SYNTAX_STYLE_PYTHON, SYNTAX_STYLE_RUBY, SYNTAX_STYLE_SAS, SYNTAX_STYLE_SCALA, SYNTAX_STYLE_SQL, SYNTAX_STYLE_TCL, SYNTAX_STYLE_UNIX_SHELL, SYNTAX_STYLE_VISUAL_BASIC, SYNTAX_STYLE_WINDOWS_BATCH, SYNTAX_STYLE_XML`

### Fields inherited from interface java.awt.print.Printable

`NO_SUCH_PAGE, PAGE_EXISTS`

### Fields inherited from interface java.awt.image.ImageObserver

`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

### Constructor Summary

Constructors
Constructor and Description
`TextEditorPane()` Constructor.
`TextEditorPane(int textMode)` Constructor.
`TextEditorPane(int textMode, boolean wordWrapEnabled)` Creates a new `TextEditorPane`.
`TextEditorPane(int textMode, boolean wordWrapEnabled, FileLocation loc)` Creates a new `TextEditorPane`.
`TextEditorPane(int textMode, boolean wordWrapEnabled, FileLocation loc, String defaultEnc)` Creates a new `TextEditorPane`.

### Method Summary

Methods
`void` `changedUpdate(DocumentEvent e)` Callback for when styles in the current document change.
`void` `convertSpacesToTabs()` Converts all instances of a number of spaces equal to a tab size into a tab in this text area.
`void` `convertTabsToSpaces()` Converts all instances of a tab into a number of spaces equivalent to a tab in this text area.
`protected void` `forceCurrentLineHighlightRepaint()` Forces the current line highlight to be repainted.
`Color` `getBackground()` Returns the `java.awt.Color` used as the background color for this text area.
`Image` `getBackgroundImage()` Returns the image currently used for the background.
`Object` `getBackgroundObject()` Returns the `Object` representing the background for all documents in this tabbed pane; either a `java.awt.Color` or a `java.lang.Image` containing the image used as the background for this text area.
`int` `getCaretLineNumber()` Gets the line number that the caret is on.
`int` `getCaretOffsetFromLineStart()` Gets the position from the beginning of the current line that the caret is on.
`Color` `getCurrentLineHighlightColor()` Returns the color being used to highlight the current line.
`static Color` `getDefaultCaretColor()` Returns the default caret color.
`static Color` `getDefaultCurrentLineHighlightColor()` Returns the "default" color for highlighting the current line.
`static Font` `getDefaultFont()` Returns the default font for text areas.
`static Color` `getDefaultForeground()` Returns the default foreground color for text in this text area.
`static Color` `getDefaultMarginLineColor()` Returns the default color for the margin line.
`static int` `getDefaultMarginLinePosition()` Returns the default margin line position.
`static int` `getDefaultTabSize()` Returns the default tab size, in spaces.
`String` `getEncoding()` Returns the encoding to use when reading or writing this file.
`boolean` `getFadeCurrentLineHighlight()` Returns whether the current line highlight is faded.
`String` `getFileFullPath()` Returns the full path to this document.
`String` `getFileName()` Returns the file name of this document.
`boolean` `getHighlightCurrentLine()` Returns whether or not the current line is highlighted.
`long` `getLastSaveOrLoadTime()` Returns the timestamp for when this file was last loaded or saved by this editor pane.
`int` `getLineEndOffsetOfCurrentLine()` Returns the offset of the last character of the line that the caret is on.
`Object` `getLineSeparator()` Returns the line separator used when writing this file (e.g.
`int` `getLineStartOffsetOfCurrentLine()` Returns the offset of the first character of the line that the caret is on.
`Color` `getMarginLineColor()` Returns the color used to paint the margin line.
`int` `getMarginLinePixelLocation()` Returns the margin line position (in pixels) from the left-hand side of the text area.
`int` `getMarginLinePosition()` Returns the margin line position (which is the number of 'm' widths in the current font the margin line is over).
`boolean` `getRoundedSelectionEdges()` Returns whether selection edges are rounded in this text area.
`boolean` `getTabsEmulated()` Returns whether or not tabs are emulated with spaces (i.e., "soft" tabs).
`void` `insertUpdate(DocumentEvent e)` Callback for when text is inserted into the document.
`boolean` `isDirty()` Returns whether or not the text in this editor has unsaved changes.
`boolean` `isLocal()` Returns whether this file is a local file.
`boolean` `isLocalAndExists()` Returns whether this is a local file that already exists.
`boolean` `isMarginLineEnabled()` Returns whether or not the margin line is being painted.
`boolean` `isModifiedOutsideEditor()` Returns whether the text file has been modified outside of this editor since the last load or save operation.
`static boolean` `isOSX()` Returns whether the OS we're running on is OS X.
`boolean` `isReadOnly()` Returns whether or not the text area should be treated as read-only.
`void` `load(FileLocation loc, String defaultEnc)` Loads the specified file in this editor.
`protected void` `possiblyUpdateCurrentLineHighlightLocation()` Updates the current line highlight location.
`protected void` `processComponentEvent(ComponentEvent e)` Overridden so we can tell when the text area is resized and update the current-line highlight, if necessary (i.e., if it is enabled and if lineWrap is enabled.
`void` `reload()` Reloads this file from disk.
`void` `removeUpdate(DocumentEvent e)` Called whenever text is removed from this editor.
`void` `save()` Saves the file in its current encoding.
`void` `saveAs(FileLocation loc)` Saves this file in a new local location.
`void` `setBackground(Color bg)` Sets the background color of this text editor.
`void` `setBackgroundImage(Image image)` Sets this image as the background image.
`void` `setBackgroundObject(Object newBackground)` Makes the background into this `Object`.
`void` `setCurrentLineHighlightColor(Color color)` Sets the color to use to highlight the current line.
`void` `setDirty(boolean dirty)` Sets whether or not this text in this editor has unsaved changes.
`void` `setDocument(Document doc)` Sets the document for this editor.
`void` `setEncoding(String encoding)` Sets the encoding to use when reading or writing this file.
`void` `setFadeCurrentLineHighlight(boolean fade)` Sets whether the current line highlight should have a "fade" effect.
`void` `setHighlightCurrentLine(boolean highlight)` Sets whether or not the current line is highlighted.
`void` `setLineSeparator(String separator)` Sets the line separator sequence to use when this file is saved (e.g.
`void` `setLineSeparator(String separator, boolean setDirty)` Sets the line separator sequence to use when this file is saved (e.g.
`void` `setLineWrap(boolean wrap)` Sets whether or not word wrap is enabled.
`void` `setMarginLineColor(Color color)` Sets the color used to paint the margin line.
`void` `setMarginLineEnabled(boolean enabled)` Enables or disables the margin line.
`void` `setMarginLinePosition(int size)` Sets the number of 'm' widths the margin line is over.
`void` `setReadOnly(boolean readOnly)` Sets whether or not this text area should be treated as read-only.
`protected void` `setRTextAreaUI(RTextAreaUI ui)` Sets the UI for this `RTextArea`.
`void` `setTabsEmulated(boolean areEmulated)` Changes whether or not tabs should be emulated with spaces (i.e., soft tabs).
`void` `setTabSize(int size)` Workaround, since in JDK1.4 it appears that `setTabSize()` doesn't work for a `JTextArea` unless you use the constructor specifying the number of rows and columns...
`void` `syncLastSaveOrLoadTimeToActualFile()` Syncs this text area's "last saved or loaded" time to that of the file being edited, if that file is local and exists.
`protected void` `updateMarginLineX()` This is here so subclasses such as `RSyntaxTextArea` that have multiple fonts can define exactly what it means, for example, for the margin line to be "80 characters" over.
`int` `yForLine(int line)` Returns the y-coordinate of the specified line.
`int` `yForLineContaining(int offs)` Returns the y-coordinate of the line containing an offset.

### Methods inherited from class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea

`addActiveLineRangeListener, addHyperlinkListener, addNotify, addParser, appendFoldingMenu, clearParsers, configurePopupMenu, copyAsRtf, createDefaultModel, createMouseListener, createPopupMenu, createRTextAreaUI, doBracketMatching, fireCaretUpdate, foldToggled, forceReparsing, forceReparsing, getAnimateBracketMatching, getAntiAliasingEnabled, getBackgroundForToken, getCloseCurlyBraces, getCloseMarkupTags, getCodeTemplateManager, getDefaultBracketMatchBGColor, getDefaultBracketMatchBorderColor, getDefaultSelectionColor, getDefaultSyntaxScheme, getEOLMarkersVisible, getFoldManager, getFontForTokenType, getFontMetricsForTokenType, getForegroundForToken, getForegroundForTokenType, getFractionalFontMetricsEnabled, getHighlightSecondaryLanguages, getHyperlinkForeground, getHyperlinksEnabled, getLastVisibleOffset, getLineHeight, getLinkGenerator, getMarkedOccurrences, getMarkOccurrences, getMarkOccurrencesColor, getMatchedBracketBGColor, getMatchedBracketBorderColor, getMaxAscent, getPaintMarkOccurrencesBorder, getPaintMatchedBracketPair, getPaintTabLines, getParser, getParserCount, getParserNotices, getSecondaryLanguageBackground, getSecondaryLanguageCount, getShouldIndentNextLine, getSyntaxEditingStyle, getSyntaxScheme, getTabLineColor, getTemplatesEnabled, getTokenListForLine, getToolTipText, getUnderlineForToken, getUseFocusableTips, getUseSelectedTextColor, init, isAutoIndentEnabled, isBracketMatchingEnabled, isClearWhitespaceLinesEnabled, isCodeFoldingEnabled, isWhitespaceVisible, modelToToken, paintComponent, removeActiveLineRangeListener, removeHyperlinkListener, removeNotify, removeParser, restoreDefaultSyntaxScheme, saveTemplates, setActiveLineRange, setAnimateBracketMatching, setAntiAliasingEnabled, setAutoIndentEnabled, setBracketMatchingEnabled, setClearWhitespaceLinesEnabled, setCloseCurlyBraces, setCloseMarkupTags, setCodeFoldingEnabled, setEOLMarkersVisible, setFont, setFractionalFontMetricsEnabled, setHighlighter, setHighlightSecondaryLanguages, setHyperlinkForeground, setHyperlinksEnabled, setLinkGenerator, setLinkScanningMask, setMarkOccurrences, setMarkOccurrencesColor, setMatchedBracketBGColor, setMatchedBracketBorderColor, setPaintMarkOccurrencesBorder, setPaintMatchedBracketPair, setPaintTabLines, setSecondaryLanguageBackground, setSyntaxEditingStyle, setSyntaxScheme, setTabLineColor, setTemplateDirectory, setTemplatesEnabled, setUseFocusableTips, setUseSelectedTextColor, setWhitespaceVisible, viewToToken`

### Methods inherited from class org.fife.ui.rtextarea.RTextArea

`addLineHighlight, beginAtomicEdit, beginRecordingMacro, canRedo, canUndo, clearMarkAllHighlights, createPopupMenuItem, createUndoManager, discardAllEdits, endAtomicEdit, endRecordingMacro, getAction, getCurrentMacro, getDefaultMarkAllHighlightColor, getIconGroup, getMarkAllHighlightColor, getPopupMenu, getSelectedOccurrenceText, getTextMode, getToolTipSupplier, handleReplaceSelection, isRecordingMacro, loadMacro, markAll, paste, playbackLastMacro, print, read, redoLastAction, removeAllLineHighlights, removeLineHighlight, replaceRange, replaceSelection, setActionProperties, setActionProperties, setCaret, setCaretStyle, setIconGroup, setMarkAllHighlightColor, setPopupMenu, setRoundedSelectionEdges, setSelectedOccurrenceText, setTextMode, setToolTipSupplier, setUI, undoLastAction`

### Methods inherited from class javax.swing.JTextArea

`append, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, setColumns, setRows, setWrapStyleWord`

### Methods inherited from class javax.swing.text.JTextComponent

`addCaretListener, addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, print, print, print, processInputMethodEvent, removeCaretListener, removeKeymap, restoreComposedText, saveComposedText, select, selectAll, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, updateUI, viewToModel, write`

### Methods inherited from class javax.swing.JComponent

`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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

### 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, transferFocusDownCycle, validate, validateTree`

### Methods inherited from class java.awt.Component

`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### FULL_PATH_PROPERTY

    public static final String FULL_PATH_PROPERTY

See Also:
  Constant Field Values

#### DIRTY_PROPERTY

    public static final String DIRTY_PROPERTY

See Also:
  Constant Field Values

#### READ_ONLY_PROPERTY

    public static final String READ_ONLY_PROPERTY

See Also:
  Constant Field Values

#### LAST_MODIFIED_UNKNOWN

    public static final long LAST_MODIFIED_UNKNOWN

The value returned by `getLastSaveOrLoadTime()` for remote files.

See Also:
  Constant Field Values

#### BACKGROUND_IMAGE_PROPERTY

    public static final String BACKGROUND_IMAGE_PROPERTY

See Also:
  Constant Field Values

#### CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY

    public static final String CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY

See Also:
  Constant Field Values

#### CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY

    public static final String CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY

See Also:
  Constant Field Values

#### HIGHLIGHT_CURRENT_LINE_PROPERTY

    public static final String HIGHLIGHT_CURRENT_LINE_PROPERTY

See Also:
  Constant Field Values

#### ROUNDED_SELECTION_PROPERTY

    public static final String ROUNDED_SELECTION_PROPERTY

See Also:
  Constant Field Values

### Constructor Detail

#### TextEditorPane

    public TextEditorPane()

Constructor. The file will be given a default name.

#### TextEditorPane

    public TextEditorPane(int textMode)

Constructor. The file will be given a default name.

Parameters:
  `textMode` - Either `INSERT_MODE` or `OVERWRITE_MODE`.

#### TextEditorPane

    public TextEditorPane(int textMode,
                  boolean wordWrapEnabled)

Creates a new `TextEditorPane`. The file will be given a default name.

Parameters:
  `textMode` - Either `INSERT_MODE` or `OVERWRITE_MODE`.
  `wordWrapEnabled` - Whether or not to use word wrap in this pane.

#### TextEditorPane

    public TextEditorPane(int textMode,
                  boolean wordWrapEnabled,
                  FileLocation loc)
                   throws IOException

Creates a new `TextEditorPane`.

Parameters:
  `textMode` - Either `INSERT_MODE` or `OVERWRITE_MODE`.
  `wordWrapEnabled` - Whether or not to use word wrap in this pane.
  `loc` - The location of the text file being edited. If this value is `null`, a file named "Untitled.txt" in the current directory is used.
Throws:
  `IOException` - If an IO error occurs reading the file at `loc`. This of course won't happen if `loc` is `null`.

#### TextEditorPane

    public TextEditorPane(int textMode,
                  boolean wordWrapEnabled,
                  FileLocation loc,
                  String defaultEnc)
                   throws IOException

Creates a new `TextEditorPane`.

Parameters:
  `textMode` - Either `INSERT_MODE` or `OVERWRITE_MODE`.
  `wordWrapEnabled` - Whether or not to use word wrap in this pane.
  `loc` - The location of the text file being edited. If this value is `null`, a file named "Untitled.txt" in the current directory is used. This file is displayed as empty even if it actually exists.
  `defaultEnc` - The default encoding to use when opening the file, if the file is not Unicode. If this value is `null`, a system default value is used.
Throws:
  `IOException` - If an IO error occurs reading the file at `loc`. This of course won't happen if `loc` is `null`.

### Method Detail

#### changedUpdate

    public void changedUpdate(DocumentEvent e)

Callback for when styles in the current document change. This method is never called.

Specified by:
  `changedUpdate` in interface `DocumentListener`
Parameters:
  `e` - The document event.

#### getEncoding

    public String getEncoding()

Returns the encoding to use when reading or writing this file.

Returns:
  The encoding.
See Also:
  `setEncoding(String)`

#### getFileFullPath

    public String getFileFullPath()

Returns the full path to this document.

Returns:
  The full path to the document.

#### getFileName

    public String getFileName()

Returns the file name of this document.

Returns:
  The file name.

#### getLastSaveOrLoadTime

    public long getLastSaveOrLoadTime()

Returns the timestamp for when this file was last loaded or saved by this editor pane. If the file has been modified on disk by another process after it was loaded into this editor pane, this method will not return the actual file's last modified time.

For remote files, this method will always return `LAST_MODIFIED_UNKNOWN`.

Returns:
  The timestamp when this file was last loaded or saved by this editor pane, if it is a local file, or `LAST_MODIFIED_UNKNOWN` if it is a remote file.
See Also:
  `isModifiedOutsideEditor()`

#### getLineSeparator

    public Object getLineSeparator()

Returns the line separator used when writing this file (e.g. "`\n`", "`\r\n`", or "`\r`").

Note that this value is an `Object` and not a `String` as that is the way the `Document` interface defines its property values. If you always use `setLineSeparator(String)` to modify this value, then the value returned from this method will always be a `String`.

Returns:
  The line separator. If this value is `null`, then the system default line separator is used (usually the value of `System.getProperty("line.separator")`).
See Also:
  `setLineSeparator(String)`, `setLineSeparator(String, boolean)`

#### insertUpdate

    public void insertUpdate(DocumentEvent e)

Callback for when text is inserted into the document.

Specified by:
  `insertUpdate` in interface `DocumentListener`
Parameters:
  `e` - Information on the insertion.

#### isDirty

    public boolean isDirty()

Returns whether or not the text in this editor has unsaved changes.

Returns:
  Whether or not the text has unsaved changes.
See Also:
  `setDirty(boolean)`

#### isLocal

    public boolean isLocal()

Returns whether this file is a local file.

Returns:
  Whether this is a local file.

#### isLocalAndExists

    public boolean isLocalAndExists()

Returns whether this is a local file that already exists.

Returns:
  Whether this is a local file that already exists.

#### isModifiedOutsideEditor

    public boolean isModifiedOutsideEditor()

Returns whether the text file has been modified outside of this editor since the last load or save operation. Note that if this is a remote file, this method will always return `false`.

This method may be used by applications to implement a reloading feature, where the user is prompted to reload a file if it has been modified since their last open or save.

Returns:
  Whether the text file has been modified outside of this editor.
See Also:
  `getLastSaveOrLoadTime()`

#### isReadOnly

    public boolean isReadOnly()

Returns whether or not the text area should be treated as read-only.

Returns:
  Whether or not the text area should be treated as read-only.
See Also:
  `setReadOnly(boolean)`

#### load

    public void load(FileLocation loc,
            String defaultEnc)
              throws IOException

Loads the specified file in this editor. This method fires a property change event of type `FULL_PATH_PROPERTY`.

Parameters:
  `loc` - The location of the file to load. This cannot be `null`.
  `defaultEnc` - The encoding to use when loading/saving the file. This encoding will only be used if the file is not Unicode. If this value is `null`, the system default encoding is used.
Throws:
  `IOException` - If an IO error occurs.
See Also:
  `save()`, `saveAs(FileLocation)`

#### reload

    public void reload()
                throws IOException

Reloads this file from disk. The file must exist for this operation to not throw an exception.

The file's "dirty" state will be set to `false` after this operation. If this is a local file, its "last modified" time is updated to reflect that of the actual file.

Note that if the file has been modified on disk, and is now a Unicode encoding when before it wasn't (or if it is a different Unicode now), this will cause this `TextEditorPane`'s encoding to change. Otherwise, the file's encoding will stay the same.

Throws:
  `IOException` - If the file does not exist, or if an IO error occurs reading the file.
See Also:
  `isLocalAndExists()`

#### removeUpdate

    public void removeUpdate(DocumentEvent e)

Called whenever text is removed from this editor.

Specified by:
  `removeUpdate` in interface `DocumentListener`
Parameters:
  `e` - The document event.

#### save

    public void save()
              throws IOException

Saves the file in its current encoding.

The text area's "dirty" state is set to `false`, and if this is a local file, its "last modified" time is updated.

Throws:
  `IOException` - If an IO error occurs.
See Also:
  `saveAs(FileLocation)`, `load(FileLocation, String)`

#### saveAs

    public void saveAs(FileLocation loc)
                throws IOException

Saves this file in a new local location. This method fires a property change event of type `FULL_PATH_PROPERTY`.

Parameters:
  `loc` - The location to save to.
Throws:
  `IOException` - If an IO error occurs.
See Also:
  `save()`, `load(FileLocation, String)`

#### setDirty

    public void setDirty(boolean dirty)

Sets whether or not this text in this editor has unsaved changes. This fires a property change event of type `DIRTY_PROPERTY`.

Applications will usually have no need to call this method directly; the only time you might have a need to call this method directly is if you have to initialize an instance of TextEditorPane with content that does not come from a file. `TextEditorPane` automatically sets its own dirty flag when its content is edited, when its encoding is changed, or when its line ending property is changed. It is cleared whenever `load()`, `reload()`, `save()`, or `saveAs()` are called.

Parameters:
  `dirty` - Whether or not the text has been modified.
See Also:
  `isDirty()`

#### setDocument

    public void setDocument(Document doc)

Sets the document for this editor.

Overrides:
  `setDocument` in class `RSyntaxTextArea`
Parameters:
  `doc` - The new document.

#### setEncoding

    public void setEncoding(String encoding)

Sets the encoding to use when reading or writing this file. This method sets the editor's dirty flag when the encoding is changed.

Parameters:
  `encoding` - The new encoding.
Throws:
  `UnsupportedCharsetException` - If the encoding is not supported.
  `NullPointerException` - If `encoding` is `null`.
See Also:
  `getEncoding()`

#### setLineSeparator

    public void setLineSeparator(String separator)

Sets the line separator sequence to use when this file is saved (e.g. "`\n`", "`\r\n`" or "`\r`"). Besides parameter checking, this method is preferred over `getDocument().putProperty()` because it sets the editor's dirty flag when the line separator is changed.

Parameters:
  `separator` - The new line separator.
Throws:
  `NullPointerException` - If `separator` is `null`.
  `IllegalArgumentException` - If `separator` is not one of "`\n`", "`\r\n`" or "`\r`".
See Also:
  `getLineSeparator()`

#### setLineSeparator

    public void setLineSeparator(String separator,
                        boolean setDirty)

Sets the line separator sequence to use when this file is saved (e.g. "`\n`", "`\r\n`" or "`\r`"). Besides parameter checking, this method is preferred over `getDocument().putProperty()` because can set the editor's dirty flag when the line separator is changed.

Parameters:
  `separator` - The new line separator.
  `setDirty` - Whether the dirty flag should be set if the line separator is changed.
Throws:
  `NullPointerException` - If `separator` is `null`.
  `IllegalArgumentException` - If `separator` is not one of "`\n`", "`\r\n`" or "`\r`".
See Also:
  `getLineSeparator()`

#### setReadOnly

    public void setReadOnly(boolean readOnly)

Sets whether or not this text area should be treated as read-only. This fires a property change event of type `READ_ONLY_PROPERTY`.

Parameters:
  `readOnly` - Whether or not the document is read-only.
See Also:
  `isReadOnly()`

#### syncLastSaveOrLoadTimeToActualFile

    public void syncLastSaveOrLoadTimeToActualFile()

Syncs this text area's "last saved or loaded" time to that of the file being edited, if that file is local and exists. If the file is remote or is local but does not yet exist, nothing happens.

You normally do not have to call this method, as the "last saved or loaded" time for `TextEditorPane`s is kept up-to-date internally during such operations as `save()`, `reload()`, etc.

See Also:
  `getLastSaveOrLoadTime()`, `isModifiedOutsideEditor()`

#### convertSpacesToTabs

    public void convertSpacesToTabs()

Converts all instances of a number of spaces equal to a tab size into a tab in this text area.

See Also:
  `convertTabsToSpaces()`, `getTabsEmulated()`, `setTabsEmulated(boolean)`

#### convertTabsToSpaces

    public void convertTabsToSpaces()

Converts all instances of a tab into a number of spaces equivalent to a tab in this text area.

See Also:
  `convertSpacesToTabs()`, `getTabsEmulated()`, `setTabsEmulated(boolean)`

#### forceCurrentLineHighlightRepaint

    protected void forceCurrentLineHighlightRepaint()

Forces the current line highlight to be repainted. This hack is necessary for those situations when the view (appearance) changes but the caret's location hasn't (and thus the current line highlight coordinates won't get changed). Examples of this are when word wrap is toggled and when syntax styles are changed in an `RSyntaxTextArea`.

#### getBackground

    public final Color getBackground()

Returns the `java.awt.Color` used as the background color for this text area. If a `java.awt.Image` image is currently being used instead, `null` is returned.

Overrides:
  `getBackground` in class `Component`
Returns:
  The current background color, or `null` if an image is currently the background.

#### getBackgroundImage

    public final Image getBackgroundImage()

Returns the image currently used for the background. If the current background is currently a `java.awt.Color` and not a `java.awt.Image`, then `null` is returned.

Returns:
  A `java.awt.Image` used for the background, or `null` if the background is not an image.
See Also:
  `setBackgroundImage(java.awt.Image)`

#### getBackgroundObject

    public final Object getBackgroundObject()

Returns the `Object` representing the background for all documents in this tabbed pane; either a `java.awt.Color` or a `java.lang.Image` containing the image used as the background for this text area.

Returns:
  The `Object` used for the background.
See Also:
  `setBackgroundObject(Object newBackground)`

#### getCaretLineNumber

    public final int getCaretLineNumber()

Gets the line number that the caret is on.

Returns:
  The zero-based line number that the caret is on.

#### getCaretOffsetFromLineStart

    public final int getCaretOffsetFromLineStart()

Gets the position from the beginning of the current line that the caret is on.

Returns:
  The zero-based position from the beginning of the current line that the caret is on.

#### getCurrentLineHighlightColor

    public Color getCurrentLineHighlightColor()

Returns the color being used to highlight the current line. Note that if highlighting the current line is turned off, you will not be seeing this highlight.

Returns:
  The color being used to highlight the current line.
See Also:
  `getHighlightCurrentLine()`, `setHighlightCurrentLine(boolean)`, `setCurrentLineHighlightColor(java.awt.Color)`

#### getDefaultCaretColor

    public static final Color getDefaultCaretColor()

Returns the default caret color.

Returns:
  The default caret color.

#### getDefaultCurrentLineHighlightColor

    public static final Color getDefaultCurrentLineHighlightColor()

Returns the "default" color for highlighting the current line. Note that this color was chosen only because it looks nice (to me) against a white background.

Returns:
  The default color for highlighting the current line.

#### getDefaultFont

    public static final Font getDefaultFont()

Returns the default font for text areas.

Returns:
  The default font.

#### getDefaultForeground

    public static final Color getDefaultForeground()

Returns the default foreground color for text in this text area.

Returns:
  The default foreground color.

#### getDefaultMarginLineColor

    public static final Color getDefaultMarginLineColor()

Returns the default color for the margin line.

Returns:
  The default margin line color.
See Also:
  `getMarginLineColor()`, `setMarginLineColor(Color)`

#### getDefaultMarginLinePosition

    public static final int getDefaultMarginLinePosition()

Returns the default margin line position.

Returns:
  The default margin line position.
See Also:
  `getMarginLinePosition()`, `setMarginLinePosition(int)`

#### getDefaultTabSize

    public static final int getDefaultTabSize()

Returns the default tab size, in spaces.

Returns:
  The default tab size.

#### getFadeCurrentLineHighlight

    public boolean getFadeCurrentLineHighlight()

Returns whether the current line highlight is faded.

Returns:
  Whether the current line highlight is faded.
See Also:
  `setFadeCurrentLineHighlight(boolean)`

#### getHighlightCurrentLine

    public boolean getHighlightCurrentLine()

Returns whether or not the current line is highlighted.

Returns:
  Whether or the current line is highlighted.
See Also:
  `setHighlightCurrentLine(boolean)`, `getCurrentLineHighlightColor()`, `setCurrentLineHighlightColor(java.awt.Color)`

#### getLineEndOffsetOfCurrentLine

    public final int getLineEndOffsetOfCurrentLine()

Returns the offset of the last character of the line that the caret is on.

Returns:
  The last offset of the line that the caret is currently on.

#### getLineStartOffsetOfCurrentLine

    public final int getLineStartOffsetOfCurrentLine()

Returns the offset of the first character of the line that the caret is on.

Returns:
  The first offset of the line that the caret is currently on.

#### getMarginLineColor

    public Color getMarginLineColor()

Returns the color used to paint the margin line.

Returns:
  The margin line color.
See Also:
  `setMarginLineColor(Color)`

#### getMarginLinePixelLocation

    public int getMarginLinePixelLocation()

Returns the margin line position (in pixels) from the left-hand side of the text area.

Returns:
  The margin line position.
See Also:
  `getDefaultMarginLinePosition()`, `setMarginLinePosition(int)`

#### getMarginLinePosition

    public int getMarginLinePosition()

Returns the margin line position (which is the number of 'm' widths in the current font the margin line is over).

Returns:
  The margin line position.
See Also:
  `getDefaultMarginLinePosition()`, `setMarginLinePosition(int)`

#### getRoundedSelectionEdges

    public boolean getRoundedSelectionEdges()

Returns whether selection edges are rounded in this text area.

Returns:
  Whether selection edges are rounded.
See Also:
  `setRoundedSelectionEdges(boolean)`

#### getTabsEmulated

    public boolean getTabsEmulated()

Returns whether or not tabs are emulated with spaces (i.e., "soft" tabs).

Returns:
  `true` if tabs are emulated with spaces; `false` if they aren't.
See Also:
  `setTabsEmulated(boolean)`

#### isMarginLineEnabled

    public boolean isMarginLineEnabled()

Returns whether or not the margin line is being painted.

Returns:
  Whether or not the margin line is being painted.
See Also:
  `setMarginLineEnabled(boolean)`

#### isOSX

    public static boolean isOSX()

Returns whether the OS we're running on is OS X.

Returns:
  Whether the OS we're running on is OS X.

#### possiblyUpdateCurrentLineHighlightLocation

    protected void possiblyUpdateCurrentLineHighlightLocation()

Updates the current line highlight location.

#### processComponentEvent

    protected void processComponentEvent(ComponentEvent e)

Overridden so we can tell when the text area is resized and update the current-line highlight, if necessary (i.e., if it is enabled and if lineWrap is enabled.

Overrides:
  `processComponentEvent` in class `Component`
Parameters:
  `e` - The component event about to be sent to all registered `ComponentListener`s.

#### setBackground

    public void setBackground(Color bg)

Sets the background color of this text editor. Note that this is equivalent to calling `setBackgroundObject(bg)`. NOTE: the opaque property is set to `true` when the background is set to a color (by this method). When an image is used for the background, opaque is set to false. This is because we perform better when setOpaque is true, but if we use an image for the background when opaque is true, we get on-screen garbage when the user scrolls via the arrow keys. Thus we need setOpaque to be false in that case.

You never have to change the opaque property yourself; it is always done for you.

Overrides:
  `setBackground` in class `JComponent`
Parameters:
  `bg` - The color to use as the background color.

#### setBackgroundImage

    public void setBackgroundImage(Image image)

Sets this image as the background image. This method fires a property change event of type `BACKGROUND_IMAGE_PROPERTY`.

NOTE: the opaque property is set to `true` when the background is set to a color. When an image is used for the background (by this method), opaque is set to false. This is because we perform better when setOpaque is true, but if we use an image for the background when opaque is true, we get on-screen garbage when the user scrolls via the arrow keys. Thus we need setOpaque to be false in that case.

You never have to change the opaque property yourself; it is always done for you.

Parameters:
  `image` - The image to use as this text area's background.
See Also:
  `getBackgroundImage()`

#### setBackgroundObject

    public void setBackgroundObject(Object newBackground)

Makes the background into this `Object`.

Parameters:
  `newBackground` - The `java.awt.Color` or `java.awt.Image` object. If `newBackground` is not either of these, the background is set to plain white.

#### setCurrentLineHighlightColor

    public void setCurrentLineHighlightColor(Color color)

Sets the color to use to highlight the current line. Note that if highlighting the current line is turned off, you will not be able to see this highlight. This method fires a property change of type `CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY`.

Parameters:
  `color` - The color to use to highlight the current line.
Throws:
  `NullPointerException` - if `color` is `null`.
See Also:
  `getHighlightCurrentLine()`, `setHighlightCurrentLine(boolean)`, `getCurrentLineHighlightColor()`

#### setFadeCurrentLineHighlight

    public void setFadeCurrentLineHighlight(boolean fade)

Sets whether the current line highlight should have a "fade" effect. This method fires a property change event of type `CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY`.

Parameters:
  `fade` - Whether the fade effect should be enabled.
See Also:
  `getFadeCurrentLineHighlight()`

#### setHighlightCurrentLine

    public void setHighlightCurrentLine(boolean highlight)

Sets whether or not the current line is highlighted. This method fires a property change of type `HIGHLIGHT_CURRENT_LINE_PROPERTY`.

Parameters:
  `highlight` - Whether or not to highlight the current line.
See Also:
  `getHighlightCurrentLine()`, `getCurrentLineHighlightColor()`, `setCurrentLineHighlightColor(java.awt.Color)`

#### setLineWrap

    public void setLineWrap(boolean wrap)

Sets whether or not word wrap is enabled. This is overridden so that the "current line highlight" gets updated if it needs to be.

Overrides:
  `setLineWrap` in class `JTextArea`
Parameters:
  `wrap` - Whether or not word wrap should be enabled.

#### setMarginLineColor

    public void setMarginLineColor(Color color)

Sets the color used to paint the margin line.

Parameters:
  `color` - The new margin line color.
See Also:
  `getDefaultMarginLineColor()`, `getMarginLineColor()`

#### setMarginLineEnabled

    public void setMarginLineEnabled(boolean enabled)

Enables or disables the margin line.

Parameters:
  `enabled` - Whether or not the margin line should be enabled.
See Also:
  `isMarginLineEnabled()`

#### setMarginLinePosition

    public void setMarginLinePosition(int size)

Sets the number of 'm' widths the margin line is over.

Parameters:
  `size` - The margin size. #see #getDefaultMarginLinePosition
See Also:
  `getMarginLinePosition()`

#### setRTextAreaUI

    protected void setRTextAreaUI(RTextAreaUI ui)

Sets the UI for this `RTextArea`. Note that, for instances of `RTextArea`, `setUI` only updates the popup menu; this is because `RTextArea`s' look and feels are independent of the Java Look and Feel. This method is here so subclasses can set a UI (subclass of `RTextAreaUI`) if they have to.

Parameters:
  `ui` - The new UI.
See Also:
  `JTextComponent.setUI(javax.swing.plaf.TextUI)`

#### setTabsEmulated

    public void setTabsEmulated(boolean areEmulated)

Changes whether or not tabs should be emulated with spaces (i.e., soft tabs). Note that this affects all tabs inserted AFTER this call, not tabs already in the document. For that, see `convertTabsToSpaces()` and `convertSpacesToTabs()`.

Parameters:
  `areEmulated` - Whether or not tabs should be emulated with spaces.
See Also:
  `convertSpacesToTabs()`, `convertTabsToSpaces()`, `getTabsEmulated()`

#### setTabSize

    public void setTabSize(int size)

Workaround, since in JDK1.4 it appears that `setTabSize()` doesn't work for a `JTextArea` unless you use the constructor specifying the number of rows and columns...

Sets the number of characters to expand tabs to. This will be multiplied by the maximum advance for variable width fonts. A PropertyChange event ("tabSize") is fired when the tab size changes.

Overrides:
  `setTabSize` in class `JTextArea`
Parameters:
  `size` - Number of characters to expand to.

#### updateMarginLineX

    protected void updateMarginLineX()

This is here so subclasses such as `RSyntaxTextArea` that have multiple fonts can define exactly what it means, for example, for the margin line to be "80 characters" over.

#### yForLine

    public int yForLine(int line)
                 throws BadLocationException

Returns the y-coordinate of the specified line.

Parameters:
  `line` - The line number.
Returns:
  The y-coordinate of the top of the line, or `-1` if this text area doesn't yet have a positive size or the line is hidden (i.e. from folding).
Throws:
  `BadLocationException` - If `line` isn't a valid line number for this document.

#### yForLineContaining

    public int yForLineContaining(int offs)
                           throws BadLocationException

Returns the y-coordinate of the line containing an offset.

Parameters:
  `offs` - The offset info the document.
Returns:
  The y-coordinate of the top of the offset, or `-1` if this text area doesn't yet have a positive size or the line is hidden (i.e. from folding).
Throws:
  `BadLocationException` - If `offs` isn't a valid offset into the document.