org.fife.rtext
Class RTextEditorPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.text.JTextComponent
                  extended byjavax.swing.JTextArea
                      extended byorg.fife.ui.rtextarea.RTextAreaBase
                          extended byorg.fife.ui.rtextarea.RTextArea
                              extended byorg.fife.ui.rsyntaxtextarea.RSyntaxTextArea
                                  extended byorg.fife.ui.rsyntaxtextarea.TextEditorPane
                                      extended byorg.fife.rtext.RTextEditorPane
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.DocumentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, javax.swing.Scrollable, java.io.Serializable, SyntaxConstants

public class RTextEditorPane
extends TextEditorPane
implements java.awt.print.Printable

An extension of TextEditorPane that adds RText-specific features.

Version:
1.2
Author:
Robert Futrell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.fife.ui.rtextarea.RTextArea
RTextArea.RTextAreaMutableCaretEvent
 
Nested classes inherited from class javax.swing.JTextArea
javax.swing.JTextArea.AccessibleJTextArea
 
Nested classes inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class org.fife.ui.rsyntaxtextarea.TextEditorPane
DIRTY_PROPERTY, FULL_PATH_PROPERTY, LAST_MODIFIED_UNKNOWN, READ_ONLY_PROPERTY
 
Fields inherited from class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
ANIMATE_BRACKET_MATCHING_PROPERTY, ANTIALIAS_PROPERTY, AUTO_INDENT_PROPERTY, BRACKET_MATCHING_PROPERTY, CLEAR_WHITESPACE_LINES_PROPERTY, CLOSE_CURLY_BRACES_PROPERTY, CLOSE_MARKUP_TAGS_PROPERTY, CODE_FOLDING_PROPERTY, EOL_VISIBLE_PROPERTY, FOCUSABLE_TIPS_PROPERTY, FRACTIONAL_FONTMETRICS_PROPERTY, HYPERLINKS_ENABLED_PROPERTY, MARK_OCCURRENCES_PROPERTY, MARKED_OCCURRENCES_CHANGED_PROPERTY, PARSER_NOTICES_PROPERTY, SYNTAX_SCHEME_PROPERTY, SYNTAX_STYLE_PROPERTY, TAB_LINE_COLOR_PROPERTY, TAB_LINES_PROPERTY, VISIBLE_WHITESPACE_PROPERTY
 
Fields inherited from class org.fife.ui.rtextarea.RTextArea
BACKGROUND_IMAGE_PROPERTY, COPY_ACTION, CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY, CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY, CUT_ACTION, DELETE_ACTION, HIGHLIGHT_CURRENT_LINE_PROPERTY, INSERT_MODE, MARK_ALL_COLOR_PROPERTY, OVERWRITE_MODE, PASTE_ACTION, REDO_ACTION, ROUNDED_SELECTION_PROPERTY, SELECT_ALL_ACTION, UNDO_ACTION
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface org.fife.ui.rsyntaxtextarea.SyntaxConstants
SYNTAX_STYLE_ACTIONSCRIPT, SYNTAX_STYLE_ASSEMBLER_X86, SYNTAX_STYLE_BBCODE, SYNTAX_STYLE_C, SYNTAX_STYLE_CLOJURE, SYNTAX_STYLE_CPLUSPLUS, SYNTAX_STYLE_CSHARP, SYNTAX_STYLE_CSS, SYNTAX_STYLE_DELPHI, SYNTAX_STYLE_DTD, SYNTAX_STYLE_FORTRAN, SYNTAX_STYLE_GROOVY, SYNTAX_STYLE_HTML, SYNTAX_STYLE_JAVA, SYNTAX_STYLE_JAVASCRIPT, SYNTAX_STYLE_JSP, SYNTAX_STYLE_LATEX, SYNTAX_STYLE_LISP, SYNTAX_STYLE_LUA, SYNTAX_STYLE_MAKEFILE, SYNTAX_STYLE_MXML, SYNTAX_STYLE_NONE, SYNTAX_STYLE_PERL, SYNTAX_STYLE_PHP, SYNTAX_STYLE_PROPERTIES_FILE, SYNTAX_STYLE_PYTHON, SYNTAX_STYLE_RUBY, SYNTAX_STYLE_SAS, SYNTAX_STYLE_SCALA, SYNTAX_STYLE_SQL, SYNTAX_STYLE_TCL, SYNTAX_STYLE_UNIX_SHELL, SYNTAX_STYLE_WINDOWS_BATCH, SYNTAX_STYLE_XML
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RTextEditorPane(RText rtext, boolean wordWrapEnabled, int textMode, FileLocation loc, java.lang.String encoding)
          Creates a new RTextEditorPane.
 
Method Summary
 int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
          Method called when it's time to print this badboy (the old-school, AWT way).
 
Methods inherited from class org.fife.ui.rsyntaxtextarea.TextEditorPane
changedUpdate, getEncoding, getFileFullPath, getFileName, getLastSaveOrLoadTime, getLineSeparator, insertUpdate, isDirty, isLocal, isLocalAndExists, isModifiedOutsideEditor, isReadOnly, load, reload, removeUpdate, save, saveAs, setDocument, setEncoding, setLineSeparator, setLineSeparator, setReadOnly, syncLastSaveOrLoadTimeToActualFile
 
Methods inherited from class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
addActiveLineRangeListener, addHyperlinkListener, addNotify, addParser, clearParsers, configurePopupMenu, copyAsRtf, createDefaultModel, createMouseListener, createPopupMenu, createRTextAreaUI, doBracketMatching, fireCaretUpdate, foldToggled, forceReparsing, forceReparsing, getAnimateBracketMatching, getAntiAliasingEnabled, getBackgroundForTokenType, getCloseCurlyBraces, getCloseMarkupTags, getCodeTemplateManager, getDefaultBracketMatchBGColor, getDefaultBracketMatchBorderColor, getDefaultSelectionColor, getDefaultSyntaxScheme, getEOLMarkersVisible, getFoldManager, getFontForTokenType, getFontMetricsForTokenType, getForegroundForToken, getForegroundForTokenType, getFractionalFontMetricsEnabled, getHyperlinkForeground, getHyperlinksEnabled, getLastVisibleOffset, getLineHeight, getMarkedOccurrences, getMarkOccurrences, getMarkOccurrencesColor, getMatchedBracketBGColor, getMatchedBracketBorderColor, getMatchRectangle, getMaxAscent, getPaintMarkOccurrencesBorder, getPaintTabLines, getParser, getParserCount, getParserNotices, getShouldIndentNextLine, getSyntaxEditingStyle, getSyntaxScheme, getTabLineColor, getTemplatesEnabled, getTokenListForLine, getToolTipText, getUnderlineForToken, getUseFocusableTips, init, isAutoIndentEnabled, isBracketMatchingEnabled, isClearWhitespaceLinesEnabled, isCodeFoldingEnabled, isWhitespaceVisible, paintComponent, removeActiveLineRangeListener, removeHyperlinkListener, removeNotify, removeParser, restoreDefaultSyntaxScheme, saveTemplates, setActiveLineRange, setAnimateBracketMatching, setAntiAliasingEnabled, setAutoIndentEnabled, setBracketMatchingEnabled, setClearWhitespaceLinesEnabled, setCloseCurlyBraces, setCloseMarkupTags, setCodeFoldingEnabled, setEOLMarkersVisible, setFont, setFractionalFontMetricsEnabled, setHighlighter, setHyperlinkForeground, setHyperlinksEnabled, setLinkScanningMask, setMarkOccurrences, setMarkOccurrencesColor, setMatchedBracketBGColor, setMatchedBracketBorderColor, setPaintMarkOccurrencesBorder, setPaintTabLines, setSyntaxEditingStyle, setSyntaxScheme, setTabLineColor, setTemplateDirectory, setTemplatesEnabled, setUseFocusableTips, setWhitespaceVisible
 
Methods inherited from class org.fife.ui.rtextarea.RTextArea
addCurrentLineHighlightListeners, addLineHighlight, beginAtomicEdit, beginRecordingMacro, canRedo, canUndo, clearMarkAllHighlights, convertSpacesToTabs, convertTabsToSpaces, createPopupMenuItem, createUndoManager, discardAllEdits, endAtomicEdit, endRecordingMacro, forceCurrentLineHighlightRepaint, getAction, getBackground, getBackgroundImage, getBackgroundObject, getCaretLineNumber, getCaretOffsetFromLineStart, getCurrentLineHighlightColor, getCurrentMacro, getDefaultCaretColor, getDefaultCurrentLineHighlightColor, getDefaultFont, getDefaultForeground, getDefaultMarginLineColor, getDefaultMarginLinePosition, getDefaultMarkAllHighlightColor, getDefaultTabSize, getFadeCurrentLineHighlight, getHighlightCurrentLine, getIconGroup, getLineEndOffsetOfCurrentLine, getLineStartOffsetOfCurrentLine, getMarginLineColor, getMarginLinePixelLocation, getMarginLinePosition, getMarkAllHighlightColor, getPopupMenu, getRoundedSelectionEdges, getSelectedOccurrenceText, getTabsEmulated, getTextMode, getToolTipSupplier, handleReplaceSelection, isMarginLineEnabled, isOSX, isRecordingMacro, loadMacro, markAll, paste, playbackLastMacro, possiblyUpdateCurrentLineHighlightLocation, processComponentEvent, read, redoLastAction, removeAllLineHighlights, removeLineHighlight, replaceRange, replaceSelection, setActionProperties, setActionProperties, setBackground, setBackgroundImage, setBackgroundObject, setCaret, setCaretStyle, setCurrentLineHighlightColor, setFadeCurrentLineHighlight, setHighlightCurrentLine, setIconGroup, setLineWrap, setMarginLineColor, setMarginLineEnabled, setMarginLinePosition, setMarkAllHighlightColor, setPopupMenu, setRoundedSelectionEdges, setRTextAreaUI, setSelectedOccurrenceText, setTabsEmulated, setTabSize, setTextMode, setToolTipSupplier, setUI, undoLastAction, updateMarginLineX, yForLine, yForLineContaining
 
Methods inherited from class javax.swing.JTextArea
append, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, setColumns, setRows, setWrapStyleWord
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, processInputMethodEvent, removeCaretListener, removeKeymap, select, selectAll, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RTextEditorPane

public RTextEditorPane(RText rtext,
                       boolean wordWrapEnabled,
                       int textMode,
                       FileLocation loc,
                       java.lang.String encoding)
                throws java.io.IOException
Creates a new RTextEditorPane. Syntax highlighting will be selected as follows: filenames ending in ".java" default to Java syntax highlighting; all others default to no syntax highlighting.

Parameters:
rtext - The owning RText instance.
wordWrapEnabled - Whether or not to use word wrap in this pane.
textMode - Either INSERT_MODE or OVERWRITE_MODE.
loc - The location of the file to open.
encoding - The encoding of the file.
Throws:
java.io.IOException - If an IO error occurs reading the file to load.
Method Detail

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
Method called when it's time to print this badboy (the old-school, AWT way). This method overrides RTextArea's print method so that we can use the font specified in RText when printing.

Specified by:
print in interface java.awt.print.Printable
Parameters:
g - The context into which the page is drawn.
pageFormat - The size and orientation of the page being drawn.
pageIndex - The zero based index of the page to be drawn.