Community
Participate
Working Groups
To reproduce: 1. Marker Demo in SWT Playground 2. Check the "hidden" checkbox
Created attachment 156492 [details] Patch that fixes the bug The date picker was not hidden completely because DateTextRidget's getUIControl() method always returned its Text widget. Therefore only the Text widget was hidden, but not the button for the dropdown calendar. Simply overriding setVisible(boolean) in DateTextRidget does not work because setting a ridget's visibility in fact only sets a hidden marker. The visibility changes are applied in a second step, and here the ridget's getUIControl() is invoked to fetch the control to hide - see BasicMarkerSupport.updateUIControl(). The patch I am attaching addresses the issue as follows: * TextRidget's existing getTextWidget() method is made protected (was private). * DateTextRidget overrides this method, returning the Text widget contained in the DatePickerComposite. * TextRidget uses getTextWidget() instead of getUIControl() wherever binding is concerned: forceTextToControl(String), [un]bindUIControl(). In effect, for binding concerns the Text widget is used, for other concerns (e.g. visibility) the ridget-wrapped control proper, i.e. Text for the TextRidget, DatePickerComposite for the DateTextRidget. Hope this helps. Comments welcome.
Created attachment 156614 [details] Test cases covering the changes introduced by previous attachment. The test cases require the patch to be applied first, because getTextWidget() originally is private.
Just discovered that my fix breaks 2 tests in MarkableRidgetTest. I'm looking into it.
Created attachment 156670 [details] Adds resetPropertyChangeEvents() calls to the end of problematic tests; also cleans up egregious assertEquals(true, ...) Turns out the new bug did NOT have anything to do with the previous patches. Instead, an unrelated bugfix committed this morning (!) had not been mirrored to the pserver repository yet! The changes should have arrived on the pserver mirror by tomorrow, so I will check again then and report my findings here. == Submitted patch ======= To avoid future problems with EasyMock still expecting certain method calls at tearDown(), I added a call to resetPropertyChangeEvents() to the end of the two failing tests in MarkableRidgetTest. The patch also replaces some instances of incredible assertEquals(true, condition) calls with a proper asssertTrue(condition) ...
(In reply to comment #4) I re-checked, the tests pass, and everything looks fine.
Committed. Thanks Yang!