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 Params | Return 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`

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

    `class JEditorPane`

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

- - ### 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