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

Bug 373357

Summary: [Protocol] Consider to omit destroy operations for children of destroyed widget
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: rsternberg, tbuschto
Version: 1.5   
Target Milestone: 2.0 M4   
Hardware: All   
OS: All   
Whiteboard: protocol

Description Tim Buschtoens CLA 2012-03-06 07:50:33 EST
Currently if a shell or any composite is destroyed, there is a destroy operation for each child of composite. This is redundant, as the client can destroy all the children itself (it actually already does). So the destroy operations are only bloating the message, and in case of destroying a composite while creating another one, it also slows things down a bit. 

I suggest to implement the convention that for SWT-Widgets, all children of a destroyed parent are also destroyed implicitly. 

This would also help implementing animations or some performance tweaks.
Comment 1 Ralf Sternberg CLA 2012-10-23 09:14:44 EDT
+1, this fits with SWT's rules for disposing widgets. There doesn't seem to be a use for the redundant destroy operations.
Comment 2 Tim Buschtoens CLA 2012-10-23 09:22:21 EDT
For the WebClient, the only issue is to remove the widgets from the ObjectRegistry. One possible solution would be for the destructor given in the protocol adapter to return a list of ids that should also be destroyed by the processor.
Comment 3 Tim Buschtoens CLA 2012-11-21 12:05:29 EST
With commit 52d60d1743aa4bc315416f9cf7608e97e11244b6 the protocol adapter support a method "getDestroyableChildren" which, when implemented, have to return an array with client objects which also are to be destroyed. Currently these children are not allowed to also be destroyed by the server after that, since it's not longer in the ObjectRegistry. I'm not sure if destroying an client object twice should fail silently or not.
Comment 4 Tim Buschtoens CLA 2012-11-26 07:31:11 EST
Fully implemented with commit 7ffcff004936b93f4d62e4b58d9db92ecd10b182.

Exception: Menu. Since the menu's parent is not always rendered, the destroy operation for menu is currently still always rendered. This is true for Menu Bar, Drop-down menus and popup menus. Menu Items are destroyed with their menu however. A destroy operation for a wigdet that has been destroyed implicitly will crash the client.