Package: groovy.ui.text

## [Java] Class TextEditor

- groovy.ui.text.TextEditor

- All Implemented Interfaces and Traits:
    Pageable, Printable

      public class TextEditor
      extends JTextPane

  A simple text pane that is printable and wrapping is optional.

  Authors:
    Evan "Hippy" Slatis

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `AUTO_INDENT` |
    `static String` | `FIND` |
    `static String` | `FIND_NEXT` |
    `static String` | `FIND_PREVIOUS` |
    `static String` | `REPLACE` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class JTextPane` | `W3C_LENGTH_UNITS, HONOR_DISPLAY_PROPERTIES, FOCUS_ACCELERATOR_KEY, DEFAULT_KEYMAP, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT`
    `class JEditorPane` | `W3C_LENGTH_UNITS, HONOR_DISPLAY_PROPERTIES, FOCUS_ACCELERATOR_KEY, DEFAULT_KEYMAP, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `TextEditor ()` Creates a new instance of TextEditor
    `TextEditor (boolean tabsAsSpaces)` Creates a new instance of TextEditor
    `TextEditor (boolean tabsAsSpaces, boolean multiLineTab)` Creates a new instance of TextEditor
    `TextEditor (boolean tabsAsSpaces, boolean multiLineTab, boolean unwrapped)` Creates a new instance of TextEditor

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `addNotify()`
    `int` | `getNumberOfPages()`
    `PageFormat` | `getPageFormat(int pageIndex)`
    `Printable` | `getPrintable(int param)`
    `boolean` | `getScrollableTracksViewportWidth()`
    `boolean` | `isMultiLineTabbed()` Whether using the tab key indents the selected lines of code
    `void` | `isMultiLineTabbed(boolean multiLineTab)` @param multiLineTab the new multiLine tab value
    `static boolean` | `isOvertypeMode()` @return true if overtype mode is active, false for insert mode
    `boolean` | `isTabsAsSpaces()` @return true if tabs are converted to spaces upon typing
    `void` | `isTabsAsSpaces(boolean tabsAsSpaces)` @param tabsAsSpaces whether tabs are converted to spaces
    `boolean` | `isUnwrapped()` @return true if text wrapping is disabled
    `int` | `print(Graphics graphics, PageFormat pageFormat, int page)`
    `protected void` | `processKeyEvent(KeyEvent e)`
    `void` | `removeNotify()`
    `void` | `replaceSelection(String text)`
    `void` | `setBounds(int x, int y, int width, int height)`
    `void` | `setOvertypeMode(boolean isOvertypeMode)` Set the caret to use depending on overtype/insert mode
    `void` | `setUnwrapped(boolean unwrapped)` @param unwrapped the new unwrapped value

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class JTextPane` | `getUIClassID, addStyle, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyledDocument, insertComponent, insertIcon, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument, getStyle, getText, getEditorKit, getEditorKitClassNameForContentType, setEditorKitForContentType, addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getEditorKitForContentType, getHyperlinkListeners, getPage, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setPage, setPage, setText, getContentType, setContentType, getAccessibleContext, getPreferredSize, read, getText, selectAll, getToolTipText, getInputMethodRequests, setComponentOrientation, getUI, isEditable, setEditable, setUI, updateUI, getCaret, getCaretPosition, getSelectionEnd, getSelectionStart, setCaretPosition, addCaretListener, addKeymap, cut, getCaretListeners, getDisabledTextColor, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getKeymap, getKeymap, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedTextColor, getSelectionColor, loadKeymap, moveCaretPosition, paste, removeCaretListener, removeKeymap, setCaret, setCaretColor, setDisabledTextColor, setDragEnabled, setDropMode, setFocusAccelerator, setHighlighter, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, getDocument, getMargin, setMargin, getCaretColor, getHighlighter, getNavigationFilter, getSelectedText, modelToView, viewToModel, removeNotify, addInputMethodListener, select, write, getActions, print, print, print, copy, read, addVetoableChangeListener, computeVisibleRect, createToolTip, getActionForKeyStroke, getActionMap, getAncestorListeners, getAutoscrolls, getBorder, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, grabFocus, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, getBaseline, getBaselineResizeBehavior, getFontMetrics, getGraphics, hide, isDoubleBuffered, printAll, repaint, repaint, requestFocusInWindow, reshape, revalidate, setBackground, setEnabled, setForeground, setMaximumSize, setMinimumSize, setPreferredSize, addAncestorListener, getBounds, firePropertyChange, firePropertyChange, firePropertyChange, getListeners, addNotify, getAlignmentX, getAlignmentY, getHeight, getInsets, getInsets, getMaximumSize, getMinimumSize, getWidth, getX, getY, isValidateRoot, paint, requestFocus, requestFocus, setFocusTraversalKeys, setFont, setVisible, contains, getLocation, print, getSize, isOpaque, disable, enable, update, getComponents, invalidate, validate, addPropertyChangeListener, addPropertyChangeListener, getLayout, setLayout, layout, doLayout, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, locate, minimumSize, paintComponents, preferredSize, printComponents, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, add, add, add, add, add, remove, remove, list, list, removeAll, createImage, createImage, createVolatileImage, createVolatileImage, enableInputMethods, getBackground, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getToolkit, gotFocus, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isFocusTraversable, isFontSet, isForegroundSet, keyDown, keyUp, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, nextFocus, paintAll, prepareImage, prepareImage, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, setCursor, setDropTarget, setFocusTraversalKeysEnabled, setFocusable, setIgnoreRepaint, setLocation, setLocation, show, show, transferFocusUpCycle, bounds, getBounds, action, move, getLocale, setLocale, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, isEnabled, dispatchEvent, getFocusCycleRootAncestor, getFont, getGraphicsConfiguration, getMousePosition, getPeer, getTreeLock, handleEvent, isDisplayable, isFocusOwner, isFocusable, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isVisible, postEvent, setBounds, setBounds, transferFocus, transferFocusBackward, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, add, remove, toString, getName, contains, size, getLocation, getParent, setName, list, list, list, getSize, setSize, setSize, resize, resize, location, enable, isValid, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`
    `class JEditorPane` | `getText, getUIClassID, getEditorKit, getEditorKitClassNameForContentType, replaceSelection, setEditorKit, setEditorKitForContentType, addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getEditorKitForContentType, getHyperlinkListeners, getPage, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setPage, setPage, setText, getContentType, setContentType, getAccessibleContext, getPreferredSize, read, getText, selectAll, getToolTipText, getInputMethodRequests, setComponentOrientation, getUI, isEditable, setEditable, setUI, updateUI, getCaret, getCaretPosition, getSelectionEnd, getSelectionStart, setDocument, setCaretPosition, addCaretListener, addKeymap, cut, getCaretListeners, getDisabledTextColor, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getKeymap, getKeymap, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedTextColor, getSelectionColor, loadKeymap, moveCaretPosition, paste, removeCaretListener, removeKeymap, setCaret, setCaretColor, setDisabledTextColor, setDragEnabled, setDropMode, setFocusAccelerator, setHighlighter, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, getDocument, getMargin, setMargin, getCaretColor, getHighlighter, getNavigationFilter, getSelectedText, modelToView, viewToModel, removeNotify, addInputMethodListener, select, write, getActions, print, print, print, copy, read, addVetoableChangeListener, computeVisibleRect, createToolTip, getActionForKeyStroke, getActionMap, getAncestorListeners, getAutoscrolls, getBorder, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, grabFocus, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, getBaseline, getBaselineResizeBehavior, getFontMetrics, getGraphics, hide, isDoubleBuffered, printAll, repaint, repaint, requestFocusInWindow, reshape, revalidate, setBackground, setEnabled, setForeground, setMaximumSize, setMinimumSize, setPreferredSize, addAncestorListener, getBounds, firePropertyChange, firePropertyChange, firePropertyChange, getListeners, addNotify, getAlignmentX, getAlignmentY, getHeight, getInsets, getInsets, getMaximumSize, getMinimumSize, getWidth, getX, getY, isValidateRoot, paint, requestFocus, requestFocus, setFocusTraversalKeys, setFont, setVisible, contains, getLocation, print, getSize, isOpaque, disable, enable, update, getComponents, invalidate, validate, addPropertyChangeListener, addPropertyChangeListener, getLayout, setLayout, layout, doLayout, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, locate, minimumSize, paintComponents, preferredSize, printComponents, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, add, add, add, add, add, remove, remove, list, list, removeAll, createImage, createImage, createVolatileImage, createVolatileImage, enableInputMethods, getBackground, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getToolkit, gotFocus, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isFocusTraversable, isFontSet, isForegroundSet, keyDown, keyUp, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, nextFocus, paintAll, prepareImage, prepareImage, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, setCursor, setDropTarget, setFocusTraversalKeysEnabled, setFocusable, setIgnoreRepaint, setLocation, setLocation, show, show, transferFocusUpCycle, bounds, getBounds, action, move, getLocale, setLocale, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, isEnabled, dispatchEvent, getFocusCycleRootAncestor, getFont, getGraphicsConfiguration, getMousePosition, getPeer, getTreeLock, handleEvent, isDisplayable, isFocusOwner, isFocusable, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isVisible, postEvent, setBounds, setBounds, transferFocus, transferFocusBackward, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, add, remove, toString, getName, contains, size, getLocation, getParent, setName, list, list, list, getSize, setSize, setSize, resize, resize, location, enable, isValid, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`

- - ### Field Detail

    - #### public static final String AUTO_INDENT

    - #### public static final String FIND

    - #### public static final String FIND_NEXT

    - #### public static final String FIND_PREVIOUS

    - #### public static final String REPLACE

  - ### Constructor Detail

    - #### public TextEditor()

      Creates a new instance of TextEditor

    - #### public TextEditor(boolean tabsAsSpaces)

      Creates a new instance of TextEditor

    - #### public TextEditor(boolean tabsAsSpaces, boolean multiLineTab)

      Creates a new instance of TextEditor

    - #### public TextEditor(boolean tabsAsSpaces, boolean multiLineTab, boolean unwrapped)

      Creates a new instance of TextEditor

  - ### Method Detail

    - #### public void addNotify()

    - #### public int getNumberOfPages()

    - #### public PageFormat getPageFormat(int pageIndex)

    - #### public Printable getPrintable(int param)

    - #### public boolean getScrollableTracksViewportWidth()

    - #### public boolean isMultiLineTabbed()

      Whether using the tab key indents the selected lines of code

      Returns:
        true if multiline tabbing is active

    - #### public void isMultiLineTabbed(boolean multiLineTab)

      Parameters:
        `multiLineTab` - the new multiLine tab value

    - #### public static boolean isOvertypeMode()

      Returns:
        true if overtype mode is active, false for insert mode

    - #### public boolean isTabsAsSpaces()

      Returns:
        true if tabs are converted to spaces upon typing

    - #### public void isTabsAsSpaces(boolean tabsAsSpaces)

      Parameters:
        `tabsAsSpaces` - whether tabs are converted to spaces

    - #### public boolean isUnwrapped()

      Returns:
        true if text wrapping is disabled

    - #### public int print(Graphics graphics, PageFormat pageFormat, int page)

    - #### protected void processKeyEvent(KeyEvent e)

    - #### public void removeNotify()

    - #### public void replaceSelection(String text)

    - #### public void setBounds(int x, int y, int width, int height)

    - #### public void setOvertypeMode(boolean isOvertypeMode)

      Set the caret to use depending on overtype/insert mode

      Parameters:
        `isOvertypeMode` - the new mode; true = overtype

    - #### public void setUnwrapped(boolean unwrapped)

      Parameters:
        `unwrapped` - the new unwrapped value