ActiveSelectionProvider [message #189715] |
Thu, 28 July 2005 15:57 |
Eclipse User |
|
|
|
Originally posted by: dakanalis.ced.tuc.gr
I have developed a GEF based graphical editor and I have the following
problem:
The editor is consisted of two tabs.Each tab is a GraphicalViewer. Every
time I switch between the two tabs a listener does the following:
editor.setGraphicalViewer( editor.getGraphicalViewer() );
editor.getSite().setSelectionProvider( editor.getGraphicalViewer() );
The problem is that the active selectionProvider does not change, so when I
try to select an editpart in the second viewer the selection is null.
The selectionProvider on the site has changed and the
getSelectionProvider method returns the right provider but when I select
something on the graphical area the selection is null. After some debuging I
found that there is an activeProvider field in the class
AbstractSelectionService in the package org.eclipse.ui.internal. So, despite
the fact that the selectionProvider has changed, the activeProvider is null.
The Editor part uses that field in order to find the selection. I guess that
in that way a part can have some providers but only one of them can be
active.When I tried to find a way to change the activeProvider I found that
this can be made by the method partInputChanged of the class
AbstractSelectionService:
((AbstractSelectionService)editor.getSite().getWorkbenchWind ow().getSelectio
nService()).partInputChanged(editor);
In the new version of the eclipse (3.1) that method does not exist.
|
|
|
Re: ActiveSelectionProvider [message #189776 is a reply to message #189715] |
Fri, 29 July 2005 14:57 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Didn't we already answer this question? Was there something you didn't
understand?
"Themis" <dakanalis@ced.tuc.gr> wrote in message
news:dcav9a$a20$1@news.eclipse.org...
> I have developed a GEF based graphical editor and I have the following
> problem:
>
> The editor is consisted of two tabs.Each tab is a GraphicalViewer. Every
> time I switch between the two tabs a listener does the following:
>
> editor.setGraphicalViewer( editor.getGraphicalViewer() );
>
> editor.getSite().setSelectionProvider( editor.getGraphicalViewer() );
>
> The problem is that the active selectionProvider does not change, so when
I
> try to select an editpart in the second viewer the selection is null.
>
> The selectionProvider on the site has changed and the
> getSelectionProvider method returns the right provider but when I select
> something on the graphical area the selection is null. After some debuging
I
> found that there is an activeProvider field in the class
> AbstractSelectionService in the package org.eclipse.ui.internal. So,
despite
> the fact that the selectionProvider has changed, the activeProvider is
null.
> The Editor part uses that field in order to find the selection. I guess
that
> in that way a part can have some providers but only one of them can be
> active.When I tried to find a way to change the activeProvider I found
that
> this can be made by the method partInputChanged of the class
> AbstractSelectionService:
>
>
((AbstractSelectionService)editor.getSite().getWorkbenchWind ow().getSelectio
> nService()).partInputChanged(editor);
>
> In the new version of the eclipse (3.1) that method does not exist.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03167 seconds