Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312064 - Search for handler method using exact widget type
Summary: Search for handler method using exact widget type
Status: RESOLVED FIXED
Alias: None
Product: XWT
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 09:59 EDT by Konstantin Scheglov CLA
Modified: 2013-01-24 15:31 EST (History)
1 user (show)

See Also:


Attachments
Patch with better search (887 bytes, patch)
2010-05-07 10:01 EDT, Konstantin Scheglov CLA
no flags Details | Diff
Patch with better search (1.20 KB, patch)
2010-05-08 09:58 EDT, Konstantin Scheglov CLA
john.arthorne: iplog+
Details | Diff

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