Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331082 - Event.data lost when use event object to construct a SelectionEvent object
Summary: Event.data lost when use event object to construct a SelectionEvent object
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 1.4 M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-25 00:34 EST by flashcloud CLA
Modified: 2010-12-07 04:21 EST (History)
0 users

See Also:


Attachments
Without the prior fixes, can only do so temporarily (19.36 KB, patch)
2010-11-25 03:43 EST, flashcloud CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.