Groovy 2.2.0

groovy.ui.text
[Java] Class TextEditor

java.lang.Object
  java.awt.Component
      java.awt.Container
          javax.swing.JComponent
              javax.swing.text.JTextComponent
                  javax.swing.JEditorPane
                      javax.swing.JTextPane
                          groovy.ui.text.TextEditor
All Implemented Interfaces:
Pageable, Printable

public class TextEditor
extends JTextPane

A simple text pane that is printable and wrapping is optional.

Authors:
Evan "Hippy" Slatis


Field Summary
static String AUTO_INDENT

static String FIND

static String FIND_NEXT

static String FIND_PREVIOUS

static String REPLACE

 
Fields inherited from 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
 
Fields inherited from 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
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

 
Method Summary
void addNotify()

int getNumberOfPages()

PageFormat getPageFormat(int pageIndex)

Printable getPrintable(int param)

boolean getScrollableTracksViewportWidth()

boolean isMultiLineTabbed()

@return true if overtype mode is active, false for insert mode

void isMultiLineTabbed(boolean multiLineTab)

@param tabsAsSpaces whether tabs are converted to spaces

static boolean isOvertypeMode()

boolean isTabsAsSpaces()

void isTabsAsSpaces(boolean tabsAsSpaces)

boolean isUnwrapped()

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)

@param multiLineTab the new multiLine tab value

void setOvertypeMode(boolean isOvertypeMode)

void setUnwrapped(boolean unwrapped)

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

Field Detail

AUTO_INDENT

public static final String AUTO_INDENT


FIND

public static final String FIND


FIND_NEXT

public static final String FIND_NEXT


FIND_PREVIOUS

public static final String FIND_PREVIOUS


REPLACE

public static final String REPLACE


 
Constructor Detail

TextEditor

public TextEditor()
Creates a new instance of TextEditor


TextEditor

public TextEditor(boolean tabsAsSpaces)
Creates a new instance of TextEditor


TextEditor

public TextEditor(boolean tabsAsSpaces, boolean multiLineTab)
Creates a new instance of TextEditor


TextEditor

public TextEditor(boolean tabsAsSpaces, boolean multiLineTab, boolean unwrapped)
Creates a new instance of TextEditor


 
Method Detail

addNotify

public void addNotify()


getNumberOfPages

public int getNumberOfPages()


getPageFormat

public PageFormat getPageFormat(int pageIndex)


getPrintable

public Printable getPrintable(int param)


getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()


isMultiLineTabbed

public boolean isMultiLineTabbed()
Returns:
true if overtype mode is active, false for insert mode


isMultiLineTabbed

public void isMultiLineTabbed(boolean multiLineTab)
Parameters:
tabsAsSpaces - whether tabs are converted to spaces


isOvertypeMode

public static boolean isOvertypeMode()


isTabsAsSpaces

public boolean isTabsAsSpaces()


isTabsAsSpaces

public void isTabsAsSpaces(boolean tabsAsSpaces)


isUnwrapped

public boolean isUnwrapped()


print

public int print(Graphics graphics, PageFormat pageFormat, int page)


processKeyEvent

protected void processKeyEvent(KeyEvent e)


removeNotify

public void removeNotify()


replaceSelection

public void replaceSelection(String text)


setBounds

public void setBounds(int x, int y, int width, int height)
Parameters:
multiLineTab - the new multiLine tab value


setOvertypeMode

public void setOvertypeMode(boolean isOvertypeMode)


setUnwrapped

public void setUnwrapped(boolean unwrapped)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.