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.

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

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `boolean` | `overtypeMode`
    `boolean` | `unwrapped`

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

  - ### Property Detail

    - #### boolean overtypeMode

    - #### boolean unwrapped

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