org.grinvin.preferences

Class GrinvinPreferences


public class GrinvinPreferences
extends java.lang.Object

Class to handle GrInvIn preferences management. When the preferences are not set by the user, a default value is taken from the defaults.xml file.

Nested Class Summary

class
GrinvinPreferences.OsType
class
GrinvinPreferences.Preference

Method Summary

void
addListener(GrinvinPreferencesListener listener)
static GrinvinPreferences
getInstance()
int
getIntPreference(GrinvinPreferences.Preference key)
GrinvinPreferences.OsType
getOsType()
Format
getPreferredXMLFormat()
File
getProgramPath(String name)
Return the path of an external program which is part of the grinvin distribution.
String
getStringPreference(GrinvinPreferences.Preference key)
void
setIntPreference(GrinvinPreferences.Preference key, int value)
void
setStringPreference(GrinvinPreferences.Preference key, String value)

Method Details

addListener

public void addListener(GrinvinPreferencesListener listener)

getInstance

public static GrinvinPreferences getInstance()

getIntPreference

public int getIntPreference(GrinvinPreferences.Preference key)

getOsType

public GrinvinPreferences.OsType getOsType()

getPreferredXMLFormat

public Format getPreferredXMLFormat()

getProgramPath

public File getProgramPath(String name)
Return the path of an external program which is part of the grinvin distribution. Prepends the name of the bin-directory in the installation, and appends '.exe' if necessary.
Parameters:
name - Canonical name of the program.

getStringPreference

public String getStringPreference(GrinvinPreferences.Preference key)

setIntPreference

public void setIntPreference(GrinvinPreferences.Preference key,
                             int value)

setStringPreference

public void setStringPreference(GrinvinPreferences.Preference key,
                                String value)