8000 Encapsulate the Swing LookAndFeel using an ObservableValue by ptziegler · Pull Request #1224 · eclipse-windowbuilder/windowbuilder · GitHub
[go: up one dir, main page]

Skip to content

Encapsulate the Swing LookAndFeel using an ObservableValue#1224

Merged
ptziegler merged 1 commit intoeclipse-windowbuilder:masterfrom
ptziegler:swing-laf-value
Sep 14, 2025
Merged

Encapsulate the Swing LookAndFeel using an ObservableValue#1224
ptziegler merged 1 commit intoeclipse-windowbuilder:masterfrom
ptziegler:swing-laf-value

Conversation

@ptziegler
Copy link
Contributor

Access to the Swing objects must be done from the AWT event dispatcher thread (aka the Swing UI thread). Rather than explicitly checking whether any method is called from this thread via e.g. the EventQueue, we can take advantage of the "Realm" concept provided by the Eclipse.

The LookAndFeel is stored within an ObservableValue. The realm of this value is the Swing UI thread. Modifying this value from any other thread is guaranteed to throw an exception.

Access to the Swing objects must be done from the AWT event dispatcher
thread (aka the Swing UI thread). Rather than explicitly checking
whether any method is called from this thread via e.g. the EventQueue,
we can take advantage of the "Realm" concept provided by the Eclipse.

The LookAndFeel is stored within an ObservableValue. The realm of this
value is the Swing UI thread. Modifying this value from any other thread
is guaranteed to throw an exception.
@ptziegler ptziegler added this to the 1.22.0 milestone Sep 13, 2025
@ptziegler
Copy link
Contributor Author

Using the Observable API seems to be the most promising approach, also for the other Swing objects such as Borders, TableModels and SpinnerModels.

@github-actions
Copy link

Test Results

 2 720 files  ±0   2 720 suites  ±0   9h 19m 59s ⏱️ + 9m 42s
 6 985 tests ±0   6 915 ✅ ±0   70 💤 ±0  0 ❌ ±0 
27 940 runs  ±0  27 660 ✅ ±0  280 💤 ±0  0 ❌ ±0 

Results for commit 9305b3b. ± Comparison against base commit cf03ec7.

@ptziegler ptziegler merged commit 8887eb7 into eclipse-windowbuilder:master Sep 14, 2025
9 checks passed
@ptziegler ptziegler deleted the swing-laf-value branch September 14, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0