Package org.opentrafficsim.editor
Class ApplicationStore
java.lang.Object
org.opentrafficsim.editor.ApplicationStore
Stores preferences, recently opened files, etc.
Copyright (c) 2024-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationStore(String enterpriseName, String applicationName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecentFile(String key, String file) Add recent file.voidclearProperty(String key) Removes key from the store.getProperty(String key) Returns the property value.getRecentFiles(String key) Returns recent files.voidremoveRecentFile(String key, String file) Clears a recent file.voidsetProperty(String key, String value) Sets a property value.
-
Constructor Details
-
ApplicationStore
Constructor. Properties are stored under "{user.home}/{enterprise}/{application}.ini".- Parameters:
enterpriseName- name of the enterprise.applicationName- name of the application.
-
-
Method Details
-
getProperty
Returns the property value.- Parameters:
key- key.- Returns:
- property value, or
nullif no value is given.
-
setProperty
Sets a property value.- Parameters:
key- key.value- value.
-
getRecentFiles
Returns recent files.- Parameters:
key- key under which files are stored.- Returns:
- files (recent to old).
-
addRecentFile
Add recent file. If the file is already in the list, it is moved to the front.- Parameters:
key- key under which files are stored.file- latest file.
-
removeRecentFile
Clears a recent file.- Parameters:
key- key.file- file.
-
clearProperty
Removes key from the store.- Parameters:
key- key.
-