Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333120 - Field time not set by MouseEvent( Event ) ctor
Summary: Field time not set by MouseEvent( Event ) ctor
Status: CLOSED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.4 M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-22 17:35 EST by Ralf Sternberg CLA
Modified: 2010-12-23 16:24 EST (History)
0 users

See Also:


Attachments

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