Package: groovy.console.ui.text

## [Java] Class TextEditor

- groovy.console.ui.text.TextEditor

- All Implemented Interfaces and Traits:
    Pageable, Printable

      public class TextEditor
      extends JTextPane
      implements Pageable, Printable

  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`

  - ### 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
    --- | --- | ---
    `` | `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
    `` | `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 void` | `mouseEntered(MouseEvent me)`
    `` | `public void` | `mouseExited(MouseEvent me)`
    `` | `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
    `` | `public void` | `setUnwrapped(boolean unwrapped)` Parameters: `unwrapped` - the new unwrapped value

  - ### Inherited Methods Summary

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

    - #### @Override public void addNotify()

    - #### @Override public int getNumberOfPages()

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

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

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

    - #### @Override public void mouseEntered(MouseEvent me)

    - #### @Override public void mouseExited(MouseEvent me)

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

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

    - #### @Override public void removeNotify()

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

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