org.fife.rtext
Class RText

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.fife.ui.app.AbstractGUIApplication
                          extended by org.fife.ui.app.AbstractPluggableGUIApplication
                              extended by org.fife.rtext.RText
All Implemented Interfaces:
com.apple.osxadapter.NativeMacApp, 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.CaretListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants, RTextActionInfo, GUIApplication, GUIApplicationConstants, DockableWindowConstants, FileChooserOwner

public class RText
extends AbstractPluggableGUIApplication
implements java.awt.event.ActionListener, javax.swing.event.CaretListener, java.beans.PropertyChangeListener, RTextActionInfo, FileChooserOwner

An instance of the RText text editor. RText is a programmer's text editor with the following features:

At the heart of this program is RSyntaxTextArea, a fully-featured, syntax highlighting text component. That's where most of the meat is. All text areas are contained in a subclass of AbstractMainView, which keeps the state of all of the text areas in synch (fonts used, colors, etc.). This class (RText) contains an instance of a subclass of AbstractMainView (which contains all of the text areas) as well as the menu, source browser, and status bar.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
 
Nested classes/interfaces inherited from interface org.fife.ui.app.GUIApplication
GUIApplication.AboutAction, GUIApplication.ExitAction, GUIApplication.HelpAction, GUIApplication.ToggleStatusBarAction, GUIApplication.ToggleToolBarAction
 
Field Summary
static java.lang.String ICON_STYLE_PROPERTY
           
static java.lang.String MAIN_VIEW_STYLE_PROPERTY
           
static int MDI_VIEW
           
 OptionsDialog optionsDialog
           
static java.lang.String PROPERTY_PRINT_START_TIMES
          System property that, if set, causes RText to print timing information while it is starting up.
static int SPLIT_PANE_VIEW
           
static int TABBED_VIEW
           
static java.lang.String VERSION_STRING
           
 
Fields inherited from class org.fife.ui.app.AbstractGUIApplication
ABOUT_ACTION_KEY, actualContentPane, EXIT_ACTION_KEY, HELP_ACTION_KEY, mainContentPanel, STATUS_BAR_PROPERTY, STATUS_BAR_VISIBLE_PROPERTY, TOOL_BAR_PROPERTY, TOOL_BAR_VISIBLE_PROPERTY
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.fife.rtext.RTextActionInfo
actionNames, alt, CLOSE_ACTION, CLOSE_ALL_ACTION, COPY_AS_RTF_ACTION, DEC_FONT_SIZES_ACTION, defaultActionAccelerators, defaultAlt, defaultModifier, defaultShift, FILE_PROPERTIES_ACTION, FIND_ACTION, FIND_IN_FILES_ACTION, FIND_NEXT_ACTION, GOTO_ACTION, HOME_PAGE_ACTION, INC_FONT_SIZES_ACTION, LINE_NUMBER_ACTION, LTR_ACTION, MOVE_FOCUS_DOWN_ACTION, MOVE_FOCUS_LEFT_ACTION, MOVE_FOCUS_RIGHT_ACTION, MOVE_FOCUS_UP_ACTION, NEW_ACTION, NEXT_DOCUMENT_ACTION, OPEN_ACTION, OPEN_NEWWIN_ACTION, OPEN_REMOTE_ACTION, OPTIONS_ACTION, PREVIOUS_DOCUMENT_ACTION, PRINT_ACTION, PRINT_PREVIEW_ACTION, REPLACE_ACTION, REPLACE_ALL_ACTION, REPLACE_IN_FILES_ACTION, REPLACE_NEXT_ACTION, RTL_ACTION, SAVE_ACTION, SAVE_ALL_ACTION, SAVE_AS_ACTION, SAVE_AS_REMOTE_ACTION, SAVE_WEBPAGE_ACTION, shift, STATUS_BAR_ACTION, TIME_DATE_ACTION, TOOL_BAR_ACTION, UPDATES_ACTION, VIEW_SPLIT_HORIZ_ACTION, VIEW_SPLIT_NONE_ACTION, VIEW_SPLIT_VERT_ACTION
 
Fields inherited from interface org.fife.ui.app.GUIApplicationConstants
OS_LINUX, OS_MAC_OSX, OS_OTHER, OS_WINDOWS
 
Fields inherited from interface org.fife.ui.dockablewindows.DockableWindowConstants
BOTTOM, FLOATING, LEFT, RIGHT, TOP
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RText(java.lang.String[] filesToOpen)
          Creates an instance of the RText editor.
RText(java.lang.String[] filesToOpen, RTextPreferences preferences)
          Creates an instance of the RText editor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addDockableWindow(DockableWindow wind)
           
 boolean areTabsEmulated()
          Returns whether or not tabs are emulated with spaces (i.e.
 void caretUpdate(javax.swing.event.CaretEvent e)
          Called when cursor in text editor changes position.
 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.
protected  javax.swing.JDialog createAboutDialog()
          Returns the About dialog for this application.
protected  void createActions(GUIApplicationPreferences prefs)
          Creates the array of actions used by this RText.
protected  javax.swing.JMenuBar createMenuBar(GUIApplicationPreferences prefs)
          Creates and returns the menu bar used in this application.
protected  SplashScreen createSplashScreen()
          Returns the splash screen to display while this GUI application is loading.
protected  StatusBar createStatusBar(GUIApplicationPreferences prefs)
          Returns the status bar to be used by this application.
protected  CustomizableToolBar createToolBar(GUIApplicationPreferences prefs)
          Creates and returns the toolbar to be used by this application.
 void displayException(java.awt.Dialog owner, java.lang.Throwable t, java.lang.String desc)
          Overridden so we can syntax highlight the Java exception displayed.
 void displayException(java.awt.Frame owner, java.lang.Throwable t, java.lang.String desc)
          Overridden so we can syntax highlight the Java exception displayed.
 void doExit()
          Called when the user attempts to close the application, whether from an "Exit" menu item, closing the main application window, or any other means.
 void focusDockableWindowGroup(int group)
          Focuses the specified dockable window group.
 org.fife.rsta.ui.CollapsibleSectionPanel getCollapsibleSectionPanel()
          Returns the application's "collapsible section panel;" that is, the panel containing the main view and possible find/replace tool bars.
 RTextFileChooser getFileChooser()
          Returns the file chooser being used by this RText instance.
 int getFocusedDockableWindowGroup()
          Returns the focused dockable window group.
 HelpDialog getHelpDialog()
          Returns the Help dialog for RText.
 java.lang.String getHostName()
          Returns the name of the local host.
 IconGroup getIconGroup()
          Returns the icon group being used for icons for actions.
 java.util.Map<java.lang.String,IconGroup> getIconGroupMap()
          Returns the icon groups available to RText.
 AbstractMainView getMainView()
          Returns the actual main view.
 int getMainViewStyle()
          Returns the main view style.
 java.lang.String getNewFileName()
          Returns the filename used for newly created, empty text files.
 OptionsDialog getOptionsDialog()
          Returns this application's Options dialog.
protected  java.lang.String getPreferencesClassName()
          Returns the name of the preferences class for this application.
 RemoteFileChooser getRemoteFileChooser()
          Returns the file chooser used to select remote files.
 java.lang.String getResourceBundleClassName()
          Returns the fully-qualified class name of the resource bundle for this application.
 SearchToolBar getSearchToolBar()
          Returns the QuickSearch toolbar.
 float getSearchWindowOpacity()
          Returns the opacity with which to render unfocused child windows, if this option is enabled.
 int getSearchWindowOpacityRule()
          Returns the rule used for making certain child windows translucent.
 boolean getShowHostName()
          Returns whether the hostname should be shown in the title of the main RText window.
 SyntaxScheme getSyntaxScheme()
          Returns the syntax highlighting color scheme being used.
 int getTabSize()
          Returns the tab size (in spaces) currently being used.
 java.lang.String getTitle()
          Returns the title of this window, less any "header" information (e.g. without the leading "rtext - ").
 java.lang.String getVersionString()
          Returns the version string for this application.
 java.lang.String getWorkingDirectory()
          Returns the "working directory;" that is, the directory that new, empty files are created in.
protected  void handleInstallPlugin(Plugin plugin)
          Does the dirty work of actually installing a plugin.
 boolean hasDockableWindowGroup(int group)
          Returns whether dockable windows are at the specified location.
 boolean isSearchToolBarVisible()
          Returns whether or not the QuickSearch toolbar is visible.
 boolean isSearchWindowOpacityEnabled()
          Returns whether search window opacity is enabled.
 boolean isSpellingWindowVisible()
          Returns whether the spelling window is visible.
static void main(java.lang.String[] args)
          Program entry point.
 void menuItemAcceleratorWorkaround()
          Thanks to Java Bug ID 5026829, JMenuItems (among other Swing components) don't update their accelerators, etc. when the properties on which they were created update them.
 void openFile(java.lang.String filename)
          Gets called from the OSXAdapter; this method is needed by the Mac OS X JVM.
 void openFiles(java.lang.String[] filesToOpen)
          Opens the specified files.
protected  void preDisplayInit(GUIApplicationPreferences prefs, SplashScreen splashScreen)
          This is called in the GUI application's constructor.
 void preferences()
          1.5.2004/pwy: The following two functions are called from the OSXAdapter and provide the hooks for the functions from the standard Apple application menu.
protected  void preMenuBarInit(GUIApplicationPreferences prefs, SplashScreen splashScreen)
          This is called in the GUI application's constructor.
protected  void preStatusBarInit(GUIApplicationPreferences prefs, SplashScreen splashScreen)
          This is called in the GUI application's constructor.
protected  void preToolBarInit(GUIApplicationPreferences prefs, SplashScreen splashScreen)
          This is called in the GUI application's constructor.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Called whenever a property changes for a component we are registered as listening to.
 void registerChildWindowListeners(java.awt.Window w)
           
 void removeDockableWindow(DockableWindow wind)
           
 void restoreDefaultAccelerators()
          Makes all actions use default accelerators.
 void saveRTextPreferences()
          Attempts to write this RText instance's properties to wherever the OS writes Java Preferences stuff.
 void setIconGroupByName(java.lang.String name)
          Changes the style of icons used by rtext.
 void setMainViewStyle(int viewStyle)
          Sets the main view style.
 void setMessages(java.lang.String fileFullPath, java.lang.String statusMessage)
          This method changes both the active file name in the title bar, and the status message in the status bar.
 void setRowColumnIndicatorVisible(boolean isVisible)
          Enables or disables the row/column indicator in the status bar.
 void setSearchWindowOpacity(float opacity)
          Sets the opacity with which to render unfocused child windows, if this option is enabled.
 void setSearchWindowOpacityEnabled(boolean enabled)
          Toggles whether search window opacity is enabled.
 void setSearchWindowOpacityRule(int rule)
          Toggles whether certain child windows should be made translucent.
 void setShowHostName(boolean show)
          Sets whether the hostname should be shown in the title of the main RText window.
 void setSpellingWindowVisible(boolean visible)
          Toggles whether the spelling error window is visible.
 void setStatusBarReadOnlyIndicatorEnabled(boolean enabled)
          Sets whether the read-only indicator in the status bar is enabled.
 void setSyntaxScheme(SyntaxScheme colorScheme)
          Sets the syntax highlighting color scheme being used.
 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 setTitle(java.lang.String title)
          Sets the title of the application window.
 void setWorkingDirectory(java.lang.String directory)
          Sets the "working directory;" that is, the directory in which new, empty files are placed.
 void updateLookAndFeel(javax.swing.LookAndFeel lnf)
          Updates the look and feel for all components and windows in this RText instance.
 
Methods inherited from class org.fife.ui.app.AbstractPluggableGUIApplication
addPlugin, getPlugins, getSplitPaneDividerLocation, isPluginLoadingComplete, removePlugin, setContentPane, setSplitPaneDividerLocation
 
Methods inherited from class org.fife.ui.app.AbstractGUIApplication
about, addAction, addToolBar, displayException, displayException, displayException, displayException, get3rdPartyLookAndFeelInfo, getAboutDialog, getAction, getActionKeys, getActions, getContentPane, getInstallLocation, getLanguage, getLocationOfJar, getLookAndFeelManager, getOS, getResourceBundle, getStatusBar, getStatusBarVisible, getString, getString, getString, getString, getString, getToolBar, getToolBarVisible, isMaximized, loadActionShortcuts, loadPreferences, processWindowEvent, quit, saveActionShortcuts, setLanguage, setLookAndFeelManager, setStatusBar, setStatusBarVisible, setToolBar, setToolBarVisible
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.fife.ui.app.GUIApplication
getIconImage, getJMenuBar, pack, setJMenuBar
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

TABBED_VIEW

public static final int TABBED_VIEW
See Also:
Constant Field Values

SPLIT_PANE_VIEW

public static final int SPLIT_PANE_VIEW
See Also:
Constant Field Values

MDI_VIEW

public static final int MDI_VIEW
See Also:
Constant Field Values

ICON_STYLE_PROPERTY

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

MAIN_VIEW_STYLE_PROPERTY

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

optionsDialog

public OptionsDialog optionsDialog

PROPERTY_PRINT_START_TIMES

public static final java.lang.String PROPERTY_PRINT_START_TIMES
System property that, if set, causes RText to print timing information while it is starting up.

See Also:
Constant Field Values

VERSION_STRING

public static final java.lang.String VERSION_STRING
See Also:
Constant Field Values
Constructor Detail

RText

public RText(java.lang.String[] filesToOpen)
Creates an instance of the RText editor.

Parameters:
filesToOpen - Array of java.lang.Strings containing the files we want to open initially. This can be null if no files are to be opened.

RText

public RText(java.lang.String[] filesToOpen,
             RTextPreferences preferences)
Creates an instance of the RText editor.

Parameters:
filesToOpen - Array of java.lang.Strings containing the files we want to open initially. This can be null if no files are to be opened.
preferences - The preferences with which to initialize this RText.
Method Detail

actionPerformed

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

addDockableWindow

public void addDockableWindow(DockableWindow wind)

areTabsEmulated

public boolean areTabsEmulated()
Returns whether or not tabs are emulated with spaces (i.e. "soft" tabs). This simply calls mainView.areTabsEmulated.

Returns:
true if tabs are emulated with spaces; false if they aren't.

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent e)
Called when cursor in text editor changes position.

Specified by:
caretUpdate in interface javax.swing.event.CaretListener
Parameters:
e - The caret event.

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()

createAboutDialog

protected javax.swing.JDialog createAboutDialog()
Returns the About dialog for this application.

Overrides:
createAboutDialog in class AbstractGUIApplication
Returns:
The About dialog.
See Also:
AbstractGUIApplication.getAboutDialog()

createActions

protected void createActions(GUIApplicationPreferences prefs)
Creates the array of actions used by this RText.

Overrides:
createActions in class AbstractGUIApplication
Parameters:
prefs - The RText properties for this RText instance.
See Also:
AbstractGUIApplication.addAction(String, Action), AbstractGUIApplication.getAction(String)

createMenuBar

protected javax.swing.JMenuBar createMenuBar(GUIApplicationPreferences prefs)
Creates and returns the menu bar used in this application.

Specified by:
createMenuBar in class AbstractGUIApplication
Parameters:
prefs - This GUI application's preferences.
Returns:
The menu bar.

createSplashScreen

protected SplashScreen createSplashScreen()
Returns the splash screen to display while this GUI application is loading.

Specified by:
createSplashScreen in class AbstractGUIApplication
Returns:
The splash screen. If null is returned, no splash screen is displayed.

createStatusBar

protected StatusBar createStatusBar(GUIApplicationPreferences prefs)
Returns the status bar to be used by this application.

Specified by:
createStatusBar in class AbstractGUIApplication
Parameters:
prefs - This GUI application's preferences.
Returns:
The status bar.

createToolBar

protected CustomizableToolBar createToolBar(GUIApplicationPreferences prefs)
Creates and returns the toolbar to be used by this application.

Specified by:
createToolBar in class AbstractGUIApplication
Parameters:
prefs - This GUI application's preferences.
Returns:
The toolbar.

displayException

public void displayException(java.awt.Dialog owner,
                             java.lang.Throwable t,
                             java.lang.String desc)
Overridden so we can syntax highlight the Java exception displayed.

Overrides:
displayException in class AbstractGUIApplication
Parameters:
owner - The dialog that threw the Exception.
t - The exception/throwable that occurred.
desc - A short description of the error. This can be null.

displayException

public void displayException(java.awt.Frame owner,
                             java.lang.Throwable t,
                             java.lang.String desc)
Overridden so we can syntax highlight the Java exception displayed.

Overrides:
displayException in class AbstractGUIApplication
Parameters:
owner - The child frame that threw the Exception.
t - The exception/throwable that occurred.
desc - A short description of the error. This can be null.

doExit

public void doExit()
Called when the user attempts to close the application, whether from an "Exit" menu item, closing the main application window, or any other means. The user is prompted to save any dirty documents, and this RText instance is closed.

Specified by:
doExit in interface GUIApplication
Overrides:
doExit in class AbstractGUIApplication

focusDockableWindowGroup

public void focusDockableWindowGroup(int group)
Focuses the specified dockable window group. Does nothing if there are no dockable windows at the location specified.

Parameters:
group - The dockable window group to focus.

getNewFileName

public java.lang.String getNewFileName()
Returns the filename used for newly created, empty text files. This value is locale-specific.

Returns:
The new text file name.

getOptionsDialog

public OptionsDialog getOptionsDialog()
Returns this application's Options dialog.

Overrides:
getOptionsDialog in class AbstractGUIApplication
Returns:
The options dialog, or null if this application doesn't have one. The default implementation returns null.

getCollapsibleSectionPanel

public org.fife.rsta.ui.CollapsibleSectionPanel getCollapsibleSectionPanel()
Returns the application's "collapsible section panel;" that is, the panel containing the main view and possible find/replace tool bars.

Returns:
The collapsible section panel.
See Also:
getMainView()

getFileChooser

public RTextFileChooser getFileChooser()
Returns the file chooser being used by this RText instance.

Specified by:
getFileChooser in interface FileChooserOwner
Returns:
The file chooser.
See Also:
getRemoteFileChooser()

getFocusedDockableWindowGroup

public int getFocusedDockableWindowGroup()
Returns the focused dockable window group.

Returns:
The focused window group, or -1 if no dockable window group is focused.
See Also:
DockableWindowConstants

getHelpDialog

public HelpDialog getHelpDialog()
Returns the Help dialog for RText.

Specified by:
getHelpDialog in interface GUIApplication
Specified by:
getHelpDialog in class AbstractGUIApplication
Returns:
The Help dialog.
See Also:
GUIApplication.getHelpDialog()

getHostName

public java.lang.String getHostName()
Returns the name of the local host. This is lazily discovered.

Returns:
The name of the local host.

getIconGroup

public IconGroup getIconGroup()
Returns the icon group being used for icons for actions.

Returns:
The icon group.

getIconGroupMap

public java.util.Map<java.lang.String,IconGroup> getIconGroupMap()
Returns the icon groups available to RText.

Returns:
The icon groups.

getMainView

public AbstractMainView getMainView()
Returns the actual main view.

Returns:
The main view.
See Also:
getMainViewStyle(), setMainViewStyle(int)

getMainViewStyle

public int getMainViewStyle()
Returns the main view style.

Returns:
The main view style, one of TABBED_VIEW, SPLIT_PANE_VIEW or MDI_VIEW.
See Also:
setMainViewStyle(int), getMainView()

getPreferencesClassName

protected java.lang.String getPreferencesClassName()
Returns the name of the preferences class for this application. This class must be a subclass of GUIApplicationPreferences.

Specified by:
getPreferencesClassName in class AbstractGUIApplication
Returns:
The class name, or null if this GUI application does not save preferences.

getRemoteFileChooser

public RemoteFileChooser getRemoteFileChooser()
Returns the file chooser used to select remote files.

Returns:
The file chooser.
See Also:
getFileChooser()

getResourceBundleClassName

public java.lang.String getResourceBundleClassName()
Returns the fully-qualified class name of the resource bundle for this application. This is used by AbstractGUIApplication.getResourceBundle() to locate the class.

Specified by:
getResourceBundleClassName in class AbstractGUIApplication
Returns:
The fully-qualified class name of the resource bundle.
See Also:
AbstractGUIApplication.getResourceBundle()

getSearchToolBar

public SearchToolBar getSearchToolBar()
Returns the QuickSearch toolbar.

Returns:
The QuickSearch toolbar.
See Also:
isSearchToolBarVisible()

getSearchWindowOpacity

public float getSearchWindowOpacity()
Returns the opacity with which to render unfocused child windows, if this option is enabled.

Returns:
The opacity.
See Also:
setSearchWindowOpacity(float)

getSearchWindowOpacityRule

public int getSearchWindowOpacityRule()
Returns the rule used for making certain child windows translucent.

Returns:
The rule.
See Also:
setSearchWindowOpacityRule(int), getSearchWindowOpacity()

getShowHostName

public boolean getShowHostName()
Returns whether the hostname should be shown in the title of the main RText window.

Returns:
Whether the hostname should be shown.
See Also:
setShowHostName(boolean)

getSyntaxScheme

public SyntaxScheme getSyntaxScheme()
Returns the syntax highlighting color scheme being used.

Returns:
The syntax highlighting color scheme.

getTabSize

public int getTabSize()
Returns the tab size (in spaces) currently being used.

Returns:
The tab size (in spaces) currently being used.
See Also:
setTabSize(int)

getTitle

public java.lang.String getTitle()
Returns the title of this window, less any "header" information (e.g. without the leading "rtext - ").

Overrides:
getTitle in class java.awt.Frame
Returns:
The title of this window.
See Also:
setTitle(String)

getVersionString

public java.lang.String getVersionString()
Returns the version string for this application.

Specified by:
getVersionString in interface GUIApplication
Specified by:
getVersionString in class AbstractGUIApplication
Returns:
The version string.

getWorkingDirectory

public java.lang.String getWorkingDirectory()
Returns the "working directory;" that is, the directory that new, empty files are created in.

Returns:
The working directory. There will be no trailing '/' or '\'.
See Also:
setWorkingDirectory(java.lang.String)

handleInstallPlugin

protected void handleInstallPlugin(Plugin plugin)
Does the dirty work of actually installing a plugin. This method ensures the current text area retains focus even after a GUI plugin is added.

Overrides:
handleInstallPlugin in class AbstractPluggableGUIApplication
Parameters:
plugin - The plugin to install.

hasDockableWindowGroup

public boolean hasDockableWindowGroup(int group)
Returns whether dockable windows are at the specified location.

Parameters:
group - A constant from DockableWindowConstants
Returns:
Whether dockable windows are at the specified location.

isSearchToolBarVisible

public boolean isSearchToolBarVisible()
Returns whether or not the QuickSearch toolbar is visible. This method should be used over getSearchToolBar().isVisible() because the latter will allocate the toolbar if it isn't already created, but this method won't.

Returns:
Whether or not the QuickSearch toolbar is visible.
See Also:
getSearchToolBar()

isSearchWindowOpacityEnabled

public boolean isSearchWindowOpacityEnabled()
Returns whether search window opacity is enabled.

Returns:
Whether search window opacity is enabled.
See Also:
setSearchWindowOpacityEnabled(boolean)

isSpellingWindowVisible

public boolean isSpellingWindowVisible()
Returns whether the spelling window is visible.

Returns:
Whether the spelling window is visible.
See Also:
setSpellingWindowVisible(boolean)

menuItemAcceleratorWorkaround

public void menuItemAcceleratorWorkaround()
Thanks to Java Bug ID 5026829, JMenuItems (among other Swing components) don't update their accelerators, etc. when the properties on which they were created update them. Thus, we have to do this manually. This is still broken as of 1.5.


openFiles

public void openFiles(java.lang.String[] filesToOpen)
Opens the specified files.

Parameters:
filesToOpen - The files to open. This can be null.
See Also:
openFile(java.lang.String)

preDisplayInit

protected void preDisplayInit(GUIApplicationPreferences prefs,
                              SplashScreen splashScreen)
This is called in the GUI application's constructor. It is a chance to do initialization of stuff that will be needed before RText is displayed on-screen.

Overrides:
preDisplayInit in class AbstractPluggableGUIApplication
Parameters:
prefs - The preferences of the application.
splashScreen - The "splash screen" for this application. This value may be null.

preMenuBarInit

protected void preMenuBarInit(GUIApplicationPreferences prefs,
                              SplashScreen splashScreen)
This is called in the GUI application's constructor. It is a chance to do initialization of stuff that will be needed by the menu bar before it gets created.

Specified by:
preMenuBarInit in class AbstractGUIApplication
Parameters:
prefs - The preferences of the application.
splashScreen - The "splash screen" for this application. This value may be null.

preStatusBarInit

protected void preStatusBarInit(GUIApplicationPreferences prefs,
                                SplashScreen splashScreen)
This is called in the GUI application's constructor. It is a chance to do initialization of stuff that will be needed by the status bar bar before it gets created.

Specified by:
preStatusBarInit in class AbstractGUIApplication
Parameters:
prefs - The preferences of the application.
splashScreen - The "splash screen" for this application. This value may be null.

preToolBarInit

protected void preToolBarInit(GUIApplicationPreferences prefs,
                              SplashScreen splashScreen)
This is called in the GUI application's constructor. It is a chance for to do initialization of stuff that will be needed by the toolbar before it gets created.

Specified by:
preToolBarInit in class AbstractGUIApplication
Parameters:
prefs - The preferences of the application.
splashScreen - The "splash screen" for this application. This value may be null.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Called whenever a property changes for a component we are registered as listening to.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

registerChildWindowListeners

public void registerChildWindowListeners(java.awt.Window w)

removeDockableWindow

public void removeDockableWindow(DockableWindow wind)

restoreDefaultAccelerators

public void restoreDefaultAccelerators()
Makes all actions use default accelerators.


saveRTextPreferences

public void saveRTextPreferences()
Attempts to write this RText instance's properties to wherever the OS writes Java Preferences stuff.


setIconGroupByName

public void setIconGroupByName(java.lang.String name)
Changes the style of icons used by rtext.

This method fires a property change of type ICON_STYLE_PROPERTY.

Parameters:
name - The name of the icon group to use. If this name is not recognized, a default icon set will be used.

setMainViewStyle

public void setMainViewStyle(int viewStyle)
Sets the main view style. This method fires a property change of type MAIN_VIEW_STYLE_PROPERTY.

Parameters:
viewStyle - One of TABBED_VIEW, SPLIT_PANE_VIEW or MDI_VIEW. If this value is invalid, nothing happens.
See Also:
getMainViewStyle()

setMessages

public void setMessages(java.lang.String fileFullPath,
                        java.lang.String statusMessage)
This method changes both the active file name in the title bar, and the status message in the status bar.

Parameters:
fileFullPath - Full path to the text file currently being edited (to be displayed in the window's title bar). If null, the currently displayed message is not changed.
statusMessage - The message to be displayed in the status bar. If null, the status bar message is not changed.

setRowColumnIndicatorVisible

public void setRowColumnIndicatorVisible(boolean isVisible)
Enables or disables the row/column indicator in the status bar.

Parameters:
isVisible - Whether or not the row/column indicator should be visible.

setShowHostName

public void setShowHostName(boolean show)
Sets whether the hostname should be shown in the title of the main RText window.

Parameters:
show - Whether the hostname should be shown.
See Also:
getShowHostName()

setStatusBarReadOnlyIndicatorEnabled

public void setStatusBarReadOnlyIndicatorEnabled(boolean enabled)
Sets whether the read-only indicator in the status bar is enabled.

Parameters:
enabled - Whether or not the read-only indicator is enabled.

setSyntaxScheme

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

Parameters:
colorScheme - The new color scheme to use. If null, nothing changes.

setTabsEmulated

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

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

setTabSize

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

Parameters:
newSize - The tab size to use.
See Also:
getTabSize()

setTitle

public void setTitle(java.lang.String title)
Sets the title of the application window. This title is prefixed with the application name.

Overrides:
setTitle in class java.awt.Frame
Parameters:
title - The new title.
See Also:
getTitle()

setSearchWindowOpacity

public void setSearchWindowOpacity(float opacity)
Sets the opacity with which to render unfocused child windows, if this option is enabled.

Parameters:
opacity - The opacity. This should be between 0 and 1.
See Also:
getSearchWindowOpacity(), setSearchWindowOpacityRule(int)

setSearchWindowOpacityEnabled

public void setSearchWindowOpacityEnabled(boolean enabled)
Toggles whether search window opacity is enabled.

Parameters:
enabled - Whether search window opacity should be enabled.
See Also:
isSearchWindowOpacityEnabled()

setSearchWindowOpacityRule

public void setSearchWindowOpacityRule(int rule)
Toggles whether certain child windows should be made translucent.

Parameters:
rule - The new opacity rule.
See Also:
getSearchWindowOpacityRule(), setSearchWindowOpacity(float)

setSpellingWindowVisible

public void setSpellingWindowVisible(boolean visible)
Toggles whether the spelling error window is visible.

Parameters:
visible - Whether the spelling error window is visible.
See Also:
isSpellingWindowVisible()

setWorkingDirectory

public void setWorkingDirectory(java.lang.String directory)
Sets the "working directory;" that is, the directory in which new, empty files are placed.

Parameters:
directory - The new working directory. If this directory does not exist, the Java property "user.dir" is used.
See Also:
getWorkingDirectory()

updateLookAndFeel

public void updateLookAndFeel(javax.swing.LookAndFeel lnf)
Updates the look and feel for all components and windows in this RText instance. This method assumes that UIManager.setLookAndFeel(lnf) has already been called.

Subclasses should override this method to update any child dialogs or windows, and be sure to call the super implementation as well.

Overrides:
updateLookAndFeel in class AbstractGUIApplication
Parameters:
lnf - The new look and feel. You can usually ignore this parameter, as the LookAndFeel has already been installed.

preferences

public void preferences()
1.5.2004/pwy: The following two functions are called from the OSXAdapter and provide the hooks for the functions from the standard Apple application menu. The "about()" OSX hook is in AbstractGUIApplication.

Specified by:
preferences in interface com.apple.osxadapter.NativeMacApp
Specified by:
preferences in class AbstractGUIApplication

openFile

public void openFile(java.lang.String filename)
Description copied from class: AbstractGUIApplication
Gets called from the OSXAdapter; this method is needed by the Mac OS X JVM. This is a hook for the standard Apple application menu. This method gets called when we receive an open event from the finder on Mac OS X, and should be overridden to do whatever makes sense in your application to "open a file."

Specified by:
openFile in interface com.apple.osxadapter.NativeMacApp
Specified by:
openFile in class AbstractGUIApplication

main

public static void main(java.lang.String[] args)
Program entry point.

Parameters:
args - Command line arguments.