org.fife.rtext
Class AbstractMainView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.fife.rtext.AbstractMainView
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.HyperlinkListener, org.fife.rsta.ui.search.SearchListener, FindInFilesListener

public abstract class AbstractMainView
extends javax.swing.JPanel
implements java.beans.PropertyChangeListener, java.awt.event.ActionListener, org.fife.rsta.ui.search.SearchListener, FindInFilesListener, javax.swing.event.HyperlinkListener

Abstract class representing a collection of RTextEditorPanes. This class contains all logic that would be common to different implementations (i.e., everything except the "view" parts).

An implementation of this class must fire a property change event of type CURRENT_DOCUMENT_PROPERTY whenever the currently-active document changes so that other pieces of RText can function properly.

RText plugins may wish to register to be CurrentTextAreaListeners if they want to be notified whenever a property of the currently-active text area (or the text area itself) changes.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String AUTO_INSERT_CLOSING_CURLYS
           
static java.lang.String CURRENT_DOCUMENT_PROPERTY
           
static java.lang.String DEFAULT_ENCODING_PROPERTY
           
static int DOCUMENT_SELECT_BOTTOM
           
static int DOCUMENT_SELECT_LEFT
           
static int DOCUMENT_SELECT_RIGHT
           
static int DOCUMENT_SELECT_TOP
           
static java.lang.String FILE_SIZE_CHECK_PROPERTY
           
 FindInFilesDialog findInFilesDialog
           
static java.lang.String FRACTIONAL_METRICS_PROPERTY
           
 org.fife.rsta.ui.GoToDialog goToDialog
           
static java.lang.String MARK_ALL_COLOR_PROPERTY
           
static java.lang.String MARK_OCCURRENCES_COLOR_PROPERTY
           
static java.lang.String MARK_OCCURRENCES_PROPERTY
           
static java.lang.String MAX_FILE_SIZE_PROPERTY
           
protected  RText owner
           
static java.lang.String REMEMBER_WS_LINES_PROPERTY
           
 ReplaceInFilesDialog replaceInFilesDialog
           
static java.lang.String ROUNDED_SELECTION_PROPERTY
           
 FindInFilesSearchContext searchContext
           
static java.lang.String SMOOTH_TEXT_PROPERTY
           
static java.lang.String TEXT_AREA_ADDED_PROPERTY
           
static java.lang.String TEXT_AREA_REMOVED_PROPERTY
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractMainView()
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addCurrentTextAreaListener(CurrentTextAreaListener l)
          Adds a current text area listener.
 void addNewEmptyUntitledFile()
          Adds an empty text file with a default name to this panel.
protected abstract  void addTextAreaImpl(java.lang.String title, java.awt.Component component, java.lang.String fileFullPath)
          Adds a text area visually to this panel.
 void applyComponentOrientation(java.awt.ComponentOrientation o)
          Overridden so we ensure text areas keep their special LTR or RTL orientaitons.
 boolean areTabsEmulated()
          Returns whether or not tabs are emulated with spaces.
 void checkFilesForOutsideModification()
          Checks the "modified" timestamps for open files against the last known "modified" timestamps to see if any files have been modified outside of this RText instance.
 boolean closeAllDocuments()
          Attempts to close all currently active documents.
 boolean closeAllDocumentsExcept(int except)
          Attempts to close all currently active documents except the one specified.
 boolean closeCurrentDocument()
          Attempts to close the current document.
protected abstract  boolean closeCurrentDocumentImpl()
          Attempts to close the current document.
 void convertOpenFilesSpacesToTabs()
          Converts all instances of a number of spaces equal to a tab in all open documents into tabs.
 void convertOpenFilesTabsToSpaces()
          Converts all tabs in all open documents into an equivalent number of spaces.
 void copyData(AbstractMainView fromPanel)
           
protected  ErrorStrip createErrorStrip(RTextEditorPane textArea)
           
 void dispose()
          Disposes of this view.
 void findInFilesFileSelected(FindInFilesEvent e)
          Called when the user selects a file in a listened-to find-in-files dialog.
protected  void fireCurrentTextAreaEvent(int type, java.lang.Object oldValue, java.lang.Object newValue)
          Notifies all registered CurrentTextAreaListeners of a change in the current text area.
 boolean getAutoInsertClosingCurlys()
          Returns whether closing curly braces are auto-inserted in languages where it is appropriate.
 float getBackgroundImageAlpha()
          Returns the alpha value used to make the background image translucent.
 java.lang.String getBackgroundImageFileName()
          Returns the full path to the file containing the current background image.
 java.lang.Object getBackgroundObject()
          Returns the Object representing the background for all documents in this tabbed pane; either a java.awt.Color or a java.lang.String.
 boolean getBookmarksEnabled()
          Returns whether bookmarks are enabled.
 int getCaretBlinkRate()
          Returns the blink rate for all text areas.
 java.awt.Color getCaretColor()
          Returns the color being used for the carets of all text areas in this main view.
 int getCaretStyle(int mode)
          Returns the caret style for either the insert or overwrite caret.
 java.lang.String getCodeFoldingEnabledForString()
          Returns a comma-separated string of languages with code folding enabled.
 java.awt.Color getCurrentLineHighlightColor()
          Returns the color being used to highlight the current line.
 RTextEditorPane getCurrentTextArea()
          Returns the currently active text area.
 java.lang.String getDefaultEncoding()
          Returns the default encoding of new text files.
abstract  java.lang.String getDocumentDisplayNameAt(int index)
          Returns the name being displayed for the document.
abstract  int getDocumentSelectionPlacement()
          Returns the location of the document selection area of this component.
 boolean getDoFileSizeCheck()
          Returns whether a file's size should be checked before it is opened.
 int getFileIndex(java.lang.String fileFullPath)
          Returns the index of the specified document.
 boolean getGuessFileContentType()
          Returns whether files with no extension have their content type guessed at via whether they have a "#!
 java.awt.Color getGutterBorderColor()
          Returns the color to use for the gutter border color.
 boolean getHighlightSecondaryLanguages()
          Returns whether secondary languages are highlighted.
 java.awt.Color getHyperlinkColor()
          Returns the color editors use for hyperlinks.
 int getHyperlinkModifierKey()
          Returns the modifier key editors use to scan for hyperlinks.
 boolean getHyperlinksEnabled()
          Returns whether hyperlinks are enabled in text editors.
protected  javax.swing.Icon getIconFor(RTextScrollPane scrollPane)
          Returns the system icon associated with the file being edited in the given scroll pane (actually, in the text area inside of it).
 boolean getIgnoreBackupExtensions()
          Returns whether RText ignores extensions like ".bak", ".old", and ".orig" when deciding how to open them.
 java.awt.Color getLineNumberColor()
          Sets the color used for line numbers.
 java.awt.Font getLineNumberFont()
          Returns the font used for line numbers.
 boolean getLineNumbersEnabled()
          Returns whether or not line numbers are visible in the open documents.
 java.lang.String getLineTerminator()
          Returns the line terminator to use for new text files.
 boolean getLineWrap()
          Returns whether or not line (word) wrap is enabled for the open documents.
 java.awt.Color getMarginLineColor()
          Returns the margin line's color.
 int getMarginLinePosition()
          Returns the position of the margin line (even if it is not enabled).
 java.awt.Color getMarkAllHighlightColor()
          Returns the color selected by the user for "mark all."
 boolean getMarkOccurrences()
          Returns whether "mark occurrences" is enabled.
 java.awt.Color getMarkOccurrencesColor()
          Returns the color to use to "mark occurrences."
 boolean getMatchBothBrackets()
          Returns whether both brackets are highlighted when bracket matching.
 java.awt.Color getMatchedBracketBGColor()
          Returns the background color used in bracket matching.
 java.awt.Color getMatchedBracketBorderColor()
          Returns the border color used in bracket matching.
 float getMaxFileSize()
          If file-size checking is enabled, this is the maximum size a file can be before the user is prompted before opening it.
 java.awt.Color getModifiedDocumentDisplayNamesColor()
          Gets the color used to highlight modified documents' display names.
abstract  int getNumDocuments()
          Returns the number of documents open in this container.
 java.io.File[] getOpenFiles()
          Returns all of the files opened in this main view.
 java.awt.Font getPrintFont()
          Returns the java.awt.Font currently used to print documents.
 boolean getRememberWhitespaceLines()
          Returns whether whitespace lines are remembered (as opposed to cleared on Enter presses).
 boolean getRoundedSelectionEdges()
          Returns whether selection edges are rounded in text areas.
 RTextEditorPane getRTextEditorPaneAt(int index)
          Returns the org.fife.rtext.RTextEditorPane on the specified tab.
abstract  RTextScrollPane getRTextScrollPaneAt(int index)
          Returns the org.fife.rtext.RTextScrollPane at the given index.
 SearchManager getSearchManager()
          Returns the search manager for this view.
 java.awt.Color getSecondaryLanguageColor(int index)
          Returns the color to use for a secondary language.
abstract  java.awt.Component getSelectedComponent()
          Returns the currently active component.
abstract  int getSelectedIndex()
          Returns the currently selected document's index.
 java.awt.Color getSelectedTextColor()
          Returns the color being used for selected text in all text areas in this main view, if selected text is enabled.
 java.awt.Color getSelectionColor()
          Returns the color being used for selections in all text areas in this main view.
 boolean getShowEOLMarkers()
          Returns whether EOL markers are visible in the text areas.
 boolean getShowTabLines()
          Returns whether tab lines are visible in the text areas.
 SpellingSupport getSpellingSupport()
          Returns the spell checking support for RText.
 SyntaxFilters getSyntaxFilters()
          Returns the syntax filters being used to open documents (i.e., to decide what syntax highlighting color scheme, if any, to use when opening documents).
 java.lang.String getSyntaxStyleForFile(java.lang.String fileName)
          Returns the syntax style to use for a file.
 java.awt.Color getTabLinesColor()
          Returns the color to use for tab lines in an editor.
 int getTabSize()
          Returns the size of a tab, in spaces.
 java.awt.Font getTextAreaFont()
          Returns the default font to use in text areas.
 java.awt.Color getTextAreaForeground()
          Returns the default foreground color for text areas.
 java.awt.ComponentOrientation getTextAreaOrientation()
          Returns the orientation of the text editors.
 boolean getTextAreaUnderline()
          Returns whether text areas' default fonts should be underlined.
 int getTextMode()
          Returns the text mode we're in.
 boolean getUseSelectedTextColor()
          Returns whether text areas are honoring their "selected text color", as opposed to just rendering token styles even for selected tokens.
 boolean getWriteBOMInUtf8Files()
          Returns whether BOM's are written for UTF-8 files.
 boolean highlightModifiedDocumentDisplayNames()
          Returns whether this panel is highlighting modified documents' display names with a different color.
 void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
          Called when a hyperlink is entered, exited, or clicked in the current text area.
protected  void initialize(RText owner, java.lang.String[] filesToOpen, RTextPreferences prefs)
          Initializes this component.
 boolean isAntiAliasEnabled()
          Returns whether text is anti-aliased in text areas.
 boolean isBracketMatchingEnabled()
          Returns whether or not bracket matching is enabled.
 boolean isCodeFoldingEnabledFor(java.lang.String language)
          Returns whether code folding is enabled for a language.
 boolean isCurrentLineHighlightEnabled()
          Returns whether or not the current line is highlighted.
 boolean isFractionalFontMetricsEnabled()
          Returns whether fractional font-metrics is enabled.
 boolean isMarginLineEnabled()
          Returns whether or not the margin line is enabled
 boolean isWhitespaceVisible()
          Returns whether whitespace is visible in the text areas in this panel.
 void loadMacro(java.io.File file)
          Loads a macro.
 void moveToTopOfCurrentDocument()
          Scrolls to the top of the current document, and places the cursor there.
 boolean openFile(FileLocation loc, java.lang.String charSet, boolean reuse)
          Adds a file to this tabbed pane.
 boolean openFile(java.lang.String fileNameAndPath, java.lang.String charSet)
          Adds an already-created text file to this tabbed pane.
 boolean openFile(java.lang.String fileNameAndPath, java.lang.String charSet, boolean reuse)
          Adds an already-created text file to this tabbed pane.
protected  int promptToSaveBeforeClosingIfDirty()
          If the current editor is dirty, the user is prompted whether they want to save it.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Called whenever a property changes on a component we're listening to.
abstract  void refreshDisplayNames()
          Repaints the display names for open documents.
protected abstract  void removeComponentAt(int index)
          Removes a component from this container.
 void removeCurrentTextAreaListener(CurrentTextAreaListener l)
          Removes a current text area listener.
 void renumberDisplayNames()
          Looks for duplicate open documents (documents opened more than once) and adds numbers to the display names for these documents to differentiate them.
 boolean requestFocusInWindow()
          Overridden to forward the focus request to the current text area.
 boolean saveAllFiles()
          Attempts to save all currently-opened files.
 boolean saveCurrentFile()
          Attempts to save the currently active file as it's current name.
 boolean saveCurrentFileAs()
          Attempts to save the currently active file.
 boolean saveCurrentFileAs(FileLocation loc)
          Attempts to save the currently active file with a new name.
 void searchEvent(org.fife.rsta.ui.search.SearchEvent e)
          Called when a search event is received from the Find/Replace dialogs or tool bars.
 void setAntiAliasEnabled(boolean enabled)
          Sets whether anti-aliasing is enabled in text areas.
 void setAutoInsertClosingCurlys(boolean autoInsert)
          Toggles whether closing curly braces are auto-inserted for languages where it makes sense.
 void setBackgroundImageAlpha(float alpha)
          Sets the alpha value used to make a background image translucent.
 void setBackgroundImageFileName(java.lang.String path)
          Sets the path to the file containing the current background image.
 void setBackgroundObject(java.lang.Object newBackground)
          Makes the background into this Object (either a java.awt.Color or a java.awt.Image).
 void setBookmarksEnabled(boolean enabled)
          Toggles whether bookmarks are enabled.
 void setBracketMatchingEnabled(boolean enabled)
          Sets whether or not bracket matching is enabled.
 void setCaretBlinkRate(int blinkRate)
          Sets the blink rate for carets in all text areas.
 void setCaretColor(java.awt.Color color)
          Sets the color of the caret used by all text areas in this tabbed pane.
 void setCaretStyle(int mode, int style)
          Sets the caret style for either the insert or overwrite caret.
 void setCodeFoldingEnabledFor(java.lang.String language, boolean enabled)
          Sets whether code folding is enabled for a language.
 void setCurrentLineHighlightColor(java.awt.Color color)
          Sets the color to use to highlight the current line.
 void setCurrentLineHighlightEnabled(boolean enabled)
          Sets whether or not the current line is highlighted.
protected  void setCurrentTextArea(RTextEditorPane textArea)
          Sets the "currently active" text area.
 void setDefaultEncoding(java.lang.String encoding)
          Sets the default encoding of new text files to the specified value.
abstract  void setDocumentDisplayNameAt(int index, java.lang.String displayName)
          Sets the name being displayed for a given document.
abstract  void setDocumentSelectionPlacement(int location)
          Changes the location of the document selection area of this component.
 void setDoFileSizeCheck(boolean doCheck)
          Sets whether a file's size is checked before it is opened.
 void setFractionalFontMetricsEnabled(boolean enabled)
          Sets whether fractional font metrics is enabled.
 void setGuessFileContentType(boolean guess)
          Sets whether files with no extension have their content type guessed at via whether they have a "#!
 void setGutterBorderColor(java.awt.Color c)
          Sets the color to use for the gutter's border.
 void setHighlightModifiedDocumentDisplayNames(boolean highlight)
          Sets whether this panel will highlight modified documents' display names with a different color.
 void setHighlightSecondaryLanguages(boolean highlight)
          Sets whether secondary languages are highlighted.
 void setHyperlinkColor(java.awt.Color c)
          Sets the color hyperlinks are displayed with in text editors.
 void setHyperlinkModifierKey(int key)
          Sets the modifier key used to start hyperlink scanning in text editors.
 void setHyperlinksEnabled(boolean enabled)
          Sets whether hyperlinks are enabled in text editors.
 void setIgnoreBackupExtensions(boolean ignore)
          Sets whether RText should ignore extensions like ".bak", ".old", and ".orig" when deciding how to open them.
 void setLineNumberColor(java.awt.Color c)
          Sets the color used for line numbers.
 void setLineNumberFont(java.awt.Font f)
          Sets the font used for line numbers.
 void setLineNumbersEnabled(boolean enabled)
          Enables/disables the line numbers for the open documents.
 void setLineTerminator(java.lang.String terminator)
          Sets the line terminator to use for new text files.
 void setLineWrap(boolean enabled)
          Enables/disables word wrap of the open documents.
 void setMarginLineColor(java.awt.Color color)
          Sets the color used for the margin line in text areas.
 void setMarginLineEnabled(boolean enabled)
          Sets whether or not the margin line is enabled in all text areas.
 void setMarginLinePosition(int position)
          Sets the margin line position in all text areas.
 void setMarkAllHighlightColor(java.awt.Color color)
          Sets the color selected for "mark all."
 void setMarkOccurrences(boolean markOccurrences)
          Sets whether "mark occurrences" is enabled.
 void setMarkOccurrencesColor(java.awt.Color color)
          Sets the color to use to "mark occurrences."
 void setMatchBothBrackets(boolean matchBoth)
          Sets whether both brackets are highlighted when bracket matching.
 void setMatchedBracketBGColor(java.awt.Color color)
          Sets the background color to use in bracket matching.
 void setMatchedBracketBorderColor(java.awt.Color color)
          Sets the border color to use in bracket matching.
 void setMaxFileSize(float size)
          If file size checking is enabled, this is the maximum size a file can be before the user is prompted before opening it.
 void setModifiedDocumentDisplayNamesColor(java.awt.Color color)
          Sets the color used to highlight modified documents' display names.
 void setPrintFont(java.awt.Font newPrintFont)
          Sets the font to use when printing documents.
 void setRememberWhitespaceLines(boolean remember)
          Toggles whether whitespace lines should be remembered (vs. cleared out on Enter presses).
 void setRoundedSelectionEdges(boolean rounded)
          Sets whether selection edges are rounded in text areas.
 void setSecondaryLanguageColor(int index, java.awt.Color color)
          Sets the color to use for a secondary language.
abstract  void setSelectedIndex(int index)
          Sets the currently active document.
 boolean setSelectedTextArea(RTextEditorPane textArea)
          Sets the currently active text area.
 void setSelectedTextColor(java.awt.Color color)
          Sets the color to use for selected text in all text areas, if selected text painting is enabled.
 void setSelectionColor(java.awt.Color color)
          Sets the color of selections in all text areas in this tabbed pane.
 void setShowEOLMarkers(boolean show)
          Toggles whether EOL markers are visible in the text areas.
 void setShowTabLines(boolean show)
          Toggles whether tab lines are visible in editors.
 void setSyntaxFilters(SyntaxFilters syntaxFilters)
          Sets the file filters used when opening documents to decide how to syntax highlight documents.
 void setSyntaxScheme(SyntaxScheme colorScheme)
          Sets the syntax highlighting color scheme being used.
 void setTabLinesColor(java.awt.Color color)
          Sets the color to use for tab lines in editors.
 void setTabsEmulated(boolean areEmulated)
          Changes whether or not tabs should be emulated with spaces (i.e., soft tabs).
 void setTabSize(int newSize)
          Sets the tab size to be used on all documents.
 void setTextAreaFont(java.awt.Font font, boolean underline)
          Sets the default font for text areas.
 void setTextAreaForeground(java.awt.Color fg)
          Sets the default foreground color for text areas.
 void setTextAreaOrientation(java.awt.ComponentOrientation o)
          Sets the component orientation of the text areas.
 void setTextMode(int mode)
          Enables either insert mode or overwrite mode for the text documents.
 void setUseSelectedTextColor(boolean use)
          Sets whether text areas should honor their "selected text color", as opposed to just rendering token styles even for selected tokens.
 void setWhitespaceVisible(boolean visible)
          Sets whether whitespace is visible in all open text areas.
 void setWriteBOMInUtf8Files(boolean write)
          Sets whether BOM's should be written for UTF-8 files.
 void updateLookAndFeel()
          Updates the look and feel of objects that the parent RText can't get to.
protected  void updateStatusBar()
          Updates the status bar's read-only indicator and line/column indicator.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, 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
 

Field Detail

DOCUMENT_SELECT_TOP

public static final int DOCUMENT_SELECT_TOP
See Also:
Constant Field Values

DOCUMENT_SELECT_LEFT

public static final int DOCUMENT_SELECT_LEFT
See Also:
Constant Field Values

DOCUMENT_SELECT_BOTTOM

public static final int DOCUMENT_SELECT_BOTTOM
See Also:
Constant Field Values

DOCUMENT_SELECT_RIGHT

public static final int DOCUMENT_SELECT_RIGHT
See Also:
Constant Field Values

AUTO_INSERT_CLOSING_CURLYS

public static final java.lang.String AUTO_INSERT_CLOSING_CURLYS
See Also:
Constant Field Values

CURRENT_DOCUMENT_PROPERTY

public static final java.lang.String CURRENT_DOCUMENT_PROPERTY
See Also:
Constant Field Values

DEFAULT_ENCODING_PROPERTY

public static final java.lang.String DEFAULT_ENCODING_PROPERTY
See Also:
Constant Field Values

FILE_SIZE_CHECK_PROPERTY

public static final java.lang.String FILE_SIZE_CHECK_PROPERTY
See Also:
Constant Field Values

FRACTIONAL_METRICS_PROPERTY

public static final java.lang.String FRACTIONAL_METRICS_PROPERTY
See Also:
Constant Field Values

MARK_ALL_COLOR_PROPERTY

public static final java.lang.String MARK_ALL_COLOR_PROPERTY
See Also:
Constant Field Values

MARK_OCCURRENCES_COLOR_PROPERTY

public static final java.lang.String MARK_OCCURRENCES_COLOR_PROPERTY
See Also:
Constant Field Values

MARK_OCCURRENCES_PROPERTY

public static final java.lang.String MARK_OCCURRENCES_PROPERTY
See Also:
Constant Field Values

MAX_FILE_SIZE_PROPERTY

public static final java.lang.String MAX_FILE_SIZE_PROPERTY
See Also:
Constant Field Values

REMEMBER_WS_LINES_PROPERTY

public static final java.lang.String REMEMBER_WS_LINES_PROPERTY
See Also:
Constant Field Values

ROUNDED_SELECTION_PROPERTY

public static final java.lang.String ROUNDED_SELECTION_PROPERTY
See Also:
Constant Field Values

SMOOTH_TEXT_PROPERTY

public static final java.lang.String SMOOTH_TEXT_PROPERTY
See Also:
Constant Field Values

TEXT_AREA_ADDED_PROPERTY

public static final java.lang.String TEXT_AREA_ADDED_PROPERTY
See Also:
Constant Field Values

TEXT_AREA_REMOVED_PROPERTY

public static final java.lang.String TEXT_AREA_REMOVED_PROPERTY
See Also:
Constant Field Values

searchContext

public FindInFilesSearchContext searchContext

findInFilesDialog

public FindInFilesDialog findInFilesDialog

replaceInFilesDialog

public ReplaceInFilesDialog replaceInFilesDialog

goToDialog

public org.fife.rsta.ui.GoToDialog goToDialog

owner

protected RText owner
Constructor Detail

AbstractMainView

public AbstractMainView()
Constructor.

You should call initialize(org.fife.rtext.RText, java.lang.String[], org.fife.rtext.RTextPreferences) right after this.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

addCurrentTextAreaListener

public void addCurrentTextAreaListener(CurrentTextAreaListener l)
Adds a current text area listener.

Parameters:
l - The listener to add.
See Also:
removeCurrentTextAreaListener(org.fife.rtext.CurrentTextAreaListener)

addNewEmptyUntitledFile

public void addNewEmptyUntitledFile()
Adds an empty text file with a default name to this panel. This method is synchronized so it doesn't interfere with the thread checking for files being modified outside of the editor.


addTextAreaImpl

protected abstract void addTextAreaImpl(java.lang.String title,
                                        java.awt.Component component,
                                        java.lang.String fileFullPath)
Adds a text area visually to this panel.

Parameters:
title - The name of the document to display.
component - The component to add (usually an RTextScrollPane).
fileFullPath - The full path to the file being displayed by the component.

applyComponentOrientation

public void applyComponentOrientation(java.awt.ComponentOrientation o)
Overridden so we ensure text areas keep their special LTR or RTL orientaitons.

Overrides:
applyComponentOrientation in class java.awt.Container
Parameters:
o - The new component orientation.

areTabsEmulated

public boolean areTabsEmulated()
Returns whether or not tabs are emulated with spaces.

Returns:
true iff tabs are emulated with spaces.

checkFilesForOutsideModification

public void checkFilesForOutsideModification()
Checks the "modified" timestamps for open files against the last known "modified" timestamps to see if any files have been modified outside of this RText instance. This method is synchronized so that it isn't called while the user is loading or saving a file.


closeAllDocuments

public boolean closeAllDocuments()
Attempts to close all currently active documents.

Returns:
true if all active documents were closed, and false if they weren't (i.e., the user hit cancel).

closeAllDocumentsExcept

public boolean closeAllDocumentsExcept(int except)
Attempts to close all currently active documents except the one specified.

Returns:
true if the documents were all closed, and false if they weren't (i.e., the user hit cancel).

closeCurrentDocument

public final boolean closeCurrentDocument()
Attempts to close the current document.

Returns:
Whether the file was closed (e.g. the user didn't cancel the operation). This will also return false if an IO error occurs saving the file, if the user chooses to do so.

closeCurrentDocumentImpl

protected abstract boolean closeCurrentDocumentImpl()
Attempts to close the current document. Any implementation of this method must be synchronized so it doesn't interfere with the thread checking for files being modified outside of the editor.

Returns:
Whether the document was closed (e.g. the user didn't cancel the operation).

convertOpenFilesSpacesToTabs

public void convertOpenFilesSpacesToTabs()
Converts all instances of a number of spaces equal to a tab in all open documents into tabs.

See Also:
convertOpenFilesTabsToSpaces()

convertOpenFilesTabsToSpaces

public void convertOpenFilesTabsToSpaces()
Converts all tabs in all open documents into an equivalent number of spaces.

See Also:
convertOpenFilesSpacesToTabs()

copyData

public void copyData(AbstractMainView fromPanel)

createErrorStrip

protected ErrorStrip createErrorStrip(RTextEditorPane textArea)

dispose

public void dispose()
Disposes of this view. This is called when the user changes the main view style. The default implementation does nothing; subclasses can override to dispose of anything they want.


findInFilesFileSelected

public void findInFilesFileSelected(FindInFilesEvent e)
Called when the user selects a file in a listened-to find-in-files dialog.

Specified by:
findInFilesFileSelected in interface FindInFilesListener
Parameters:
e - The event received from the FindInFilesDialog.

fireCurrentTextAreaEvent

protected void fireCurrentTextAreaEvent(int type,
                                        java.lang.Object oldValue,
                                        java.lang.Object newValue)
Notifies all registered CurrentTextAreaListeners of a change in the current text area.

Parameters:
type - The type of event to fire.
oldValue - The old value.
newValue - The new value.

getAutoInsertClosingCurlys

public boolean getAutoInsertClosingCurlys()
Returns whether closing curly braces are auto-inserted in languages where it is appropriate.

Returns:
Whether closing curly braces are auto-inserted.
See Also:
setAutoInsertClosingCurlys(boolean)

getBackgroundImageAlpha

public float getBackgroundImageAlpha()
Returns the alpha value used to make the background image translucent. This value does NOT change the background if no image is used (i.e., if the background is just a color).

Returns:
The alpha value used to make a background image translucent. This value will be in the range 0.0f to 1.0f.
See Also:
setBackgroundImageAlpha(float)

getBackgroundImageFileName

public java.lang.String getBackgroundImageFileName()
Returns the full path to the file containing the current background image.

Returns:
The path, or null if the current background is a color.
See Also:
setBackgroundImageFileName(java.lang.String)

getBackgroundObject

public java.lang.Object getBackgroundObject()
Returns the Object representing the background for all documents in this tabbed pane; either a java.awt.Color or a java.lang.String.


getBookmarksEnabled

public boolean getBookmarksEnabled()
Returns whether bookmarks are enabled.

Returns:
Whether bookmarks are enabled.
See Also:
setBookmarksEnabled(boolean)

getCaretBlinkRate

public int getCaretBlinkRate()
Returns the blink rate for all text areas.

Returns:
The blink rate.
See Also:
setCaretBlinkRate(int)

getCaretColor

public java.awt.Color getCaretColor()
Returns the color being used for the carets of all text areas in this main view.

Returns:
The java.awt.Color being used for all carets.

getCaretStyle

public int getCaretStyle(int mode)
Returns the caret style for either the insert or overwrite caret.

Parameters:
mode - Either RTextArea.INSERT_MODE or RTextArea.OVERWRITE_MODE.
Returns:
The style of that caret, such as ConfigurableCaret.VERTICAL_LINE_STYLE.
See Also:
setCaretStyle(int, int), ConfigurableCaret

getCodeFoldingEnabledForString

public java.lang.String getCodeFoldingEnabledForString()
Returns a comma-separated string of languages with code folding enabled.

Returns:
A comma-separated string.
See Also:
isCodeFoldingEnabledFor(String), setCodeFoldingEnabledFor(String, boolean)

getCurrentLineHighlightColor

public java.awt.Color getCurrentLineHighlightColor()
Returns the color being used to highlight the current line. Note that if highlighting the current line is turned off, you will not be seeing this highlight.

Returns:
The color being used to highlight the current line.
See Also:
isCurrentLineHighlightEnabled(), setCurrentLineHighlightEnabled(boolean), setCurrentLineHighlightColor(java.awt.Color)

getCurrentTextArea

public RTextEditorPane getCurrentTextArea()
Returns the currently active text area.

Returns:
The currently active text area.

getDefaultEncoding

public java.lang.String getDefaultEncoding()
Returns the default encoding of new text files.

Returns:
The default encoding.
See Also:
setDefaultEncoding(String)

getDoFileSizeCheck

public boolean getDoFileSizeCheck()
Returns whether a file's size should be checked before it is opened.

Returns:
Whether a file's size is checked before it is opened.
See Also:
setDoFileSizeCheck(boolean)

getDocumentDisplayNameAt

public abstract java.lang.String getDocumentDisplayNameAt(int index)
Returns the name being displayed for the document. For example, in a tabbed pane subclass, this could be the text on the tab for this document.

Parameters:
index - The index at which to find the name. If the index is invalid, null is returned.
Returns:
The name being displayed for this document.

getDocumentSelectionPlacement

public abstract int getDocumentSelectionPlacement()
Returns the location of the document selection area of this component.

Returns:
The location of the document selection area.

getFileIndex

public int getFileIndex(java.lang.String fileFullPath)
Returns the index of the specified document.

Returns:
The index of the specified file, or -1 if the file is not being edited.

getGuessFileContentType

public boolean getGuessFileContentType()
Returns whether files with no extension have their content type guessed at via whether they have a "#!" in their first line.

Returns:
Whether to guess the content type of files with no extension.
See Also:
setGuessFileContentType(boolean)

getGutterBorderColor

public java.awt.Color getGutterBorderColor()
Returns the color to use for the gutter border color.

Returns:
The gutter border color.
See Also:
setGutterBorderColor(Color)

getHighlightSecondaryLanguages

public boolean getHighlightSecondaryLanguages()
Returns whether secondary languages are highlighted.

Returns:
Whether secondary languages are highlighted.
See Also:
setHighlightSecondaryLanguages(boolean)

getHyperlinkColor

public java.awt.Color getHyperlinkColor()
Returns the color editors use for hyperlinks.

Returns:
The color used.
See Also:
setHyperlinkColor(Color)

getHyperlinkModifierKey

public int getHyperlinkModifierKey()
Returns the modifier key editors use to scan for hyperlinks.

Returns:
The modifier key(s).
See Also:
setHyperlinkModifierKey(int), InputEvent

getHyperlinksEnabled

public boolean getHyperlinksEnabled()
Returns whether hyperlinks are enabled in text editors.

Returns:
Whether hyperlinks are enabled.
See Also:
setHyperlinksEnabled(boolean)

getIconFor

protected javax.swing.Icon getIconFor(RTextScrollPane scrollPane)
Returns the system icon associated with the file being edited in the given scroll pane (actually, in the text area inside of it). This method is called by subclasses that want to display a system icon for open files.

Parameters:
scrollPane - The scroll pane.
Returns:
The icon.

getIgnoreBackupExtensions

public boolean getIgnoreBackupExtensions()
Returns whether RText ignores extensions like ".bak", ".old", and ".orig" when deciding how to open them.

Returns:
Whether those extensions are ignored.
See Also:
setIgnoreBackupExtensions(boolean)

getLineNumberColor

public java.awt.Color getLineNumberColor()
Sets the color used for line numbers.

Returns:
The line number color.
See Also:
setLineNumberColor(Color)

getLineNumberFont

public java.awt.Font getLineNumberFont()
Returns the font used for line numbers.

Returns:
The line number font.
See Also:
setLineNumberFont(Font)

getLineNumbersEnabled

public boolean getLineNumbersEnabled()
Returns whether or not line numbers are visible in the open documents.


getLineTerminator

public java.lang.String getLineTerminator()
Returns the line terminator to use for new text files.

Returns:
The line terminator.
See Also:
setLineTerminator(String)

getLineWrap

public boolean getLineWrap()
Returns whether or not line (word) wrap is enabled for the open documents.


getMarginLineColor

public java.awt.Color getMarginLineColor()
Returns the margin line's color.

Returns:
The color of the margin (even if it is not enabled).
See Also:
setMarginLineColor(java.awt.Color)

getMarginLinePosition

public int getMarginLinePosition()
Returns the position of the margin line (even if it is not enabled).

Returns:
The position of the margin line.
See Also:
setMarginLinePosition(int)

getMarkAllHighlightColor

public java.awt.Color getMarkAllHighlightColor()
Returns the color selected by the user for "mark all."

Returns:
The color.
See Also:
setMarkAllHighlightColor(java.awt.Color)

getMarkOccurrences

public boolean getMarkOccurrences()
Returns whether "mark occurrences" is enabled.

Returns:
Whether "mark occurrences" is enabled.
See Also:
setMarkOccurrences(boolean)

getMarkOccurrencesColor

public java.awt.Color getMarkOccurrencesColor()
Returns the color to use to "mark occurrences."

Returns:
The color.
See Also:
setMarkOccurrencesColor(Color), getMarkOccurrences()

getMatchBothBrackets

public boolean getMatchBothBrackets()
Returns whether both brackets are highlighted when bracket matching.

Returns:
Whether both brackets are matched (as opposed to just the opposite bracket).
See Also:
setMatchBothBrackets(boolean)

getMatchedBracketBGColor

public java.awt.Color getMatchedBracketBGColor()
Returns the background color used in bracket matching.

Returns:
The background color used when highlighting a bracket.
See Also:
setMatchedBracketBGColor(java.awt.Color)

getMatchedBracketBorderColor

public java.awt.Color getMatchedBracketBorderColor()
Returns the border color used in bracket matching.

Returns:
The border color used when highlighting a bracket.
See Also:
setMatchedBracketBorderColor(java.awt.Color)

getMaxFileSize

public float getMaxFileSize()
If file-size checking is enabled, this is the maximum size a file can be before the user is prompted before opening it.

Returns:
The maximum file size.
See Also:
setMaxFileSize(float), getDoFileSizeCheck()

getModifiedDocumentDisplayNamesColor

public java.awt.Color getModifiedDocumentDisplayNamesColor()
Gets the color used to highlight modified documents' display names.

Returns:
color The color used.
See Also:
setModifiedDocumentDisplayNamesColor(java.awt.Color), highlightModifiedDocumentDisplayNames(), setHighlightModifiedDocumentDisplayNames(boolean)

getNumDocuments

public abstract int getNumDocuments()
Returns the number of documents open in this container.

Returns:
The number of open documents.

getOpenFiles

public java.io.File[] getOpenFiles()
Returns all of the files opened in this main view.

Returns:
An array of files representing the files being edited in this main view. If no documents are open, null is returned.

getPrintFont

public java.awt.Font getPrintFont()
Returns the java.awt.Font currently used to print documents.

Returns:
The font used to print documents. If null is returned, that means the current RText font is being used to print documents.
See Also:
setPrintFont(java.awt.Font)

getRememberWhitespaceLines

public boolean getRememberWhitespaceLines()
Returns whether whitespace lines are remembered (as opposed to cleared on Enter presses).

Returns:
Whether whitespace lines are remembered.
See Also:
setRememberWhitespaceLines(boolean)

getRoundedSelectionEdges

public boolean getRoundedSelectionEdges()
Returns whether selection edges are rounded in text areas.

Returns:
Whether selection edges are rounded.
See Also:
setRoundedSelectionEdges(boolean)

getRTextEditorPaneAt

public RTextEditorPane getRTextEditorPaneAt(int index)
Returns the org.fife.rtext.RTextEditorPane on the specified tab. This is a convenience method for (RTextEditorPane)getRTextScrollPaneAt(i).textArea.

Parameters:
index - The tab for which you want to get the RTextEditorPane.
Returns:
The corresponding RTextEditorPane.

getRTextScrollPaneAt

public abstract RTextScrollPane getRTextScrollPaneAt(int index)
Returns the org.fife.rtext.RTextScrollPane at the given index.

Parameters:
index - The tab for which you want to get the org.fife.rtext.RTextScrollPane.
Returns:
The scroll pane.

getSearchManager

public SearchManager getSearchManager()
Returns the search manager for this view.

Returns:
The search manager.

getSecondaryLanguageColor

public java.awt.Color getSecondaryLanguageColor(int index)
Returns the color to use for a secondary language.

Parameters:
index - The index of the secondary color.
Returns:
The color to use.
See Also:
setSecondaryLanguageColor(int, Color)

getSelectedComponent

public abstract java.awt.Component getSelectedComponent()
Returns the currently active component.

Returns:
The component.

getSelectedIndex

public abstract int getSelectedIndex()
Returns the currently selected document's index.

Returns:
The index of the currently selected document.

getSelectedTextColor

public java.awt.Color getSelectedTextColor()
Returns the color being used for selected text in all text areas in this main view, if selected text is enabled.

Returns:
The Color being used for all selections in all text areas.
See Also:
getUseSelectedTextColor(), setSelectedTextColor(Color)

getSelectionColor

public java.awt.Color getSelectionColor()
Returns the color being used for selections in all text areas in this main view.

Returns:
The Color being used for all selections in all text areas.
See Also:
setSelectionColor(Color)

getShowEOLMarkers

public boolean getShowEOLMarkers()
Returns whether EOL markers are visible in the text areas.

Returns:
Whether EOL markers are visible.
See Also:
setShowEOLMarkers(boolean), isWhitespaceVisible()

getShowTabLines

public boolean getShowTabLines()
Returns whether tab lines are visible in the text areas.

Returns:
Whether tab lines are visible.
See Also:
setShowTabLines(boolean), getTabLinesColor()

getSpellingSupport

public SpellingSupport getSpellingSupport()
Returns the spell checking support for RText.

Returns:
The spell checking support.

getSyntaxFilters

public SyntaxFilters getSyntaxFilters()
Returns the syntax filters being used to open documents (i.e., to decide what syntax highlighting color scheme, if any, to use when opening documents).

Returns:
The filters being used.
See Also:
setSyntaxFilters(SyntaxFilters)

getSyntaxStyleForFile

public java.lang.String getSyntaxStyleForFile(java.lang.String fileName)
Returns the syntax style to use for a file.

Parameters:
fileName - The name of the file.
Returns:
The syntax style to use.

getTabLinesColor

public java.awt.Color getTabLinesColor()
Returns the color to use for tab lines in an editor.

Returns:
The color used for tab lines.
See Also:
setTabLinesColor(Color), getShowTabLines()

getTabSize

public int getTabSize()
Returns the size of a tab, in spaces.

Returns:
The tab size (in spaces) currently being used by all documents in this tabbed pane.

getTextAreaFont

public java.awt.Font getTextAreaFont()
Returns the default font to use in text areas.

Returns:
The default font.
See Also:
getTextAreaUnderline(), setTextAreaFont(Font, boolean)

getTextAreaForeground

public java.awt.Color getTextAreaForeground()
Returns the default foreground color for text areas.

Returns:
The default foreground color.
See Also:
setTextAreaForeground(Color)

getTextAreaOrientation

public java.awt.ComponentOrientation getTextAreaOrientation()
Returns the orientation of the text editors.

Returns:
The orientation.
See Also:
setTextAreaOrientation(ComponentOrientation)

getTextAreaUnderline

public boolean getTextAreaUnderline()
Returns whether text areas' default fonts should be underlined.

Returns:
Whether to underline the default font.
See Also:
getTextAreaFont(), setTextAreaFont(Font, boolean)

getTextMode

public int getTextMode()
Returns the text mode we're in.

Returns:
RTextEditorPane.INSERT_MODE or RTextEditorPane.OVERWRITE_MODE.
See Also:
setTextMode(int)

getUseSelectedTextColor

public boolean getUseSelectedTextColor()
Returns whether text areas are honoring their "selected text color", as opposed to just rendering token styles even for selected tokens.

Returns:
Whether the "selected text color" is being honored.
See Also:
setUseSelectedTextColor(boolean), getSelectedTextColor()

getWriteBOMInUtf8Files

public boolean getWriteBOMInUtf8Files()
Returns whether BOM's are written for UTF-8 files.

Returns:
Whether BOM's are written for UTF-8 files.
See Also:
setWriteBOMInUtf8Files(boolean)

highlightModifiedDocumentDisplayNames

public boolean highlightModifiedDocumentDisplayNames()
Returns whether this panel is highlighting modified documents' display names with a different color.

See Also:
setHighlightModifiedDocumentDisplayNames(boolean), getModifiedDocumentDisplayNamesColor(), setModifiedDocumentDisplayNamesColor(java.awt.Color)

hyperlinkUpdate

public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
Called when a hyperlink is entered, exited, or clicked in the current text area.

Specified by:
hyperlinkUpdate in interface javax.swing.event.HyperlinkListener
Parameters:
e - The hyperlink event.

initialize

protected void initialize(RText owner,
                          java.lang.String[] filesToOpen,
                          RTextPreferences prefs)
Initializes this component.

Parameters:
owner - The RText that this tabbed pane sits in.
filesToOpen - Array of strings representing files to open. If this parameter is null, a single file with a default name is opened.
prefs - A properties object used to initialize some fields on this main view.

isAntiAliasEnabled

public boolean isAntiAliasEnabled()
Returns whether text is anti-aliased in text areas.

Returns:
Whether text is anti-aliased in text areas.
See Also:
isFractionalFontMetricsEnabled(), setAntiAliasEnabled(boolean)

isBracketMatchingEnabled

public boolean isBracketMatchingEnabled()
Returns whether or not bracket matching is enabled.

Returns:
true iff bracket matching is enabled.
See Also:
setBracketMatchingEnabled(boolean)

isCodeFoldingEnabledFor

public boolean isCodeFoldingEnabledFor(java.lang.String language)
Returns whether code folding is enabled for a language.

Parameters:
language - A language.
Returns:
Whether code folding is enabled for that language.
See Also:
setCodeFoldingEnabledFor(String, boolean)

isCurrentLineHighlightEnabled

public boolean isCurrentLineHighlightEnabled()
Returns whether or not the current line is highlighted.

Returns:
Whether or the current line is highlighted.
See Also:
setCurrentLineHighlightEnabled(boolean), getCurrentLineHighlightColor(), setCurrentLineHighlightColor(java.awt.Color)

isFractionalFontMetricsEnabled

public boolean isFractionalFontMetricsEnabled()
Returns whether fractional font-metrics is enabled.

Returns:
Whether fractional font-metrics is enabled.
See Also:
isAntiAliasEnabled(), setFractionalFontMetricsEnabled(boolean)

isMarginLineEnabled

public boolean isMarginLineEnabled()
Returns whether or not the margin line is enabled

Returns:
Whether or not the margin line is enabled.
See Also:
setMarginLineEnabled(boolean)

isWhitespaceVisible

public boolean isWhitespaceVisible()
Returns whether whitespace is visible in the text areas in this panel.

Returns:
Whether whitespace is visible.
See Also:
setWhitespaceVisible(boolean)

loadMacro

public void loadMacro(java.io.File file)
Loads a macro. This macro will be loaded into all currently-open RTextEditorPanes, as well as all editor panes opened afterward, until a new macro is loaded.

Parameters:
file - The file containing the macro to load. If this file does not exist or is otherwise invalid, no macro is loaded.

moveToTopOfCurrentDocument

public void moveToTopOfCurrentDocument()
Scrolls to the top of the current document, and places the cursor there.


openFile

public boolean openFile(FileLocation loc,
                        java.lang.String charSet,
                        boolean reuse)
Adds a file to this tabbed pane. This method is synchronized so it doesn't interfere with the thread checking for files being modified outside of the editor.

Parameters:
loc - The location of the file to add.
charSet - The encoding to use when reading/writing this file. If this value is null, the file is checked for Unicode; if it is Unicode, it is opened properly. If it is not Unicode, a system default encoding is used.
reuse - If the file is already open, whether to simply switch focus to that old copy (vs. opening a new copy).
Returns:
true if the file was opened (or switched to), false otherwise (if the file does not exist and the user chose NOT to create it, for example).
Throws:
InvalidCharSetException - If the specified character set is invalid.

openFile

public boolean openFile(java.lang.String fileNameAndPath,
                        java.lang.String charSet)
Adds an already-created text file to this tabbed pane. This method is synchronized so it doesn't interfere with the thread checking for files being modified outside of the editor.

Parameters:
fileNameAndPath - The full path and name of the file to add.
charSet - The encoding to use when reading/writing this file. If this value is null, the file is checked for Unicode; if it is Unicode, it is opened properly. If it is not Unicode, a system default encoding is used.
Returns:
true if the file was opened (or switched to), false otherwise (if the file does not exist and the user chose NOT to create it, for example).
Throws:
InvalidCharSetException - If the specified character set is invalid.

openFile

public boolean openFile(java.lang.String fileNameAndPath,
                        java.lang.String charSet,
                        boolean reuse)
Adds an already-created text file to this tabbed pane. This method is synchronized so it doesn't interfere with the thread checking for files being modified outside of the editor.

Parameters:
fileNameAndPath - The full path and name of the file to add.
charSet - The encoding to use when reading/writing this file. If this value is null, the file is checked for Unicode; if it is Unicode, it is opened properly. If it is not Unicode, a system default encoding is used.
reuse - If the file is already open, whether to simply switch focus to that old copy (vs. opening a new copy).
Returns:
true if the file was opened (or switched to), false otherwise (if the file does not exist and the user chose NOT to create it, for example).
Throws:
InvalidCharSetException - If the specified character set is invalid.

promptToSaveBeforeClosingIfDirty

protected int promptToSaveBeforeClosingIfDirty()
If the current editor is dirty, the user is prompted whether they want to save it. If they choose "yes", the file is saved, otherwise it is not.

Returns:
JOptionPane.YES_OPTION if the file was saved, NO_OPTION if the user chose not to save, and CANCEL_OPTION if the user canceled the save dialog, or an IO error occurs.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Called whenever a property changes on a component we're listening to.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

refreshDisplayNames

public abstract void refreshDisplayNames()
Repaints the display names for open documents.


renumberDisplayNames

public void renumberDisplayNames()
Looks for duplicate open documents (documents opened more than once) and adds numbers to the display names for these documents to differentiate them.


requestFocusInWindow

public boolean requestFocusInWindow()
Overridden to forward the focus request to the current text area. This is actually required for the Find/Replace tool bars.

Overrides:
requestFocusInWindow in class javax.swing.JComponent
Returns:
Whether the request is likely to succeed.

removeComponentAt

protected abstract void removeComponentAt(int index)
Removes a component from this container.

Parameters:
index - The index of the component to remove.

removeCurrentTextAreaListener

public void removeCurrentTextAreaListener(CurrentTextAreaListener l)
Removes a current text area listener.

Parameters:
l - The listener to remove.
See Also:
addCurrentTextAreaListener(org.fife.rtext.CurrentTextAreaListener)

saveAllFiles

public boolean saveAllFiles()
Attempts to save all currently-opened files. If any files have unsaved changes, the user is prompted whether to save them.

Returns:
Whether all files were successfully saved. This will be false if an IO error occurs, or if a file has unsaved changes and the user selects "Cancel" when prompted to save them.
See Also:
saveCurrentFile(), saveCurrentFileAs(), saveCurrentFileAs(FileLocation)

saveCurrentFile

public boolean saveCurrentFile()
Attempts to save the currently active file as it's current name. If the file is named "Untitled.txt", this action is essentially a "Save As" - the user is then prompted for a name to save with.

If an IO error occurs, the user is notified.

Returns:
true if the save is successful, false if the user cancels the save operation or an IO error occurs.
See Also:
saveAllFiles(), saveCurrentFileAs(), saveCurrentFileAs(FileLocation)

saveCurrentFileAs

public boolean saveCurrentFileAs()
Attempts to save the currently active file. The user will be prompted for a new file name to save with.

Returns:
true if the save is successful, false if the user cancels the save operation or an IO error occurs.
See Also:
saveCurrentFileAs(FileLocation), saveCurrentFile(), saveAllFiles()

saveCurrentFileAs

public boolean saveCurrentFileAs(FileLocation loc)
Attempts to save the currently active file with a new name. If the save is successful, the current editor is renamed to the new name; if the save fails, the name doesn't change.

Parameters:
loc - The location to save the file to.
Returns:
true if the save is successful, false if an IO error occurs.

searchEvent

public void searchEvent(org.fife.rsta.ui.search.SearchEvent e)
Called when a search event is received from the Find/Replace dialogs or tool bars.

Specified by:
searchEvent in interface org.fife.rsta.ui.search.SearchListener
Parameters:
e - The search event.

setAntiAliasEnabled

public void setAntiAliasEnabled(boolean enabled)
Sets whether anti-aliasing is enabled in text areas. This method fires a property change event of type SMOOTH_TEXT_PROPERTY.

Parameters:
enabled - Whether anti-aliasing should be enabled.
See Also:
isAntiAliasEnabled()

setAutoInsertClosingCurlys

public void setAutoInsertClosingCurlys(boolean autoInsert)
Toggles whether closing curly braces are auto-inserted for languages where it makes sense. This method fires a property change event of type AUTO_INSERT_CLOSING_CURLYS.

Parameters:
autoInsert - Whether to auto-insert curlys.
See Also:
getAutoInsertClosingCurlys()

setBackgroundImageAlpha

public void setBackgroundImageAlpha(float alpha)
Sets the alpha value used to make a background image translucent. Note that if the background being used is simply a color and not a JPG or GIF image, this value does nothing.

Parameters:
alpha - The new alpha value to use to make background images translucent. This value should be between 0.0f and 1.0f. If it is less than 0.0f, it will be rounded up to 0.0f; if it is greater than 1.0f, it will be rounded down to 1.0f.
See Also:
getBackgroundImageAlpha()

setBackgroundImageFileName

public void setBackgroundImageFileName(java.lang.String path)
Sets the path to the file containing the current background image. Note that this should only be called in conjunction with setBackgroundObject when the Object is an instance of java.awt.Image If you are setting the background to a java.awt.Color, you should pass null to this method.

Parameters:
path - The path to the file containing the current background image, or null if the current background is an image.
See Also:
getBackgroundImageFileName()

setBackgroundObject

public void setBackgroundObject(java.lang.Object newBackground)
Makes the background into this Object (either a java.awt.Color or a java.awt.Image).

Parameters:
newBackground - The java.awt.Color or java.awt.Image object.

setBookmarksEnabled

public void setBookmarksEnabled(boolean enabled)
Toggles whether bookmarks are enabled.

Parameters:
enabled - Whether bookmarks are enabled.
See Also:
getBookmarksEnabled()

setBracketMatchingEnabled

public void setBracketMatchingEnabled(boolean enabled)
Sets whether or not bracket matching is enabled.

Parameters:
enabled - Whether or not bracket matching should be enabled.
See Also:
isBracketMatchingEnabled()

setCaretBlinkRate

public void setCaretBlinkRate(int blinkRate)
Sets the blink rate for carets in all text areas.

Parameters:
blinkRate - The new blink rate. If this value is invalid (< 0), nothing happens.
See Also:
getCaretBlinkRate()

setCaretColor

public void setCaretColor(java.awt.Color color)
Sets the color of the caret used by all text areas in this tabbed pane.

Parameters:
color - The color to use for the caret. If null is passed in, there is no change to the caret color being used.

setCaretStyle

public void setCaretStyle(int mode,
                          int style)
Sets the caret style for either the insert or overwrite caret.

Parameters:
mode - Either RTextArea.INSERT_MODE or RTextArea.OVERWRITE_MODE.
style - The style for the specified caret, such as ConfigurableCaret.VERTICAL_LINE_STYLE.
See Also:
getCaretStyle(int)

setCodeFoldingEnabledFor

public void setCodeFoldingEnabledFor(java.lang.String language,
                                     boolean enabled)
Sets whether code folding is enabled for a language.

Parameters:
language - The language.
enabled - Whether code folding should be enabled for the language.
See Also:
isCodeFoldingEnabledFor(String)

setCurrentLineHighlightColor

public void setCurrentLineHighlightColor(java.awt.Color color)
Sets the color to use to highlight the current line. Note that if highlighting the current line is turned off, you will not be able to see this highlight.

Parameters:
color - The color to use to highlight the current line.
Throws:
java.lang.NullPointerException - if color is null.
See Also:
isCurrentLineHighlightEnabled(), setCurrentLineHighlightEnabled(boolean), getCurrentLineHighlightColor()

setCurrentLineHighlightEnabled

public void setCurrentLineHighlightEnabled(boolean enabled)
Sets whether or not the current line is highlighted.

Parameters:
enabled - Whether or not to highlight the current line.
See Also:
isCurrentLineHighlightEnabled(), getCurrentLineHighlightColor(), setCurrentLineHighlightColor(java.awt.Color)

setCurrentTextArea

protected void setCurrentTextArea(RTextEditorPane textArea)
Sets the "currently active" text area. This should only be called by subclasses. After this is called, subclasses should call fireCurrentTextAreaEvent(int, Object, Object) to notify any registered listeners of the change.

Parameters:
textArea - The new text area.
See Also:
getCurrentTextArea()

setDefaultEncoding

public void setDefaultEncoding(java.lang.String encoding)
Sets the default encoding of new text files to the specified value. This method fires a property change event of type DEFAULT_ENCODING_PROPERTY.

Parameters:
encoding - The new default encoding. A value of null means to use the system default encoding.
See Also:
getDefaultEncoding()

setDocumentDisplayNameAt

public abstract void setDocumentDisplayNameAt(int index,
                                              java.lang.String displayName)
Sets the name being displayed for a given document. For example, in a tabbed pane subclass implementation, this could be the name on the tab of the document.

Parameters:
index - The index for the document for which to set the short name. If index is invalid, this method does nothing.
displayName - The name to display.
See Also:
getDocumentDisplayNameAt(int)

setDocumentSelectionPlacement

public abstract void setDocumentSelectionPlacement(int location)
Changes the location of the document selection area of this component.

Parameters:
location - The location to use; (TOP, LEFT, BOTTOM, or RIGHT. If this value is invalid, nothing happens.

setDoFileSizeCheck

public void setDoFileSizeCheck(boolean doCheck)
Sets whether a file's size is checked before it is opened. This method fires a property change event of type FILE_SIZE_CHECK_PROPERTY.

Parameters:
doCheck - Whether to check a file's size.
See Also:
getDoFileSizeCheck()

setFractionalFontMetricsEnabled

public void setFractionalFontMetricsEnabled(boolean enabled)
Sets whether fractional font metrics is enabled. This method fires a property change of type FRACTIONAL_METRICS_PROPERTY.

Parameters:
enabled - Whether fractional font metrics should be enabled.
See Also:
isFractionalFontMetricsEnabled()

setGuessFileContentType

public void setGuessFileContentType(boolean guess)
Sets whether files with no extension have their content type guessed at via whether they have a "#!" in their first line.

Parameters:
guess - Whether to guess the content type of files with no extension.
See Also:
getGuessFileContentType()

setGutterBorderColor

public void setGutterBorderColor(java.awt.Color c)
Sets the color to use for the gutter's border.

Parameters:
c - The new gutter border color. This cannot be null.
See Also:
getGutterBorderColor()

setHighlightModifiedDocumentDisplayNames

public void setHighlightModifiedDocumentDisplayNames(boolean highlight)
Sets whether this panel will highlight modified documents' display names with a different color.

Parameters:
highlight - Whether or not to highlight modified documents' display names.
See Also:
highlightModifiedDocumentDisplayNames(), getModifiedDocumentDisplayNamesColor(), setModifiedDocumentDisplayNamesColor(java.awt.Color)

setHighlightSecondaryLanguages

public void setHighlightSecondaryLanguages(boolean highlight)
Sets whether secondary languages are highlighted.

Parameters:
highlight - Whether to highlight secondary languages.
See Also:
getHighlightSecondaryLanguages()

setHyperlinkColor

public void setHyperlinkColor(java.awt.Color c)
Sets the color hyperlinks are displayed with in text editors.

Parameters:
c - The color to display. This cannot be null.
See Also:
getHyperlinkColor()

setHyperlinkModifierKey

public void setHyperlinkModifierKey(int key)
Sets the modifier key used to start hyperlink scanning in text editors.

Parameters:
key - The modifier key(s). If an invalid value is passed in, InputEvent.CTRL_DOWN_MASK is used.
See Also:
getHyperlinkModifierKey(), InputEvent

setHyperlinksEnabled

public void setHyperlinksEnabled(boolean enabled)
Sets whether hyperlinks are enabled in text editors.

Parameters:
enabled - Whether hyperlinks should be enabled.
See Also:
getHyperlinksEnabled()

setIgnoreBackupExtensions

public void setIgnoreBackupExtensions(boolean ignore)
Sets whether RText should ignore extensions like ".bak", ".old", and ".orig" when deciding how to open them.

Parameters:
ignore - Whether to ignore these extensions. #see #getIgnoreBackupExtensions()

setLineNumberColor

public void setLineNumberColor(java.awt.Color c)
Sets the color used for line numbers.

Parameters:
c - The new line number color. This cannot be null.
See Also:
getLineNumberColor()

setLineNumberFont

public void setLineNumberFont(java.awt.Font f)
Sets the font used for line numbers.

Parameters:
f - The new line number font. This cannot be null.
See Also:
getLineNumberFont()

setLineNumbersEnabled

public void setLineNumbersEnabled(boolean enabled)
Enables/disables the line numbers for the open documents.

Parameters:
enabled - Whether or not line numbers should be enabled.

setLineTerminator

public void setLineTerminator(java.lang.String terminator)
Sets the line terminator to use for new text files.

Parameters:
terminator - The line terminator to use.
See Also:
getLineTerminator()

setLineWrap

public void setLineWrap(boolean enabled)
Enables/disables word wrap of the open documents.

Parameters:
enabled - Whether or not word wrap should be enabled.

setMarginLineColor

public void setMarginLineColor(java.awt.Color color)
Sets the color used for the margin line in text areas. If this value is the same as the current value, nothing happens.

Parameters:
color - The new color to use.
See Also:
getMarginLineColor()

setMarginLineEnabled

public void setMarginLineEnabled(boolean enabled)
Sets whether or not the margin line is enabled in all text areas. If this value is the same as the current value, nothing happens.

Parameters:
enabled - Whether or not the margin line should be enabled.
See Also:
isMarginLineEnabled()

setMarginLinePosition

public void setMarginLinePosition(int position)
Sets the margin line position in all text areas. If this value is the same as the current value, nothing happens.

Parameters:
position - The new margin line position.
See Also:
getMarginLinePosition()

setMarkAllHighlightColor

public void setMarkAllHighlightColor(java.awt.Color color)
Sets the color selected for "mark all." This method fires a property change of type MARK_ALL_COLOR_PROPERTY.

Parameters:
color - The color to have selected.
See Also:
getMarkAllHighlightColor()

setMarkOccurrences

public void setMarkOccurrences(boolean markOccurrences)
Sets whether "mark occurrences" is enabled. This method fires a property change event of type MARK_OCCURRENCES_PROPERTY.

Parameters:
markOccurrences - Whether "mark occurrences" should be enabled.
See Also:
getMarkOccurrences()

setMarkOccurrencesColor

public void setMarkOccurrencesColor(java.awt.Color color)
Sets the color to use to "mark occurrences." This method fires a property change event of type MARK_OCCURRENCES_COLOR_PROPERTY.

Parameters:
color - The color.
See Also:
getMarkOccurrencesColor(), setMarkOccurrences(boolean)

setMatchBothBrackets

public void setMatchBothBrackets(boolean matchBoth)
Sets whether both brackets are highlighted when bracket matching.

Parameters:
matchBoth - Whether to highlight both brackets (as opposed to just the opposite bracket).
See Also:
getMatchBothBrackets()

setMatchedBracketBGColor

public void setMatchedBracketBGColor(java.awt.Color color)
Sets the background color to use in bracket matching.

Parameters:
color - The background color to use when highlighting a bracket.
See Also:
getMatchedBracketBGColor()

setMatchedBracketBorderColor

public void setMatchedBracketBorderColor(java.awt.Color color)
Sets the border color to use in bracket matching.

Parameters:
color - The border color to use when highlighting a bracket.
See Also:
getMatchedBracketBorderColor()

setMaxFileSize

public void setMaxFileSize(float size)
If file size checking is enabled, this is the maximum size a file can be before the user is prompted before opening it. This method fires a property change event of type MAX_FILE_SIZE_PROPERTY.

Parameters:
size - The new maximum size for a file before the user is prompted before opening it.
See Also:
getMaxFileSize(), setDoFileSizeCheck(boolean)

setModifiedDocumentDisplayNamesColor

public void setModifiedDocumentDisplayNamesColor(java.awt.Color color)
Sets the color used to highlight modified documents' display names.

Parameters:
color - The color to use.
Throws:
java.lang.NullPointerException - If color is null.
See Also:
getModifiedDocumentDisplayNamesColor(), highlightModifiedDocumentDisplayNames(), setHighlightModifiedDocumentDisplayNames(boolean)

setPrintFont

public void setPrintFont(java.awt.Font newPrintFont)
Sets the font to use when printing documents.

Parameters:
newPrintFont - The font to use when printing documents. If null, then the current RText font will be used.
See Also:
getPrintFont()

setRememberWhitespaceLines

public void setRememberWhitespaceLines(boolean remember)
Toggles whether whitespace lines should be remembered (vs. cleared out on Enter presses). This method fires a property change event of type REMEMBER_WS_LINES_PROPERTY.

Parameters:
remember - Whether to remember whitespace lines.
See Also:
getRememberWhitespaceLines()

setRoundedSelectionEdges

public void setRoundedSelectionEdges(boolean rounded)
Sets whether selection edges are rounded in text areas. This method fires a property change event of type ROUNDED_SELECTION_PROPERTY.

Parameters:
rounded - Whether selection edges are to be rounded.
See Also:
getRoundedSelectionEdges()

setSecondaryLanguageColor

public void setSecondaryLanguageColor(int index,
                                      java.awt.Color color)
Sets the color to use for a secondary language.

Parameters:
index - The index, 0-3.
color - The color. This should not be null.
See Also:
getSecondaryLanguageColor(int)

setSelectedIndex

public abstract void setSelectedIndex(int index)
Sets the currently active document.

Parameters:
index - The index of the document to make the active document. If this value is invalid, nothing happens.

setSelectedTextArea

public boolean setSelectedTextArea(RTextEditorPane textArea)
Sets the currently active text area.

Parameters:
textArea - The text area to make active.
Returns:
Whether the text area was made active. This will be false if the text area is not contained in this view.
See Also:
setSelectedIndex(int)

setSelectedTextColor

public void setSelectedTextColor(java.awt.Color color)
Sets the color to use for selected text in all text areas, if selected text painting is enabled.

Parameters:
color - The color to use for the selected text. If null is passed in, there is no change to the selected text color being used.
See Also:
getSelectedTextColor(), setUseSelectedTextColor(boolean), setSelectionColor(Color)

setSelectionColor

public void setSelectionColor(java.awt.Color color)
Sets the color of selections in all text areas in this tabbed pane.

Parameters:
color - The color to use for the selections. If null is passed in, there is no change to the selection color being used.
See Also:
getSelectionColor(), setSelectedTextColor(Color), setUseSelectedTextColor(boolean)

setShowEOLMarkers

public void setShowEOLMarkers(boolean show)
Toggles whether EOL markers are visible in the text areas.

Parameters:
show - Whether EOL markers should be shown.
See Also:
setWhitespaceVisible(boolean), getShowEOLMarkers()

setShowTabLines

public void setShowTabLines(boolean show)
Toggles whether tab lines are visible in editors.

Parameters:
show - Whether tab lines should be visible.
See Also:
getShowTabLines()

setSyntaxFilters

public void setSyntaxFilters(SyntaxFilters syntaxFilters)
Sets the file filters used when opening documents to decide how to syntax highlight documents. All currently open text files have their color schemes updated, if necessary.

Parameters:
syntaxFilters - The filter set to use. This cannot be null.
See Also:
getSyntaxFilters()

setSyntaxScheme

public void setSyntaxScheme(SyntaxScheme colorScheme)
Sets the syntax highlighting color scheme being used.

Parameters:
colorScheme - The new color scheme to use. If null, the default color scheme is set.

setTabsEmulated

public void setTabsEmulated(boolean areEmulated)
Changes whether or not tabs should be emulated with spaces (i.e., soft tabs).

Parameters:
areEmulated - Whether or not tabs should be emulated with spaces.

setTabLinesColor

public void setTabLinesColor(java.awt.Color color)
Sets the color to use for tab lines in editors.

Parameters:
color - The color to use.
See Also:
getTabLinesColor(), setShowTabLines(boolean)

setTabSize

public void setTabSize(int newSize)
Sets the tab size to be used on all documents.

Parameters:
newSize - The tab size to use.

setTextAreaFont

public void setTextAreaFont(java.awt.Font font,
                            boolean underline)
Sets the default font for text areas.

Parameters:
font - The font.
underline - Whether the font is underlined.
See Also:
getTextAreaFont(), getTextAreaUnderline()

setTextAreaForeground

public void setTextAreaForeground(java.awt.Color fg)
Sets the default foreground color for text areas.

Parameters:
fg - The new default foreground color.
See Also:
getTextAreaForeground()

setTextAreaOrientation

public void setTextAreaOrientation(java.awt.ComponentOrientation o)
Sets the component orientation of the text areas.

Parameters:
o - The new orientation.
See Also:
getTextAreaOrientation()

setTextMode

public void setTextMode(int mode)
Enables either insert mode or overwrite mode for the text documents.

Parameters:
mode - Either RTextEditorPane.INSERT_MODE or RTextEditorPane.OVERWRITE_MODE.
Throws:
java.lang.IllegalArgumentException - If mode is invalid.
See Also:
getTextMode()

setUseSelectedTextColor

public void setUseSelectedTextColor(boolean use)
Sets whether text areas should honor their "selected text color", as opposed to just rendering token styles even for selected tokens.

Parameters:
use - Whether to use the selected text color.
See Also:
getUseSelectedTextColor(), setSelectedTextColor(Color)

setWhitespaceVisible

public void setWhitespaceVisible(boolean visible)
Sets whether whitespace is visible in all open text areas.

This method will not change anything if the value of visible is already the whitespace-visibility state.

Parameters:
visible - Whether whitespace should be visible.

setWriteBOMInUtf8Files

public void setWriteBOMInUtf8Files(boolean write)
Sets whether BOM's should be written for UTF-8 files.

Parameters:
write - Whether to write BOM's for UTF-8 files.
See Also:
getWriteBOMInUtf8Files()

updateLookAndFeel

public void updateLookAndFeel()
Updates the look and feel of objects that the parent RText can't get to. This should be called whenever the look and feel is changed while RText is running.


updateStatusBar

protected void updateStatusBar()
Updates the status bar's read-only indicator and line/column indicator. This should be called whenever the currently active document changes.