Community
Participate
Working Groups
I have a requirement to notify a View when the selection changes in any instance of a particualr editor. The editor contains a jface Viewer which is the natural selection provider. I register each editor's viewer with the site, using code of the form: getSite().setSelectionProvider(myViewer); I make this call in my editor's "createPartControl()" method (i.e. when the viewer is created); I have tried writing a proxy that allows this registration to be done in the "init()" method - but with no change to the symptoms described below. In my View, I have registered a listener to handle events from my editor(s), thus: getSite().getPage().addSelectionListener(mySelectionListener); The issue I have is that if I specify a typeId as the first parameter for the "addSelectionListener()" method, then I *only* seem to get events for the most recently created editor instance. However, if I do not give a typeId then I get events for all instances (which is what I want). This would be fine, since I can always filter on the class of the IWorkbenchPart that gets passed into my handler. However, this does not work for the null case (which I also need to process). In this case I can't test the part because it is null (natch!). However in the case of the null handler the registration process seems to work correctly when I give the optional typeId in the call to "addSelectionListener()" - though only for null events. My workaround is to register two handlers - one with no typeId specified to process 'normal' events (doing hand-written filtering), and a special null handler which is registered using a typeId and which *only* processes null events. Note: my original handler implemented the INullHandler interface, since I wanted it to process both normal and null events.
Is this still a problem in 3.3? PW
Changes requested on bug 193523
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.