Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332819 - [RoR] Single source untyped event Listener adding / removal in Riena
Summary: [RoR] Single source untyped event Listener adding / removal in Riena
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.0.0   Edit
Assignee: Elias Volanakis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 302893
  Show dependency tree
 
Reported: 2010-12-17 02:09 EST by Elias Volanakis CLA
Modified: 2010-12-17 17:28 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Volanakis CLA 2010-12-17 02:09:42 EST
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:
Comment 1 Elias Volanakis CLA 2010-12-17 17:28:03 EST
Resolved in HEAD.