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

Bug 312064

Summary: Search for handler method using exact widget type
Product: [Technology] XWT Reporter: Konstantin Scheglov <Konstantin.Scheglov>
Component: CoreAssignee: Project Inbox <e4.xwt-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: yves.yang
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Patch with better search
none
Patch with better search john.arthorne: iplog+

Description Konstantin Scheglov CLA 2010-05-07 09:59:55 EDT
Build Identifier: lastest from CVS

Would be nice to use exact type of widget, because this method is searched using reflection. So, code like this would work.

	protected void clickButton(Button button, Event event) {
		//Button button = (Button) event.widget;
		button.setText("Hello, world!");
	}


Reproducible: Always
Comment 1 Konstantin Scheglov CLA 2010-05-07 10:01:50 EDT
Created attachment 167474 [details]
Patch with better search
Comment 2 Konstantin Scheglov CLA 2010-05-08 09:58:59 EDT
Created attachment 167601 [details]
Patch with better search

This patch also includes check for IXWTLoader.DESIGN_MODE_ROPERTY to prevent applying events at design time. I need this because when I add new event handler at design time we update both Java and XWT file, and Java file (with new method) is not compiled yet, so this causes error in log.

BTW, would be good to fix spelling of DESIGN_MODE_ROPERTY constant.
Comment 3 Yves YANG CLA 2010-05-22 12:01:04 EDT
Committed for 1.0 M6