view and multiple viewers [message #332867] |
Tue, 11 November 2008 12:01  |
Eclipse User |
|
|
|
Hi all
I have got a view which use a table viewer and a tree viewer . both this
component are inside a PShelfItem (from nebula)
What I need is to set the view selection provider accordingly with the
active viewer . I have done this adding a selection listener to the PShell .
So depending on the selected Shelf Item I set the view selection provider .
The point is . with the debug everything looks fine . but the other view,
the one listening for selection, gets only the selection coming from the
first provider I set in the other view.
If I'm not wrong a view can have only one selection provider active at the
time ...
Am I doing something wrong?
Thanks
Kar
|
|
|
|
|
|
|
|
Re: view and multiple viewers [message #332883 is a reply to message #332882] |
Wed, 12 November 2008 04:40  |
Eclipse User |
|
|
|
Thanks Tom ... this worked ...
actually reading a bit better the article on the selection I found this ...
--- Multiple Selection Providers Within a Part ---
Be aware that the part's site accepts a single selection provider only,
which should be registered within the createPartControl() method only:
getSite().setSelectionProvider(provider);
Replacing the selection provider during the lifetime of the part is not
properly supported by the workbench. If a part contains multiple viewers
providing selections, like the "Java Hierarchy" view does, a intermediate
ISelectionProvider implementation has to be provided that allows dynamically
delegating to the currently active viewer within the part. As a starting
point you may look into SelectionProviderIntermediate.java provided with
this article.
Thanks again
Ciao
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:gfe6e6$d8k$1@build.eclipse.org...
> Hi,
>
> Why not registering your own instance of ISelectionProvider mediating
> between the 2 internal ones.
>
> This way you don't have to replace the selection provider?
>
> Tom
>
> Prakash G.R. schrieb:
>> Well, I can't comment on a code which I didn't see :-) Is it possible to
>> share the code? At least, can you put a breakpoint at the point where
>> you set the view's selection provider and make sure that line executes?
>>
>> - Prakash
>
>
> --
> B e s t S o l u t i o n . at
> ------------------------------------------------------------ --------
> Tom Schindl JFace-Committer
> ------------------------------------------------------------ --------
|
|
|
Powered by
FUDForum. Page generated in 0.08177 seconds