Bug 181148 - [OpenModes] selectionChanged(...) invoked twice.
Summary: [OpenModes] selectionChanged(...) invoked twice.
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL: http://http://www.pragmatic.co.kr/QWE...
Whiteboard:
Keywords:
: 181149 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-05 04:32 EDT by Sung Ahn Kim CLA
Modified: 2019-09-06 16:04 EDT (History)
1 user (show)

See Also:


Attachments
Example about reported bug. (15.76 KB, application/zip)
2007-04-05 10:33 EDT, Sung Ahn Kim CLA
no flags Details

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:18 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
*** Bug 181149 has been marked as a duplicate of this bug. ***
Comment 2 Boris Bokowski CLA 2007-04-05 09:53:10 EDT
Could you please attach the example to this bug? For legal reasons, we cannot download code from other places.  (By attaching something to a bugzilla entry, you license it under the EPL.)
Comment 3 Sung Ahn Kim CLA 2007-04-05 10:33:27 EDT
Created attachment 63037 [details]
Example about reported bug.

I've attached the example file. (Sorry, I don't about this functionality.) It is a very simple example with two views.

You may simply change comment statement on line 69 and 70 of src\qwert\View.java

And you can get the difference.
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:04:35 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.