upidiff.prefs
Class UserPreferences

java.lang.Object
  |
  +--upidiff.prefs.UserPreferences

public final class UserPreferences
extends Object

This class represents the user preferences.

Author:
bmeurer

Field Summary
private  Preferences backend
          Preferences backend.
private static int DEFAULT_DELETED_CHAR_COLOR
          Default color for deleted characters (green)
private static int DEFAULT_DELETED_LINE_COLOR
          Default color for deleted lines (yellow).
private static int DEFAULT_INSERTED_CHAR_COLOR
          Default color for inserted characters (red)
private static int DEFAULT_INSERTED_LINE_COLOR
          Default color for inserted lines (blue).
private static int DEFAULT_MERGED_COLOR
          Default color for merged changes (light gray)
private static int DEFAULT_UPDATED_LINES_COLOR
          Default color for updated lines (light blue)
private static UserPreferences instance
          The global user preferences instance.
 
Constructor Summary
private UserPreferences()
          Creates a new instance of the UserPreferences class.
 
Method Summary
 String getCurrentDirectory()
          Queries the current directory.
 Color getDeletedCharColor()
          Queries the color for deleted characters.
 Color getDeletedLineColor()
          Queries the color for deleted lines.
 Color getInsertedCharColor()
          Queries the color for inserted characters.
 Color getInsertedLineColor()
          Queries the color for inserted lines.
static UserPreferences getInstance()
          Returns the global user preferences instance.
 String getLanguage()
          Queries the currently selected language.
 Color getMergedColor()
          Queries the color for merged changes.
 boolean getShowHiddenFiles()
          Queries whether to show hidden files in the "Open files" dialog.
 Color getUpdatedLinesColor()
          Queries the color for updated lines.
 boolean isInputFilterEmptyLines()
          Queries the setting for the "Empty lines input filter".
 boolean isInputFilterIgnoreCase()
          Queries the setting for the "Ignore case filter".
 boolean isInputFilterIgnoreTabs()
          Queries the setting for the "Ignore tabs filter".
 boolean isInputFilterIgnoreWhitespace()
          Queries the setting for the "Ignore whitespace filter".
 boolean isInputFilterJavaComment()
          Queries the setting for the "Java comment filter".
 void setCurrentDirectory(String path)
          Sets the current open directory.
 void setDeletedCharColor(Color color)
          Sets the color for deleted characters.
 void setDeletedLineColor(Color color)
          Sets the color for deleted lines.
 void setInputFilterEmptyLines(boolean setting)
          Sets the setting for the "Empty lines input filter".
 void setInputFilterIgnoreCase(boolean setting)
          Sets the setting for the "Ignore tabs filter"
 void setInputFilterIgnoreTabs(boolean setting)
          Sets the setting for the "Ingore tabs filter".
 void setInputFilterIgnoreWhitespace(boolean setting)
          Sets the setting for the "Ignore whitespace filter".
 void setInputFilterJavaComment(boolean setting)
          Sets the setting for the "Java comment filter".
 void setInsertedCharColor(Color color)
          Sets the color for inserted characters.
 void setInsertedLineColor(Color color)
          Sets the color for inserted lines.
 void setLanguage(String lang)
          Sets the curerntly selected language.
 void setMergedColor(Color color)
          Sets the color for merged changes.
 void setShowHiddenFiles(boolean shown)
          Sets whether to show hidden files in the "Open files" dialog.
 void setUpdatedLinesColor(Color color)
          Sets the color for updated lines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DELETED_LINE_COLOR

private static final int DEFAULT_DELETED_LINE_COLOR
Default color for deleted lines (yellow).

See Also:
Constant Field Values

DEFAULT_INSERTED_LINE_COLOR

private static final int DEFAULT_INSERTED_LINE_COLOR
Default color for inserted lines (blue).

See Also:
Constant Field Values

DEFAULT_DELETED_CHAR_COLOR

private static final int DEFAULT_DELETED_CHAR_COLOR
Default color for deleted characters (green)

See Also:
Constant Field Values

DEFAULT_INSERTED_CHAR_COLOR

private static final int DEFAULT_INSERTED_CHAR_COLOR
Default color for inserted characters (red)

See Also:
Constant Field Values

DEFAULT_UPDATED_LINES_COLOR

private static final int DEFAULT_UPDATED_LINES_COLOR
Default color for updated lines (light blue)

See Also:
Constant Field Values

DEFAULT_MERGED_COLOR

private static final int DEFAULT_MERGED_COLOR
Default color for merged changes (light gray)

See Also:
Constant Field Values

instance

private static UserPreferences instance
The global user preferences instance.


backend

private Preferences backend
Preferences backend.

Constructor Detail

UserPreferences

private UserPreferences()
Creates a new instance of the UserPreferences class.

Method Detail

getInstance

public static final UserPreferences getInstance()
Returns the global user preferences instance.

Returns:
The user preferences instance.

getCurrentDirectory

public final String getCurrentDirectory()
Queries the current directory. Used for the open files dialog.

Returns:
The current open directory.

setCurrentDirectory

public final void setCurrentDirectory(String path)
Sets the current open directory.

Parameters:
path - Path to the current directory.

getShowHiddenFiles

public final boolean getShowHiddenFiles()
Queries whether to show hidden files in the "Open files" dialog.

Returns:
true if hidden files should be shown in the dialog.

setShowHiddenFiles

public final void setShowHiddenFiles(boolean shown)
Sets whether to show hidden files in the "Open files" dialog.

Parameters:
shown - Whether to show hidden files.

getDeletedLineColor

public final Color getDeletedLineColor()
Queries the color for deleted lines.

Returns:
The color for deleted lines.

setDeletedLineColor

public final void setDeletedLineColor(Color color)
Sets the color for deleted lines.

Parameters:
color - The new color for deleted lines.

getInsertedLineColor

public final Color getInsertedLineColor()
Queries the color for inserted lines.

Returns:
The color for inserted lines.

setInsertedLineColor

public final void setInsertedLineColor(Color color)
Sets the color for inserted lines.

Parameters:
color - The new color for inserted lines.

getDeletedCharColor

public final Color getDeletedCharColor()
Queries the color for deleted characters.

Returns:
The color for deleted characters.

setDeletedCharColor

public final void setDeletedCharColor(Color color)
Sets the color for deleted characters.

Parameters:
color - The new color for deleted characters.

getInsertedCharColor

public final Color getInsertedCharColor()
Queries the color for inserted characters.

Returns:
The color for inserted characters.

setInsertedCharColor

public final void setInsertedCharColor(Color color)
Sets the color for inserted characters.

Parameters:
color - The new color for inserted characters.

getUpdatedLinesColor

public final Color getUpdatedLinesColor()
Queries the color for updated lines. An updated line is a line that contains character changes which are visible to the user.

Returns:
The color for updates lines.

setUpdatedLinesColor

public final void setUpdatedLinesColor(Color color)
Sets the color for updated lines. An updated line is a line that contains character changes which are visible to the user.

Parameters:
color - The new color for updated lines.

getMergedColor

public final Color getMergedColor()
Queries the color for merged changes.

Returns:
The color for merged changes.

setMergedColor

public final void setMergedColor(Color color)
Sets the color for merged changes.

Parameters:
color - The new color for merged changes.

isInputFilterEmptyLines

public final boolean isInputFilterEmptyLines()
Queries the setting for the "Empty lines input filter".

Returns:
true if the filter should be used, else false.

setInputFilterEmptyLines

public final void setInputFilterEmptyLines(boolean setting)
Sets the setting for the "Empty lines input filter".

Parameters:
setting - New setting.

isInputFilterIgnoreCase

public final boolean isInputFilterIgnoreCase()
Queries the setting for the "Ignore case filter".

Returns:
true if the filter should be used, else false.

setInputFilterIgnoreCase

public final void setInputFilterIgnoreCase(boolean setting)
Sets the setting for the "Ignore tabs filter"

Parameters:
setting - New setting.

isInputFilterIgnoreTabs

public final boolean isInputFilterIgnoreTabs()
Queries the setting for the "Ignore tabs filter".

Returns:
true if the filter should be used, else false.

setInputFilterIgnoreTabs

public final void setInputFilterIgnoreTabs(boolean setting)
Sets the setting for the "Ingore tabs filter".

Parameters:
setting - New setting.

isInputFilterIgnoreWhitespace

public final boolean isInputFilterIgnoreWhitespace()
Queries the setting for the "Ignore whitespace filter".

Returns:
true if the filter should be used, else false.

setInputFilterIgnoreWhitespace

public final void setInputFilterIgnoreWhitespace(boolean setting)
Sets the setting for the "Ignore whitespace filter".

Parameters:
setting - New setting.

isInputFilterJavaComment

public final boolean isInputFilterJavaComment()
Queries the setting for the "Java comment filter".

Returns:
true if the filter should be used, else false.

setInputFilterJavaComment

public final void setInputFilterJavaComment(boolean setting)
Sets the setting for the "Java comment filter".

Parameters:
setting - New setting.

getLanguage

public final String getLanguage()
Queries the currently selected language.

Returns:
The language name.

setLanguage

public final void setLanguage(String lang)
Sets the curerntly selected language.

Parameters:
lang - New language name.