|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.fife.rtext.AbstractMainView
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.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| 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 |
| 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.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. |
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." |
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. |
abstract java.awt.Component |
getSelectedComponent()
Returns the currently active component. |
abstract int |
getSelectedIndex()
Returns the currently selected document's index. |
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.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 |
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 |
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 |
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 |
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 |
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 |
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 |
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. |
abstract void |
setSelectedIndex(int index)
Sets the currently active document. |
boolean |
setSelectedTextArea(RTextEditorPane textArea)
Sets the currently active text area. |
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 |
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, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, 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, 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, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
public static final int DOCUMENT_SELECT_TOP
public static final int DOCUMENT_SELECT_LEFT
public static final int DOCUMENT_SELECT_BOTTOM
public static final int DOCUMENT_SELECT_RIGHT
public static final java.lang.String AUTO_INSERT_CLOSING_CURLYS
public static final java.lang.String CURRENT_DOCUMENT_PROPERTY
public static final java.lang.String DEFAULT_ENCODING_PROPERTY
public static final java.lang.String FILE_SIZE_CHECK_PROPERTY
public static final java.lang.String FRACTIONAL_METRICS_PROPERTY
public static final java.lang.String MARK_ALL_COLOR_PROPERTY
public static final java.lang.String MARK_OCCURRENCES_COLOR_PROPERTY
public static final java.lang.String MARK_OCCURRENCES_PROPERTY
public static final java.lang.String MAX_FILE_SIZE_PROPERTY
public static final java.lang.String REMEMBER_WS_LINES_PROPERTY
public static final java.lang.String ROUNDED_SELECTION_PROPERTY
public static final java.lang.String SMOOTH_TEXT_PROPERTY
public static final java.lang.String TEXT_AREA_ADDED_PROPERTY
public static final java.lang.String TEXT_AREA_REMOVED_PROPERTY
public FindDialog findDialog
public ReplaceDialog replaceDialog
public java.util.Vector searchStrings
public boolean searchingForward
public boolean searchMatchCase
public boolean searchWholeWord
public boolean searchRegExpression
public boolean searchMarkAll
public FindInFilesDialog findInFilesDialog
public ReplaceInFilesDialog replaceInFilesDialog
public GoToDialog goToDialog
protected RText owner
| Constructor Detail |
public AbstractMainView()
You should call initialize(org.fife.rtext.RText, java.lang.String[], org.fife.rtext.RTextPreferences) right after this.
| Method Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void addCurrentTextAreaListener(CurrentTextAreaListener l)
l - The listener to add.removeCurrentTextAreaListener(org.fife.rtext.CurrentTextAreaListener)public void addNewEmptyUntitledFile()
protected abstract void addTextAreaImpl(java.lang.String title,
java.awt.Component component,
java.lang.String fileFullPath)
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.public void applyComponentOrientation(java.awt.ComponentOrientation o)
o - The new component orientation.public boolean areTabsEmulated()
true iff tabs are emulated with spaces.public void checkFilesForOutsideModification()
public boolean closeAllDocuments()
true if all active documents were closed, and
false if they weren't (i.e., the user hit cancel).public boolean closeAllDocumentsExcept(int except)
true if the documents were all closed, and
false if they weren't (i.e., the user hit cancel).public final boolean closeCurrentDocument()
false if an
IO error occurs saving the file, if the user chooses to do so.protected abstract boolean closeCurrentDocumentImpl()
public void convertOpenFilesSpacesToTabs()
convertOpenFilesTabsToSpaces()public void convertOpenFilesTabsToSpaces()
convertOpenFilesSpacesToTabs()public void copyData(AbstractMainView fromPanel)
protected ErrorStrip createErrorStrip(RTextEditorPane textArea)
public void dispose()
public void findInFilesFileSelected(FindInFilesEvent e)
findInFilesFileSelected in interface FindInFilesListenere - The event received from the FindInFilesDialog.
protected void fireCurrentTextAreaEvent(int type,
java.lang.Object oldValue,
java.lang.Object newValue)
CurrentTextAreaListeners of a
change in the current text area.
type - The type of event to fire.oldValue - The old value.newValue - The new value.public boolean getAutoInsertClosingCurlys()
setAutoInsertClosingCurlys(boolean)public float getBackgroundImageAlpha()
setBackgroundImageAlpha(float)public java.lang.String getBackgroundImageFileName()
null if the current background is a
color.setBackgroundImageFileName(java.lang.String)public java.lang.Object getBackgroundObject()
Object representing the background for all
documents in this tabbed pane; either a java.awt.Color or a
java.lang.String.
public boolean getBookmarksEnabled()
setBookmarksEnabled(boolean)public int getCaretBlinkRate()
setCaretBlinkRate(int)public java.awt.Color getCaretColor()
java.awt.Color being used for all carets.public int getCaretStyle(int mode)
mode - Either RTextArea.INSERT_MODE or
RTextArea.OVERWRITE_MODE.
ConfigurableCaret.VERTICAL_LINE_STYLE.setCaretStyle(int, int),
ConfigurableCaretpublic java.awt.Color getCurrentLineHighlightColor()
isCurrentLineHighlightEnabled(),
setCurrentLineHighlightEnabled(boolean),
setCurrentLineHighlightColor(java.awt.Color)public RTextEditorPane getCurrentTextArea()
public java.lang.String getDefaultEncoding()
setDefaultEncoding(String)public boolean getDoFileSizeCheck()
setDoFileSizeCheck(boolean)public abstract java.lang.String getDocumentDisplayNameAt(int index)
index - The index at which to find the name. If the index is
invalid, null is returned.
public abstract int getDocumentSelectionPlacement()
public int getFileIndex(java.lang.String fileFullPath)
-1 if the file
is not being edited.public boolean getGuessFileContentType()
#!" in their first line.
setGuessFileContentType(boolean)public java.awt.Color getGutterBorderColor()
setGutterBorderColor(Color)public java.awt.Color getHyperlinkColor()
setHyperlinkColor(Color)public int getHyperlinkModifierKey()
setHyperlinkModifierKey(int),
InputEventpublic boolean getHyperlinksEnabled()
setHyperlinksEnabled(boolean)protected javax.swing.Icon getIconFor(RTextScrollPane scrollPane)
scrollPane - The scroll pane.
public boolean getIgnoreBackupExtensions()
setIgnoreBackupExtensions(boolean)public java.awt.Color getLineNumberColor()
setLineNumberColor(Color)public java.awt.Font getLineNumberFont()
setLineNumberFont(Font)public boolean getLineNumbersEnabled()
public java.lang.String getLineTerminator()
setLineTerminator(String)public boolean getLineWrap()
public java.awt.Color getMarginLineColor()
setMarginLineColor(java.awt.Color)public int getMarginLinePosition()
setMarginLinePosition(int)public java.awt.Color getMarkAllHighlightColor()
setMarkAllHighlightColor(java.awt.Color)public boolean getMarkOccurrences()
setMarkOccurrences(boolean)public java.awt.Color getMarkOccurrencesColor()
setMarkOccurrencesColor(Color),
getMarkOccurrences()public java.awt.Color getMatchedBracketBGColor()
setMatchedBracketBGColor(java.awt.Color)public java.awt.Color getMatchedBracketBorderColor()
setMatchedBracketBorderColor(java.awt.Color)public float getMaxFileSize()
setMaxFileSize(float),
getDoFileSizeCheck()public java.awt.Color getModifiedDocumentDisplayNamesColor()
setModifiedDocumentDisplayNamesColor(java.awt.Color),
highlightModifiedDocumentDisplayNames(),
setHighlightModifiedDocumentDisplayNames(boolean)public abstract int getNumDocuments()
public java.io.File[] getOpenFiles()
null is
returned.public java.awt.Font getPrintFont()
java.awt.Font currently used to print documents.
null is
returned, that means the current RText font is being used to
print documents.setPrintFont(java.awt.Font)public boolean getRememberWhitespaceLines()
setRememberWhitespaceLines(boolean)public boolean getRoundedSelectionEdges()
setRoundedSelectionEdges(boolean)public RTextEditorPane getRTextEditorPaneAt(int index)
org.fife.rtext.RTextEditorPane on the
specified tab. This is a convenience method for
(RTextEditorPane)getRTextScrollPaneAt(i).textArea.
index - The tab for which you want to get the
RTextEditorPane.
RTextEditorPane.public abstract RTextScrollPane getRTextScrollPaneAt(int index)
org.fife.rtext.RTextScrollPane at the given
index.
index - The tab for which you want to get the
org.fife.rtext.RTextScrollPane.
public abstract java.awt.Component getSelectedComponent()
public abstract int getSelectedIndex()
public java.awt.Color getSelectionColor()
java.awt.Color being used for all selections in
all text areas.public boolean getShowEOLMarkers()
setShowEOLMarkers(boolean),
isWhitespaceVisible()public boolean getShowTabLines()
setShowTabLines(boolean),
getTabLinesColor()public SpellingSupport getSpellingSupport()
public SyntaxFilters getSyntaxFilters()
public java.awt.Color getTabLinesColor()
setTabLinesColor(Color),
getShowTabLines()public int getTabSize()
public java.awt.Font getTextAreaFont()
getTextAreaUnderline(),
setTextAreaFont(Font, boolean)public java.awt.Color getTextAreaForeground()
setTextAreaForeground(Color)public java.awt.ComponentOrientation getTextAreaOrientation()
setTextAreaOrientation(ComponentOrientation)public boolean getTextAreaUnderline()
getTextAreaFont(),
setTextAreaFont(Font, boolean)public int getTextMode()
RTextEditorPane.INSERT_MODE
or RTextEditorPane.OVERWRITE_MODE.setTextMode(int)public boolean getWriteBOMInUtf8Files()
setWriteBOMInUtf8Files(boolean)public boolean highlightModifiedDocumentDisplayNames()
setHighlightModifiedDocumentDisplayNames(boolean),
getModifiedDocumentDisplayNamesColor(),
setModifiedDocumentDisplayNamesColor(java.awt.Color)public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
hyperlinkUpdate in interface javax.swing.event.HyperlinkListenere - The hyperlink event.
protected void initialize(RText owner,
java.lang.String[] filesToOpen,
RTextPreferences prefs)
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.public boolean isAntiAliasEnabled()
isFractionalFontMetricsEnabled(),
setAntiAliasEnabled(boolean)public boolean isBracketMatchingEnabled()
true iff bracket matching is enabled.setBracketMatchingEnabled(boolean)public boolean isCurrentLineHighlightEnabled()
setCurrentLineHighlightEnabled(boolean),
getCurrentLineHighlightColor(),
setCurrentLineHighlightColor(java.awt.Color)public boolean isFractionalFontMetricsEnabled()
isAntiAliasEnabled(),
setFractionalFontMetricsEnabled(boolean)public boolean isMarginLineEnabled()
setMarginLineEnabled(boolean)public boolean isWhitespaceVisible()
setWhitespaceVisible(boolean)public void loadMacro(java.io.File file)
RTextEditorPanes, as well as all editor panes opened
afterward, until a new macro is loaded.
file - The file containing the macro to load. If this file does
not exist or is otherwise invalid, no macro is loaded.public void moveToTopOfCurrentDocument()
public boolean openFile(FileLocation loc,
java.lang.String charSet,
boolean reuse)
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).
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).
InvalidCharSetException - If the specified character set is
invalid.
public boolean openFile(java.lang.String fileNameAndPath,
java.lang.String charSet)
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.
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).
InvalidCharSetException - If the specified character set is
invalid.
public boolean openFile(java.lang.String fileNameAndPath,
java.lang.String charSet,
boolean reuse)
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).
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).
InvalidCharSetException - If the specified character set is
invalid.protected int promptToSaveBeforeClosingIfDirty()
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.public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpublic abstract void refreshDisplayNames()
public void renumberDisplayNames()
protected abstract void removeComponentAt(int index)
index - The index of the component to remove.public void removeCurrentTextAreaListener(CurrentTextAreaListener l)
l - The listener to remove.addCurrentTextAreaListener(org.fife.rtext.CurrentTextAreaListener)public boolean saveAllFiles()
false if an IO error occurs, or if a file has
unsaved changes and the user selects "Cancel" when prompted
to save them.saveCurrentFile(),
saveCurrentFileAs(),
saveCurrentFileAs(FileLocation)public boolean saveCurrentFile()
If an IO error occurs, the user is notified.
true if the save is successful, false
if the user cancels the save operation or an IO error occurs.saveAllFiles(),
saveCurrentFileAs(),
saveCurrentFileAs(FileLocation)public boolean saveCurrentFileAs()
true if the save is successful, false
if the user cancels the save operation or an IO error occurs.saveCurrentFileAs(FileLocation),
saveCurrentFile(),
saveAllFiles()public boolean saveCurrentFileAs(FileLocation loc)
loc - The location to save the file to.
true if the save is successful, false
if an IO error occurs.public void setAntiAliasEnabled(boolean enabled)
SMOOTH_TEXT_PROPERTY.
enabled - Whether anti-aliasing should be enabled.isAntiAliasEnabled()public void setAutoInsertClosingCurlys(boolean autoInsert)
AUTO_INSERT_CLOSING_CURLYS.
autoInsert - Whether to auto-insert curlys.getAutoInsertClosingCurlys()public void setBackgroundImageAlpha(float alpha)
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.getBackgroundImageAlpha()public void setBackgroundImageFileName(java.lang.String path)
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.
path - The path to the file containing the current background
image, or null if the current background is an
image.getBackgroundImageFileName()public void setBackgroundObject(java.lang.Object newBackground)
Object (either a
java.awt.Color or a java.awt.Image).
newBackground - The java.awt.Color or
java.awt.Image object.public void setBookmarksEnabled(boolean enabled)
enabled - Whether bookmarks are enabled.getBookmarksEnabled()public void setBracketMatchingEnabled(boolean enabled)
enabled - Whether or not bracket matching should be enabled.isBracketMatchingEnabled()public void setCaretBlinkRate(int blinkRate)
blinkRate - The new blink rate. If this value is invalid (< 0),
nothing happens.getCaretBlinkRate()public void setCaretColor(java.awt.Color color)
color - The color to use for the caret. If null is
passed in, there is no change to the caret color being used.
public void setCaretStyle(int mode,
int style)
mode - Either RTextArea.INSERT_MODE or
RTextArea.OVERWRITE_MODE.style - The style for the specified caret, such as
ConfigurableCaret.VERTICAL_LINE_STYLE.getCaretStyle(int)public void setCurrentLineHighlightColor(java.awt.Color color)
color - The color to use to highlight the current line.
java.lang.NullPointerException - if color is null.isCurrentLineHighlightEnabled(),
setCurrentLineHighlightEnabled(boolean),
getCurrentLineHighlightColor()public void setCurrentLineHighlightEnabled(boolean enabled)
enabled - Whether or not to highlight the current line.isCurrentLineHighlightEnabled(),
getCurrentLineHighlightColor(),
setCurrentLineHighlightColor(java.awt.Color)protected void setCurrentTextArea(RTextEditorPane textArea)
fireCurrentTextAreaEvent(int, Object, Object) to notify any
registered listeners of the change.
textArea - The new text area.getCurrentTextArea()public void setDefaultEncoding(java.lang.String encoding)
DEFAULT_ENCODING_PROPERTY.
encoding - The new default encoding. A value of null
means to use the system default encoding.getDefaultEncoding()
public abstract void setDocumentDisplayNameAt(int index,
java.lang.String displayName)
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.getDocumentDisplayNameAt(int)public abstract void setDocumentSelectionPlacement(int location)
location - The location to use; (TOP,
LEFT, BOTTOM, or RIGHT.
If this value is invalid, nothing happens.public void setDoFileSizeCheck(boolean doCheck)
FILE_SIZE_CHECK_PROPERTY.
doCheck - Whether to check a file's size.getDoFileSizeCheck()public void setFractionalFontMetricsEnabled(boolean enabled)
FRACTIONAL_METRICS_PROPERTY.
enabled - Whether fractional font metrics should be enabled.isFractionalFontMetricsEnabled()public void setGuessFileContentType(boolean guess)
#!" in their first line.
guess - Whether to guess the content type of files with no
extension.getGuessFileContentType()public void setGutterBorderColor(java.awt.Color c)
c - The new gutter border color. This cannot be null.getGutterBorderColor()public void setHighlightModifiedDocumentDisplayNames(boolean highlight)
highlight - Whether or not to highlight modified documents' display
names.highlightModifiedDocumentDisplayNames(),
getModifiedDocumentDisplayNamesColor(),
setModifiedDocumentDisplayNamesColor(java.awt.Color)public void setHyperlinkColor(java.awt.Color c)
c - The color to display. This cannot be null.getHyperlinkColor()public void setHyperlinkModifierKey(int key)
key - The modifier key(s). If an invalid value is passed in,
InputEvent.CTRL_DOWN_MASK is used.getHyperlinkModifierKey(),
InputEventpublic void setHyperlinksEnabled(boolean enabled)
enabled - Whether hyperlinks should be enabled.getHyperlinksEnabled()public void setIgnoreBackupExtensions(boolean ignore)
ignore - Whether to ignore these extensions.
#see #getIgnoreBackupExtensions()public void setLineNumberColor(java.awt.Color c)
c - The new line number color. This cannot be null.getLineNumberColor()public void setLineNumberFont(java.awt.Font f)
f - The new line number font. This cannot be null.getLineNumberFont()public void setLineNumbersEnabled(boolean enabled)
enabled - Whether or not line numbers should be enabled.public void setLineTerminator(java.lang.String terminator)
terminator - The line terminator to use.getLineTerminator()public void setLineWrap(boolean enabled)
enabled - Whether or not word wrap should be enabled.public void setMarginLineColor(java.awt.Color color)
color - The new color to use.getMarginLineColor()public void setMarginLineEnabled(boolean enabled)
enabled - Whether or not the margin line should be enabled.isMarginLineEnabled()public void setMarginLinePosition(int position)
position - The new margin line position.getMarginLinePosition()public void setMarkAllHighlightColor(java.awt.Color color)
MARK_ALL_COLOR_PROPERTY.
color - The color to have selected.getMarkAllHighlightColor()public void setMarkOccurrences(boolean markOccurrences)
MARK_OCCURRENCES_PROPERTY.
markOccurrences - Whether "mark occurrences" should be enabled.getMarkOccurrences()public void setMarkOccurrencesColor(java.awt.Color color)
MARK_OCCURRENCES_COLOR_PROPERTY.
color - The color.getMarkOccurrencesColor(),
setMarkOccurrences(boolean)public void setMatchedBracketBGColor(java.awt.Color color)
color - The background color to use when highlighting a bracket.getMatchedBracketBGColor()public void setMatchedBracketBorderColor(java.awt.Color color)
color - The border color to use when highlighting a bracket.getMatchedBracketBorderColor()public void setMaxFileSize(float size)
MAX_FILE_SIZE_PROPERTY.
size - The new maximum size for a file before the user is
prompted before opening it.getMaxFileSize(),
setDoFileSizeCheck(boolean)public void setModifiedDocumentDisplayNamesColor(java.awt.Color color)
color - The color to use.
java.lang.NullPointerException - If color is null.getModifiedDocumentDisplayNamesColor(),
highlightModifiedDocumentDisplayNames(),
setHighlightModifiedDocumentDisplayNames(boolean)public void setPrintFont(java.awt.Font newPrintFont)
newPrintFont - The font to use when printing documents. If
null, then the current RText font will be used.getPrintFont()public void setRememberWhitespaceLines(boolean remember)
REMEMBER_WS_LINES_PROPERTY.
remember - Whether to remember whitespace lines.getRememberWhitespaceLines()public void setRoundedSelectionEdges(boolean rounded)
ROUNDED_SELECTION_PROPERTY.
rounded - Whether selection edges are to be rounded.getRoundedSelectionEdges()public abstract void setSelectedIndex(int index)
index - The index of the document to make the active document.
If this value is invalid, nothing happens.public boolean setSelectedTextArea(RTextEditorPane textArea)
textArea - The text area to make active.
false if the text area is not contained in this
view.setSelectedIndex(int)public void setSelectionColor(java.awt.Color color)
color - The color to use for the selections. If null
is passed in, there is no change to the selection color being
used.public void setShowEOLMarkers(boolean show)
show - Whether EOL markers should be shown.setWhitespaceVisible(boolean),
getShowEOLMarkers()public void setShowTabLines(boolean show)
show - Whether tab lines should be visible.getShowTabLines()public void setSyntaxFilters(SyntaxFilters syntaxFilters)
syntaxFilters - The filter set to use.getSyntaxFilters()public void setSyntaxScheme(SyntaxScheme colorScheme)
colorScheme - The new color scheme to use. If null,
the default color scheme is set.public void setTabsEmulated(boolean areEmulated)
areEmulated - Whether or not tabs should be emulated with spaces.public void setTabLinesColor(java.awt.Color color)
color - The color to use.getTabLinesColor(),
setShowTabLines(boolean)public void setTabSize(int newSize)
newSize - The tab size to use.
public void setTextAreaFont(java.awt.Font font,
boolean underline)
font - The font.underline - Whether the font is underlined.getTextAreaFont(),
getTextAreaUnderline()public void setTextAreaForeground(java.awt.Color fg)
fg - The new default foreground color.getTextAreaForeground()public void setTextAreaOrientation(java.awt.ComponentOrientation o)
o - The new orientation.getTextAreaOrientation()public void setTextMode(int mode)
mode - Either RTextEditorPane.INSERT_MODE or
RTextEditorPane.OVERWRITE_MODE.
java.lang.IllegalArgumentException - If mode is invalid.getTextMode()public void setWhitespaceVisible(boolean visible)
This method will not change anything if the value of
visible is already the whitespace-visibility state.
visible - Whether whitespace should be visible.public void setWriteBOMInUtf8Files(boolean write)
write - Whether to write BOM's for UTF-8 files.getWriteBOMInUtf8Files()public void updateLookAndFeel()
RText
can't get to. This should be called whenever the look and feel is
changed while RText is running.
protected void updateStatusBar()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||