Bug 181149 - selectionChanged(...) invoked twice.
Summary: selectionChanged(...) invoked twice.
Status: RESOLVED DUPLICATE of bug 181148
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL: http://http://www.pragmatic.co.kr/QWE...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-05 04:32 EDT by Sung Ahn Kim CLA
Modified: 2007-04-05 06:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sung Ahn Kim CLA 2007-04-05 04:32:29 EDT
Build ID: M20070212-1330

Steps To Reproduce:
1. Create two views with viewers to produce ISelection (StructuredSelection). Call them "View1" and "View2" respectively.

2. In "view2", register its viewer as selection provider.
- "getSite().setSelectionProvider(viewer);"

3. In "view1", implements ISelectionListener and add lister to page.
- "getSite().getPage().addSelectionListener(this);"
- "getSite().getPage().addSelectionListener(View2.ID, this);" // don't use this. it works correctly.

4. run the application.
5. Select an element of view2's viewer. It works correctly.
7. select view1. (deactivate view2)
8. and select different element of view2's viewer.
9. selectionChanged(...) of view1 invoked twice. Once in activation of view2, and selection of new element.

10. But, when i register listener to a specific view.
- getSite().getPage().addSelectionListener(View2.ID, this);

11. It don't invoke selectionChanged(...) when view2 is reactivated. It works correctly.

12. Both of them should produce same results.
- "getSite().getPage().addSelectionListener(this);"
- "getSite().getPage().addSelectionListener(View2.ID, this);"

More information:

Sorry for my bad English. You can get the working example of this bug from:

- http://www.pragmatic.co.kr/QWERT.zip
Comment 1 Paul Webster CLA 2007-04-05 06:11:17 EDT

*** This bug has been marked as a duplicate of bug 181148 ***