TextEditor (Groovy 5.0.7)

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

    - #### public static final String DELETE

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