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

Field Summary

static GrinvinPreferences
INSTANCE

Method Summary

void
addListener(GrinvinPreferencesListener listener)
int
getIntPreference(GrinvinPreferences.Preference key)
GrinvinPreferences.OsType
getOsType()
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)

Field Details

INSTANCE

public static GrinvinPreferences INSTANCE

Method Details

addListener

public void addListener(GrinvinPreferencesListener listener)

getIntPreference

public int getIntPreference(GrinvinPreferences.Preference key)

getOsType

public GrinvinPreferences.OsType getOsType()

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)