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` | Action name for automatic indentation.
    `static String` | `DELETE` | Action name for backspace deletion.
    `static String` | `FIND` | Action name for opening the find dialog.
    `static String` | `FIND_NEXT` | Action name for repeating the next find.
    `static String` | `FIND_PREVIOUS` | Action name for repeating the previous find.
    `static String` | `REPLACE` | Action name for opening the replace dialog.

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

- - ### Field Detail

    - #### public static final String AUTO_INDENT

      Action name for automatic indentation.

    - #### public static final String DELETE

      Action name for backspace deletion.

    - #### public static final String FIND

      Action name for opening the find dialog.

    - #### public static final String FIND_NEXT

      Action name for repeating the next find.

    - #### public static final String FIND_PREVIOUS

      Action name for repeating the previous find.

    - #### public static final String REPLACE

      Action name for opening the replace dialog.

  - ### Constructor Detail

    - #### public TextEditor()

      Creates a new instance of TextEditor

    - #### public TextEditor(boolean tabsAsSpaces)

      Creates a new instance of TextEditor

      Parameters:
        `tabsAsSpaces` - whether typed tabs should be converted to spaces

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

      Creates a new instance of TextEditor

      Parameters:
        `tabsAsSpaces` - whether typed tabs should be converted to spaces
        `multiLineTab` - whether tab actions should affect all selected lines

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

      Creates a new instance of TextEditor

      Parameters:
        `tabsAsSpaces` - whether typed tabs should be converted to spaces
        `multiLineTab` - whether tab actions should affect all selected lines
        `unwrapped` - whether long lines should avoid viewport wrapping

  - ### Method Detail

    - #### public void addNotify()

      {@inheritDoc}

    - #### public int getNumberOfPages()

      {@inheritDoc}

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

      {@inheritDoc}

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

      {@inheritDoc}

    - #### public boolean getScrollableTracksViewportWidth()

      {@inheritDoc}

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

      Enables or disables indenting all selected lines when tabbing.

      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)

      Enables or disables replacing typed tab characters with spaces.

      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)

      {@inheritDoc}

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

      {@inheritDoc}

    - #### public void removeNotify()

      {@inheritDoc}

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

      {@inheritDoc}

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

      {@inheritDoc}

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