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

Bug 376640

Summary: eliminate the multiple rendering calls when updating the toolbar for command contributions
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: simon_kaegi
Version: 0.5   
Target Milestone: 0.5 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2012-04-12 12:43:00 EDT
We currently render the toolbar for each command extension (orion.edit.command, orion.navigate.command) that we process.  I think this is no longer necessary.  There was a time (0.3?) when service retrieval was asynchronous, so we were rerendering the toolbar whenever a contribution was processed and ready.

I don't think is necessary anymore for two reasons:
1) service retrieval is now synchronous.  We don't try to run a service until a command is executed anyway.
2) the command creation properties are all properties in the registry.  So it's likely we don't even need to bother retrieving a service until the user actually invokes the command.

If for some reason it still needs to be synchronous, we could use a DeferredList to ensure we just render the toolbar when all contributions have been processed.
Comment 1 Susan McCourt CLA 2012-04-12 12:43:37 EDT
I would like to investigate this for M1 but it might slip to M2.
Comment 2 Susan McCourt CLA 2012-04-12 13:07:49 EDT
Somewhat related.
In bug 376542, we were failing in the command rendering because we didn't have editor metadata yet.  So for editor commands, we should ensure we don't bother buiding command contributions from the registry until we know we have metadata to validate against.
Comment 3 Susan McCourt CLA 2012-05-11 17:06:38 EDT
I did the navigator part of this, there was no reason at all to update the nav tools until the service extensions were processed.  It's all synchronous now.
Comment 4 Susan McCourt CLA 2012-05-15 17:03:05 EDT
Updated the editor.
We were previously rendering when:
1 - we were first created
2 - once for each extension command found
3 - again when we got the metadata

Eliminated (1) since it makes no sense to check commands before we have metadata to validate against.
Collapsed (2) to the end of the extension processing, now that we aren't running a service implementation anymore.  Further, we don't bother if we still don't have metadata.
(3) is the one we need.

So, with three editor commands installed, we went from 5 renderings of the toolbar commands to 1.  Note that those first 4 bail out very quickly, so it wasn't a huge time cost, but it was really painful to debug toolbar rendering when you had to step through so much unnecessary calling.