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

Bug 333120

Summary: Field time not set by MouseEvent( Event ) ctor
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.4   
Target Milestone: 1.4 M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ralf Sternberg CLA 2010-12-22 17:35:25 EST
Test snippet:

    Button button = new Button( shell, SWT.PUSH );
    button.addMouseListener( new MouseAdapter() {
      public void mouseDown( MouseEvent event ) {
        assertEquals( 4711, event.time );
      }
    } );
    Event event = new Event();
    event.time = 4711;
    button.notifyListeners( SWT.MouseDown, event );
Comment 1 Ivan Furnadjiev CLA 2010-12-23 03:19:16 EST
Just a note... In RAP time field is a field in MouseEvent class, but in SWT it is a TypedEvent filed. Maybe we can consider to move this field in TypedEvent class like in SWT and fix the bug in TypedEvent ctor for all events like:
public TypedEvent(Event e) {
	super(e.widget);
	this.display = e.display;
	this.widget = e.widget;
	this.time = e.time;
	this.data = e.data;
}
Comment 2 Ralf Sternberg CLA 2010-12-23 16:23:03 EST
(In reply to comment #1)
> Just a note... In RAP time field is a field in MouseEvent class, but in SWT it
> is a TypedEvent filed. Maybe we can consider to move this field in TypedEvent
> class like in SWT and fix the bug in TypedEvent ctor for all events like:

Right, there's already a bug for this: bug 332976
Comment 3 Ralf Sternberg CLA 2010-12-23 16:24:16 EST
Fixed in CVS HEAD. See MouseEvent ctor.