Package VASSAL.preferences
Class GlobalPrefs
java.lang.Object
VASSAL.preferences.Prefs
VASSAL.preferences.GlobalPrefs
- All Implemented Interfaces:
Closeable
,AutoCloseable
A set of global preferences shared by all modules. This superclass exists primarily to make sure that the
Global Preferences file gets written whenever a preference setting is changed.
-
Field Summary
Fields inherited from class VASSAL.preferences.Prefs
DISABLE_D3D, MAIN_WINDOW_HEIGHT, MAIN_WINDOW_REMEMBER, MAIN_WINDOW_WIDTH, MODULES_DIR_KEY, TRANSLATABLE_SUPPORT
-
Constructor Summary
ConstructorDescriptionGlobalPrefs(PrefsEditor editor, File file)
GlobalPrefs(PrefsEditor editor, String name)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOption(String category, Configurer o, String prompt)
Adds the preference, and adds a listener for property changes, so that global preference file will be automatically written after any change.boolean
void
Save the global preferencesvoid
setDisableAutoWrite(boolean b)
-
Constructor Details
-
GlobalPrefs
-
GlobalPrefs
-
-
Method Details
-
isDisableAutoWrite
public boolean isDisableAutoWrite()- Overrides:
isDisableAutoWrite
in classPrefs
- Returns:
- true if our auto-write function has been temporarily disabled.
-
setDisableAutoWrite
public void setDisableAutoWrite(boolean b)- Overrides:
setDisableAutoWrite
in classPrefs
- Parameters:
b
- true if auto-write function should be temporarily disabled; false to re-enable it.
-
saveGlobal
public void saveGlobal()Save the global preferences -
addOption
Adds the preference, and adds a listener for property changes, so that global preference file will be automatically written after any change.
-