Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 130773 - Selection event fired twice when select in XML editor
Summary: Selection event fired twice when select in XML editor
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Nick Sandonato CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 117869
  Show dependency tree
 
Reported: 2006-03-07 14:02 EST by Amy Wu CLA
Modified: 2010-07-27 17:33 EDT (History)
0 users

See Also:


Attachments
Bug Fix Patch (2.78 KB, patch)
2009-09-15 11:38 EDT, Aidyl Kareh CLA
no flags Details | Diff
patch (3.94 KB, patch)
2010-07-27 17:18 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Wu CLA 2006-03-07 14:02:53 EST
When user is in XML editor's source page, and user changes selection, a selection event is fired.  Then the selection is updated in the design page, which then, in turn, fires another selection event.  And vice versa.

This means selection listeners such as outline & properties view are being notified/refreshed twice.

Not only is selection fired twice, but the last selection event fired is a selection from the inactive page.  So for example, Convert Line Delimiters does not work in the XML editor's source page because it is notified of the XML editor's design page selection, which is a TreeSelection. But it does work on the XML editor's design page because it is notified of the XML editor's source page ITextSelection.
Comment 1 Aidyl Kareh CLA 2009-09-15 11:38:06 EDT
Created attachment 147213 [details]
Bug Fix Patch

Modified code so that the listeners of the XML designer page are not called when the page is inactive. These changes lower the amount of times the properties and outline views are updated.
Comment 2 Aidyl Kareh CLA 2009-09-18 15:55:54 EDT
Bug 117869 which was blocked by this defect (bug 130773) seems to also be solved by this patch. Please verify this bug as well.
Comment 3 Nick Sandonato CLA 2010-07-27 17:18:59 EDT
Created attachment 175359 [details]
patch

I think this patch might be a little safer.
Comment 4 Nick Sandonato CLA 2010-07-27 17:33:59 EDT
Fixes checked into HEAD.