Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » SWITCH SELECTION PROVIDER PROBLEM!!!
SWITCH SELECTION PROVIDER PROBLEM!!! [message #289088] Thu, 28 July 2005 15:08 Go to next message
Eclipse UserFriend
Originally posted by: dakanalis.ced.tuc.gr

Hi,

I try to develop a graphical editor with two graphical viewers. I have
implement a listener in order to initialize the editor each time I switch
between the two viewers. Inside that listener I want to set as selection
provider of the editor the current viewer each time. For that purpose I use
the following code:
editor.getSite().setSelectionProvider( currentViewer );
The problem is that when I try to select a part in the second viewer, the
selection is null because the selectionprovider has not change.Of course the
selectionProvider on the site has changed and the getSelectionProvider
method returns the right provider but when I select something in the
graphical area the selection is null. I managed to fix that problem by using
the method partInputChanged of the class AbstractSelectionService, but that
class it belongs in the org.eclipse.ui.internal package.

What I want is to find a way to update the selection provider of my editor
each time I switch between the two viewers without to use anything from the
internal package. Is thos possible? Any Idea?


Thanks
Re: SWITCH SELECTION PROVIDER PROBLEM!!! [message #289232 is a reply to message #289088] Tue, 02 August 2005 12:04 Go to previous message
Eclipse UserFriend
Originally posted by: ""t.s.maedert.s.maeder\"..hispeedhispeed.chch"

Dakanalis wrote:
> Hi,
>
> I try to develop a graphical editor with two graphical viewers. I have
> implement a listener in order to initialize the editor each time I switch
> between the two viewers. Inside that listener I want to set as selection
> provider of the editor the current viewer each time. For that purpose I use
> the following code:
> editor.getSite().setSelectionProvider( currentViewer );
> The problem is that when I try to select a part in the second viewer, the
> selection is null because the selectionprovider has not change.Of course the
> selectionProvider on the site has changed and the getSelectionProvider
> method returns the right provider but when I select something in the
> graphical area the selection is null. I managed to fix that problem by using
> the method partInputChanged of the class AbstractSelectionService, but that
> class it belongs in the org.eclipse.ui.internal package.
>
> What I want is to find a way to update the selection provider of my editor
> each time I switch between the two viewers without to use anything from the
> internal package. Is thos possible? Any Idea?
>
>
> Thanks
>
>
>

As I understand it, you want the editor to take the selection from the
currently active view? Why don't you just listen to selection changes
from the workbench window's selection service (see
IWorkbench.getSelectionService()).

Thomas
Previous Topic:thin client / jface / menus
Next Topic:Help with editor plug-in for eclipse
Goto Forum:
  


Current Time: Wed May 07 17:34:16 EDT 2025

Powered by FUDForum. Page generated in 0.03415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top