RFR: 7131166: SynthListUI / SynthInternalFrameTitlePane updateStyle() ignores method argument
Prasanta Sadhukhan
psadhukhan at openjdk.org
Wed Jan 11 05:36:12 UTC 2023
On Mon, 9 Jan 2023 16:51:34 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> > I dont think there is any difference between passing method argument vis-a-vis this as I think both point to same object..
>
> Are you sure that it is always the same? Right now we ignore the component passed from the SynthListUI.propertyChange() and use list, after the change we will use the source of the event, I think that could be tested.
Actually, component argument passed to updateStyle() points to widget and "this" actually points to the UI delegate.
For ex as seen in SwingSet2
for JTable widget, "c" points to JTable and "this" points to SynthTableUI
for TabbedPane, "c" points to JTabbedPane and "this" points to SynthTabbedPaneUI
for SplitPanedemo , "c" points to JSplitPane and "this" points to SynthSplitPaneUI
for SLider "c" points to JSIlder and "this" points to SynthSliderUI
Similarly, for List Demo in SwingSet2, "c" points to JList and "this" points to SynthListUI
And regarding the other point of using "source of the event" from propertyChange() for SynthList for this fix,
this is what is being used for all other widgets too like below and am not sure how this can be tested
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTableUI.java#L708
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSliderUI.java#L894
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java#L248
etc to list a few
-------------
PR: https://git.openjdk.org/jdk/pull/11875
More information about the client-libs-dev
mailing list