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

Bug 373770

Summary: Display.setFocusControl implementation causing WIDGET DISPOSED error
Product: [RT] RAP Reporter: Amandeep Chahal <amandeep.chahal>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amandeep.chahal, ivan
Version: 1.4   
Target Milestone: 1.5 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Amandeep Chahal CLA 2012-03-09 07:16:28 EST
Build Identifier: Version 3.7 Build id: 20110615-0604

Implementation of Display.setFocusControl is leading to a WIDGET DISPOSED error if the control is disposed in the FOCUS_LOST event.


FocusEvent event = new FocusEvent( currentFocusControl, FocusEvent.FOCUS_LOST );
event.processEvent();
currentFocusControl.getShell().updateDefaultButton( currentFocusControl, false);


In 'event.processEvent' my FOcusLost event disposes the control and 'currentFocusControl.getShell()' throws a WIDGET DISPOSED error.

Reproducible: Always

Steps to Reproduce:
1. Add FocusLost listener for a control
2. Dispose the control in this
3. WIDGET_DISPOSED error is thrown in Display.setFocusControl
Comment 1 Ivan Furnadjiev CLA 2012-03-09 10:19:41 EST
Fixed in Display#setFocusControl by getting the shell before fire the focus event. JUnit test added.