|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.config.Configuration
edu.rice.cs.drjava.config.SavableConfiguration
edu.rice.cs.drjava.config.FileConfiguration
edu.rice.cs.drjava.config.ResourceBundleConfiguration
public class ResourceBundleConfiguration
A configuration in a resource bundle.
| Field Summary | |
|---|---|
protected ResourceBundle |
_bundle
Resource bundle containing the configuration. |
protected String |
_resourceBundleName
Name of the resource bundle. |
protected FileConfiguration |
_shadowed
Shadowed configuration used if the resource bundle does not define an option. |
| Fields inherited from class edu.rice.cs.drjava.config.FileConfiguration |
|---|
file |
| Fields inherited from class edu.rice.cs.drjava.config.Configuration |
|---|
_startupException, map |
| Constructor Summary | |
|---|---|
ResourceBundleConfiguration(String resourceBundleName,
FileConfiguration shadowed)
Initializes this Configuration object with the given OptionMap. |
|
| Method Summary | ||
|---|---|---|
|
addOptionListener(Option<T> op,
OptionListener<T> l)
Adds an OptionListener to the given Option, to be notified each time the option changes. |
|
|
getSetting(Option<T> op)
Gets the current value of the given Option. |
|
|
isEditable(Option<T> op)
Return true if the option is editable. |
|
void |
loadConfiguration()
Calls SavableConfiguration.loadConfiguration, which loads all values from the file, based on the defaults in OptionConstants. |
|
void |
loadConfiguration(InputStream is)
Creates an OptionMapLoader with the values loaded from the InputStream (and defaults where values weren't specified) and loads them into this Configuration's OptionMap. |
|
|
removeOptionListener(Option<T> op,
OptionListener<T> l)
Removes an OptionListener from an Option to which it was listening. |
|
void |
resetToDefaults()
Resets to the default values, overwriting any existing values. |
|
void |
saveConfiguration()
Saves the current settings to the stored properties file. |
|
void |
saveConfiguration(OutputStream os,
String header)
Used to save the values from this Configuration into the given OutputStream as a Properties file. |
|
void |
saveConfiguration(String header)
Saves the current settings to the stored properties file. |
|
|
setSetting(Option<T> op,
T value)
Sets the given option to the given value and notifies all listeners of that option of the change. |
|
String |
toString()
Returns a string representation of the contents of the OptionMap. |
|
| Methods inherited from class edu.rice.cs.drjava.config.FileConfiguration |
|---|
getFile |
| Methods inherited from class edu.rice.cs.drjava.config.Configuration |
|---|
getOptionMap, getStartupException, hadStartupException, storeStartupException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final String _resourceBundleName
protected final ResourceBundle _bundle
protected final FileConfiguration _shadowed
| Constructor Detail |
|---|
public ResourceBundleConfiguration(String resourceBundleName,
FileConfiguration shadowed)
resourceBundleName - name of the resource bundleshadowed - configuration that should be used if the resource bundle does not define an option.| Method Detail |
|---|
public <T> T setSetting(Option<T> op,
T value)
setSetting in class Configurationop - Option to setvalue - New value for the optionpublic <T> T getSetting(Option<T> op)
getSetting in class Configurationpublic <T> boolean isEditable(Option<T> op)
isEditable in class Configurationpublic void resetToDefaults()
resetToDefaults in class Configurationpublic String toString()
toString in class Configuration
public void loadConfiguration()
throws IOException
loadConfiguration in class FileConfigurationIOException
public void saveConfiguration()
throws IOException
saveConfiguration in class FileConfigurationIOException
public void saveConfiguration(String header)
throws IOException
saveConfiguration in class FileConfigurationheader - Description of the properties list
IOException
public void loadConfiguration(InputStream is)
throws IOException
loadConfiguration in class SavableConfigurationis - InputStream containing properties-style keys and values
IOException
public void saveConfiguration(OutputStream os,
String header)
throws IOException
saveConfiguration in class SavableConfigurationIOException
public <T> void addOptionListener(Option<T> op,
OptionListener<T> l)
addOptionListener in class Configurationop - Option to listen for changes onl - OptionListener wishing to listen
public <T> void removeOptionListener(Option<T> op,
OptionListener<T> l)
removeOptionListener in class Configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||