| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The bundled defaults are loaded from the classpath, so shipping them inside the app:utils jar lets the standalone Preferences (upcoming) resolve its own defaults without the app being present. All existing readers load the file via getResourceAsStream() and are unaffected.
storage half of app.Preferences: defaults from classpath, load/save, platform-specific keys. throws instead of showing dialogs; init split so the app can insert its own defaults between stages. follows processing#1209.
app keeps fonts/colors, dialogs, and proxy/native-chooser side effects in their original startup order; loading and saving now go through the standalone class, with the settings folder passed in from Base.
replaces the per-call file re-read (platform charset, no defaults) with the standalone class, so the preprocessor resolves preferences from the bundled defaults even without a preferences.txt.
set()/unset() notify registered listeners when a value actually changes; loading stays silent. per the processing#1104 todo list.
covers defaults loading, first-run creation, save/load round trips, the preferences.file override, platform-specific keys, backslash normalization, getInteger fallback, sorted save, the 3.x sketchbook migration, and the change listener contract. adds a package-private reset() for test isolation.
found while smoke-testing the utils jar standalone: the PDE and the unit tests both pre-create the settings folder, but a standalone caller passing a new location would fail on the first save.
| Back | FazBrowse Home | New Git URL |
Resolves #1104
Splits processing.app.Preferences into a standalone storage class (processing.utils.Preferences in app:utils) and an app-side facade, so preferences work in contexts without the PDE: the Gradle plugin, CLI tools, and the preprocessor, as motivated in #1104 and the standalone-CLI discussion in #1522.
Changes
Design notes
Builds on the direction @AhmedMagedC explored in #1209, thank you for the groundwork! Rebuilt on today's main since that branch predates the app:utils module: delegation instead of static inheritance, chained IOExceptions instead of a custom exception, no core dependency, and defaults bundled in the utils jar.
Tests
Checklist