processing / processing/processing4

Making `Preferences` standalone

Open
#1,104 13 comments 0 reactions 1 assignee View on GitHub

@diyaayay is already working on this.

Since Jul 31, 2026.

Dominant language
Java
Stars
494
Forks
183
Avg merge
4h 39m
Merged PRs (30d)
3

Description

For the migration of the internal Gradle runner, I'm running into trouble with the Preferences class.

Problem description

Currently Preferences is tightly coupled with the PDE through the use of the Base, Messages, Toolkit and Language classes. These classes do not operate outside of the PDE, thus not allowing reuse of the Preferences class in other modules within Processing (e.g. Gradle plugins, Processing CLI, Processing pre-processor, etc.)

Proposed solution

Migrate the Preferences class to a standalone version.

  • Completing the migration of Preferences to be standalone from :app by moving it to a :app:utils module.
  • Move functionality dependent on :app into a AppPreferences class or into other relevant areas of the PDE
  • Adding callback events/listeners when a preference changes
  • Tests that will declare and test the functionality of Preferences, a few of the top of my head would be:
    • Test if the defaults are loaded and saved without creating changes
    • Test if \ work
    • Test if the preferences file is created if it does not yet exist
    • Any other tests to make sure we have backwards compatibility
  • A Github Action that will run the Tests on all supported platforms
  • Bonus: Removing the dependency on core
Steps taken so far
  • In IntelliJ IDEA create a new module utils in the app folder with the following settings (see image below)
  • Add package processing.utils to the newly created module
  • Refactoring the class by right clicking the Prefrences class and Refactor -> Move Class... and moving it to the newly created processing.utils package
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.