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

Bug 331082

Summary: Event.data lost when use event object to construct a SelectionEvent object
Product: [RT] RAP Reporter: flashcloud <flashcloud163>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2    
Version: 1.3   
Target Milestone: 1.4 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Without the prior fixes, can only do so temporarily none

Description flashcloud CLA 2010-11-25 00:34:50 EST
code e.g:

public class ExtendComponent extends Composite {

   ...

   public void select(){
      ...

      // Send selection event to the listeners
	Event event	= new Event();
	event.data	= myObject;
	notifyListeners(SWT.Selection, event);
   }
  
   ...
}

myObject lost in Listener of Selection!!

in org.eclipse.swt.events.SelectionEvent:
  public SelectionEvent( final Event e ) {
    this( e.widget,
          e.item,
          e.type,
          new Rectangle( e.x, e.y, e.width, e.height ),
          e.stateMask,
          e.text,
          e.doit,
          e.detail );
  }

no e.data!!

it`s a bug?
Comment 1 Ivan Furnadjiev CLA 2010-11-25 01:41:07 EST
Yes... Looks like a bug.
Comment 2 flashcloud CLA 2010-11-25 03:43:35 EST
Created attachment 183834 [details]
Without the prior fixes, can only do so temporarily
Comment 3 Ivan Furnadjiev CLA 2010-12-07 04:21:27 EST
Fixed in CVS HEAD.