org.fife.rtext
Class RTextPreferences

java.lang.Object
  extended by org.fife.ui.app.GUIApplicationPreferences
      extended by org.fife.rtext.RTextPreferences
All Implemented Interfaces:
RTextActionInfo, GUIApplicationConstants, DockableWindowConstants

public class RTextPreferences
extends GUIApplicationPreferences
implements RTextActionInfo

A class representing several properties of an RText session. This class is used for saving user preferences between RText sessions. It consists only of public data members for ease of use.

Version:
0.3
Author:
Robert Futrell

Field Summary
 boolean aaEnabled
           
 boolean autoInsertClosingCurlys
           
 java.lang.Object backgroundObject
           
 boolean bomInUtf8
           
 boolean bookmarksEnabled
           
 boolean bracketMatchingEnabled
           
 int caretBlinkRate
           
 java.awt.Color caretColor
           
 int[] carets
           
 java.lang.String codeFoldingEnabledFor
           
 SyntaxScheme colorScheme
           
 java.awt.Color currentLineHighlightColor
           
 boolean currentLineHighlightEnabled
           
static int DEFAULT_MAX_SPELLING_ERRORS
          The default maximum number of spelling errors to display for a single file.
static java.awt.Color DEFAULT_SPELLING_ERROR_COLOR
          The default color used to underline spelling errors.
 java.lang.String defaultEncoding
           
 java.lang.String defaultLineTerminator
           
 int[] dividerLocations
           
 boolean doFileSizeCheck
           
 boolean dropShadowsInEditor
           
 boolean emulateTabsWithSpaces
           
 java.lang.String fileHistoryString
           
 boolean fractionalMetricsEnabled
           
 boolean guessFileContentType
           
 java.awt.Color gutterBorderColor
           
 boolean highlightModifiedDocNames
           
 boolean highlightSecondaryLanguages
           
 java.awt.Color hyperlinkColor
           
 int hyperlinkModifierKey
           
 boolean hyperlinksEnabled
           
 java.lang.String iconGroupName
           
 boolean ignoreBackupExtensions
           
 float imageAlpha
           
 java.awt.Color lineNumberColor
           
 java.awt.Font lineNumberFont
           
 boolean lineNumbersVisible
           
 int mainView
           
 javax.swing.KeyStroke[] mainViewActionAccelerators
           
 java.awt.Color marginLineColor
           
 boolean marginLineEnabled
           
 int marginLinePosition
           
 java.awt.Color markAllHighlightColor
           
 boolean markOccurrences
           
 java.awt.Color markOccurrencesColor
           
 boolean matchBothBrackets
           
 java.awt.Color matchedBracketBGColor
           
 java.awt.Color matchedBracketBorderColor
           
 int maxFileHistorySize
           
 float maxFileSize
           
 int maxSpellingErrors
           
 java.awt.Color modifiedDocumentNamesColor
           
 java.awt.Font printFont
           
 boolean rememberWhitespaceLines
           
 boolean roundedSelectionEdges
           
 boolean searchToolBarVisible
           
 float searchWindowOpacity
           
 boolean searchWindowOpacityEnabled
           
 int searchWindowOpacityRule
           
 java.awt.Color[] secondaryLanguageColors
           
 java.awt.Color selectedTextColor
           
 java.awt.Color selectionColor
           
 boolean showEOLMarkers
           
 boolean showHostName
           
 boolean showTabLines
           
 java.awt.Color spellCheckingColor
           
 boolean spellCheckingEnabled
           
 java.lang.String spellingDictionary
           
 int statusBarStyle
           
 java.lang.String syntaxFiltersString
           
 java.awt.Color tabLinesColor
           
 int tabPlacement
           
 int tabSize
           
 java.awt.Font textAreaFont
           
 java.awt.Color textAreaForeground
           
 java.awt.ComponentOrientation textAreaOrientation
           
 boolean textAreaUnderline
           
 int textMode
           
 java.io.File userDictionary
           
 boolean useSearchDialogs
           
 boolean useSelectedTextColor
           
 boolean viewSpellingList
           
 boolean visibleWhitespace
           
 boolean wordWrap
           
 java.lang.String workingDirectory
           
 
Fields inherited from class org.fife.ui.app.GUIApplicationPreferences
accelerators, language, location, lookAndFeel, size, statusBarVisible, toolbarVisible
 
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
 
Method Summary
static GUIApplicationPreferences generatePreferences(RText rtext)
          Creates a properties object with all fields initialized to the values that the specified RText instance is currently running with.
static java.lang.String getLookAndFeelToLoad()
          Returns just the LookAndFeel saved in the application preferences.
static GUIApplicationPreferences loadPreferences()
          Returns a preferences instance with data saved previously via the Java Preferences API.
 void savePreferences(java.lang.Object rtext)
          Saves this preferences instance via the Java Preferences API.
protected  void setDefaults()
          Sets this preferences instance to contain all default values.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class org.fife.ui.app.GUIApplicationPreferences
generatePreferences, getAccelerator, loadCommonPreferences, saveCommonPreferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MAX_SPELLING_ERRORS

public static final int DEFAULT_MAX_SPELLING_ERRORS
The default maximum number of spelling errors to display for a single file.

See Also:
Constant Field Values

DEFAULT_SPELLING_ERROR_COLOR

public static final java.awt.Color DEFAULT_SPELLING_ERROR_COLOR
The default color used to underline spelling errors.


iconGroupName

public java.lang.String iconGroupName

lineNumbersVisible

public boolean lineNumbersVisible

tabSize

public int tabSize

emulateTabsWithSpaces

public boolean emulateTabsWithSpaces

textMode

public int textMode

tabPlacement

public int tabPlacement

printFont

public java.awt.Font printFont

backgroundObject

public java.lang.Object backgroundObject

imageAlpha

public float imageAlpha

wordWrap

public boolean wordWrap

caretColor

public java.awt.Color caretColor

selectionColor

public java.awt.Color selectionColor

selectedTextColor

public java.awt.Color selectedTextColor

useSelectedTextColor

public boolean useSelectedTextColor

colorScheme

public SyntaxScheme colorScheme

syntaxFiltersString

public java.lang.String syntaxFiltersString

maxFileHistorySize

public int maxFileHistorySize

fileHistoryString

public java.lang.String fileHistoryString

currentLineHighlightEnabled

public boolean currentLineHighlightEnabled

currentLineHighlightColor

public java.awt.Color currentLineHighlightColor

mainView

public int mainView

highlightModifiedDocNames

public boolean highlightModifiedDocNames

modifiedDocumentNamesColor

public java.awt.Color modifiedDocumentNamesColor

bracketMatchingEnabled

public boolean bracketMatchingEnabled

matchBothBrackets

public boolean matchBothBrackets

matchedBracketBGColor

public java.awt.Color matchedBracketBGColor

matchedBracketBorderColor

public java.awt.Color matchedBracketBorderColor

marginLineEnabled

public boolean marginLineEnabled

marginLinePosition

public int marginLinePosition

marginLineColor

public java.awt.Color marginLineColor

highlightSecondaryLanguages

public boolean highlightSecondaryLanguages

secondaryLanguageColors

public java.awt.Color[] secondaryLanguageColors

hyperlinksEnabled

public boolean hyperlinksEnabled

hyperlinkColor

public java.awt.Color hyperlinkColor

hyperlinkModifierKey

public int hyperlinkModifierKey

visibleWhitespace

public boolean visibleWhitespace

showEOLMarkers

public boolean showEOLMarkers

showTabLines

public boolean showTabLines

tabLinesColor

public java.awt.Color tabLinesColor

rememberWhitespaceLines

public boolean rememberWhitespaceLines

autoInsertClosingCurlys

public boolean autoInsertClosingCurlys

aaEnabled

public boolean aaEnabled

fractionalMetricsEnabled

public boolean fractionalMetricsEnabled

markAllHighlightColor

public java.awt.Color markAllHighlightColor

markOccurrences

public boolean markOccurrences

markOccurrencesColor

public java.awt.Color markOccurrencesColor

statusBarStyle

public int statusBarStyle

roundedSelectionEdges

public boolean roundedSelectionEdges

workingDirectory

public java.lang.String workingDirectory

carets

public int[] carets

caretBlinkRate

public int caretBlinkRate

searchToolBarVisible

public boolean searchToolBarVisible

dividerLocations

public int[] dividerLocations

defaultLineTerminator

public java.lang.String defaultLineTerminator

defaultEncoding

public java.lang.String defaultEncoding

guessFileContentType

public boolean guessFileContentType

doFileSizeCheck

public boolean doFileSizeCheck

maxFileSize

public float maxFileSize

ignoreBackupExtensions

public boolean ignoreBackupExtensions

textAreaFont

public java.awt.Font textAreaFont

textAreaUnderline

public boolean textAreaUnderline

textAreaForeground

public java.awt.Color textAreaForeground

textAreaOrientation

public java.awt.ComponentOrientation textAreaOrientation

showHostName

public boolean showHostName

bomInUtf8

public boolean bomInUtf8

bookmarksEnabled

public boolean bookmarksEnabled

lineNumberFont

public java.awt.Font lineNumberFont

lineNumberColor

public java.awt.Color lineNumberColor

gutterBorderColor

public java.awt.Color gutterBorderColor

spellCheckingEnabled

public boolean spellCheckingEnabled

spellCheckingColor

public java.awt.Color spellCheckingColor

spellingDictionary

public java.lang.String spellingDictionary

userDictionary

public java.io.File userDictionary

maxSpellingErrors

public int maxSpellingErrors

viewSpellingList

public boolean viewSpellingList

searchWindowOpacityEnabled

public boolean searchWindowOpacityEnabled

searchWindowOpacity

public float searchWindowOpacity

searchWindowOpacityRule

public int searchWindowOpacityRule

dropShadowsInEditor

public boolean dropShadowsInEditor

codeFoldingEnabledFor

public java.lang.String codeFoldingEnabledFor

useSearchDialogs

public boolean useSearchDialogs

mainViewActionAccelerators

public javax.swing.KeyStroke[] mainViewActionAccelerators
Method Detail

generatePreferences

public static GUIApplicationPreferences generatePreferences(RText rtext)
Creates a properties object with all fields initialized to the values that the specified RText instance is currently running with.

Returns:
An RTextPreferences object initialized to contain the properties the specified RText instance is running with.

getLookAndFeelToLoad

public static java.lang.String getLookAndFeelToLoad()
Returns just the LookAndFeel saved in the application preferences. This is so we can set the LAF before loading the application, to allow finnicky LAF's like Substance to work properly (Substance only works if it's set before the first JFrame is created).

Returns:
The name of the LookAndFeel to load, or the system default LAF if no LAF is currently saved.

loadPreferences

public static GUIApplicationPreferences loadPreferences()
Returns a preferences instance with data saved previously via the Java Preferences API. If the load fails, this preferences instance will be populated with default values.

Returns:
If the load went okay, true is returned. If the load failed default values will be set.

savePreferences

public void savePreferences(java.lang.Object rtext)
Saves this preferences instance via the Java Preferences API.

Specified by:
savePreferences in class GUIApplicationPreferences
Parameters:
rtext - The rtext instance for which you are saving preferences.

setDefaults

protected void setDefaults()
Sets this preferences instance to contain all default values.

Specified by:
setDefaults in class GUIApplicationPreferences

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.