| Summary: | [RoR] Single source untyped event Listener adding / removal in Riena | ||
|---|---|---|---|
| Product: | [RT] Riena | Reporter: | Elias Volanakis <elias> |
| Component: | ridget | Assignee: | Elias Volanakis <elias> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | christian.campo, juergen.becker |
| Version: | unspecified | ||
| Target Milestone: | 3.0.0 | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 302893 | ||
Resolved in HEAD. |
There is a difference between typed / untyped listener treatment in SWT / RWT. In SWT typed listeners are wrapped into untyped ones, and are equivalent: text.addVerifyListener(vl); Listener[] listeners = text.getListeners(SWT.Verify); // 1 entry text.removeListener(listener[0]); In RWT typed listeners and untyped listeners are disjunct and not treated as equivalent. text.addVerifyListener(vl); Listener[] listeners = text.getListeners(SWT.Verify); //0 entries text.removeListener(listener[0]); // fail There is internal code to get the same effect: text.addVerifyListener(vl); VerifyListener[] listeners2 = (VerifyListener[]) VerifyEvent.getListeners(text); // 1 entry for(VerifyListener lsnr : listeners2) { VerifyEvent.removeListener(text, lsnr); } The following classes are affected and might need review / adjustment - NumericTextRidget - TextRidget - AbstractSWTWidgetRidget - TestUtils (though we don't run this on RAP) - CompletionCombo -- already fixed by me a few months ago :) The equivalent in RWT uses internal code: