Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331371

Summary: [API] SWT#Settings event is missing
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: rsternberg
Version: unspecified   
Target Milestone: 1.4 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Rüdiger Herrmann CLA 2010-11-29 14:04:46 EST
In SWT the Display issues an SWT#Settings event if settings such as theme, font, or default colours are changed.
Since in RAP, currently, none of the above can be changed within a session, this event could be implemented as a no-op.
Comment 1 Ivan Furnadjiev CLA 2010-12-20 04:05:28 EST
Changes are in CVS HEAD.
Comment 2 Rüdiger Herrmann CLA 2010-12-21 07:25:29 EST
In class Display, there is now a settingsListener field that holds all listeners for the Settings event. However, the event is never actually fired. Is that intentionally?
Comment 3 Ivan Furnadjiev CLA 2010-12-21 07:51:37 EST
As you mention in the description, currently is not possible to change the theme ( system colors, system font ) within a session. That's why the SWT.Settings event is never fired (implemented as no-op), but the infrastructure (add/remove listener) is there. Once, the switch theme in runtime is supported, we need only to fire the event in the proper place.
Comment 4 Ralf Sternberg CLA 2010-12-21 11:56:19 EST
I was thinking that if the event field exists, it should also work to notify attached listeners using Widget#notifyListeners(). But this would only work if we created an internal typed event. I think we should either provide for this unlikely case or otherwise drop the dead code.
Comment 5 Ivan Furnadjiev CLA 2010-12-21 12:05:50 EST
SWT.Settings event can be attached only to Display, not to the Widget. It's not possible to trigger it manually.
Comment 6 Ivan Furnadjiev CLA 2010-12-21 12:58:40 EST
The settingsListeners list is removed from Display, as currently it is useless.