|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJESConfig
public class JESConfig
Represents a set of JES configuration information. There is only one instance of this class, because the configuration values are used in many places. The class loads and stores its data in a .properties file. It also can read and write old files that stored the property values one per line in a predefined order.
Field Summary | |
---|---|
static java.lang.String |
CONFIG_AUTOSAVEONRUN
Whether to save files automatically on load. |
static java.lang.String |
CONFIG_BACKUPSAVE
Whether to save backup files. |
static java.lang.String |
CONFIG_BLOCK
Whether to help the user indent with an indentation block. |
static java.lang.String |
CONFIG_COMMAND_WINDOW_THEME
The command-window color scheme. |
static java.lang.String |
CONFIG_FONT
The interface font size. |
static java.lang.String |
CONFIG_GUTTER
Whether to display line numbers. |
static java.lang.String |
CONFIG_MEDIAPATH
The last-used media path. |
static java.lang.String |
CONFIG_MODE
The selected interface mode. |
static java.lang.String |
CONFIG_RECENT_FILES
The list of recent files. |
static java.lang.String |
CONFIG_SKIN
The Java UI skin. |
static java.lang.String |
CONFIG_WRAPPIXELVALUES
Whether to wrap red/blue/green values from 0 to 255. |
static java.lang.String |
DEFAULT_FILE_NAME
The default name of the modern JES .properties files. |
static int |
FONT_SIZE_MAX
|
static int |
FONT_SIZE_MAXREC
|
static int |
FONT_SIZE_MIN
|
static java.lang.String |
MIGRATION_FILE_NAME
The default name of the legacy JESConfig.txt files. |
static java.lang.String |
MODE_BEGINNER
|
static java.lang.String |
MODE_EXPERT
|
Method Summary | |
---|---|
boolean |
getBooleanProperty(java.lang.String property)
Reads a property from the settings as a Boolean. |
static java.io.File |
getConfigFile()
Returns a File pointing to the current configuration file, as indicated by the jes.configfile property. |
static java.io.File |
getDefaultConfigFile()
Returns a File pointing to the default configuration file location, independent of the current platform. |
static JESConfig |
getInstance()
Returns the one instance of JESConfig, loading the configuration files in the process. |
int |
getIntegerProperty(java.lang.String property)
Reads a property from the settings as an integer. |
java.io.IOException |
getLoadError()
Returns the most recent load error. |
static java.io.File |
getMigrationConfigFile()
Returns a File pointing to the location of the configuration file used before JES 5.0. |
java.lang.String |
getStringProperty(java.lang.String property)
Reads a property from the settings. |
boolean |
isModified()
Indicates that a property has been added to the configuration since it was loaded. |
void |
loadConfig()
Reads a file full of properties. |
void |
setBooleanProperty(java.lang.String property,
boolean value)
Sets a property and stores it as a Boolean. |
void |
setIntegerProperty(java.lang.String property,
int value)
Sets a property and stores it as an integer. |
void |
setStringProperty(java.lang.String property,
java.lang.String value)
Sets a property. |
boolean |
wasLoaded()
Indicates that the configuration was loaded from a file. |
boolean |
wasMigrated()
Indicates that the configuration was loaded from an configuration file from before JES 5.0. |
void |
writeConfig()
Method to write the current JES settings to the file user.home/JES_CONFIG_FILE_NAME |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONFIG_WRAPPIXELVALUES
public static final java.lang.String CONFIG_MEDIAPATH
public static final java.lang.String CONFIG_MODE
public static final java.lang.String MODE_BEGINNER
public static final java.lang.String MODE_EXPERT
public static final java.lang.String CONFIG_SKIN
public static final java.lang.String CONFIG_COMMAND_WINDOW_THEME
public static final java.lang.String CONFIG_FONT
public static final int FONT_SIZE_MIN
public static final int FONT_SIZE_MAX
public static final int FONT_SIZE_MAXREC
public static final java.lang.String CONFIG_GUTTER
public static final java.lang.String CONFIG_BLOCK
public static final java.lang.String CONFIG_AUTOSAVEONRUN
public static final java.lang.String CONFIG_BACKUPSAVE
public static final java.lang.String CONFIG_RECENT_FILES
public static final java.lang.String DEFAULT_FILE_NAME
public static final java.lang.String MIGRATION_FILE_NAME
Method Detail |
---|
public static java.io.File getConfigFile()
public static java.io.File getDefaultConfigFile()
public static java.io.File getMigrationConfigFile()
public static JESConfig getInstance()
public void loadConfig()
public void writeConfig()
public boolean wasLoaded()
public boolean wasMigrated()
public boolean isModified()
public java.io.IOException getLoadError()
public java.lang.String getStringProperty(java.lang.String property)
property
- The name of the property.
You should use one of the JESConfig.CONFIG_* constants.
public boolean getBooleanProperty(java.lang.String property)
property
- The name of the property.
You should use one of the JESConfig.CONFIG_* constants.
public int getIntegerProperty(java.lang.String property)
property
- The name of the property.
You should use one of the JESConfig.CONFIG_* constants.
public void setStringProperty(java.lang.String property, java.lang.String value)
property
- The name of the property.
You should use one of the JESConfig.CONFIG_* constants.value
- The value to set for the property.public void setIntegerProperty(java.lang.String property, int value)
property
- The name of the property.
You should use one of the JESConfig.CONFIG_* constants.value
- The value to set for the property.public void setBooleanProperty(java.lang.String property, boolean value)
property
- The name of the property.
You should use one of the JESConfig.CONFIG_* constants.value
- The value to set for the property.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |