Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ACTIVE SELECTION PROVIDER PROBLEM!!!!!!!!
ACTIVE SELECTION PROVIDER PROBLEM!!!!!!!! [message #189478] Wed, 27 July 2005 15:44 Go to next message
Eclipse UserFriend
Originally posted by: dakanalis.ced.tuc.gr

Hello,

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. I used
the following code in order to fix that problem :

((AbstractSelectionService)editor.getSite().getWorkbenchWind ow().getSelectio
nService()).partInputChanged(editor);

It works but only with the 3.0 version of the eclipse. The problem is that
the AbstractSelectionService is in the package org.eclipse.ui.internal which
has changed in the 3.1 version.

Is there any other way to update the active selection provider for my
editor?
Re: ACTIVE SELECTION PROVIDER PROBLEM!!!!!!!! [message #189509 is a reply to message #189478] Wed, 27 July 2005 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Are you not using the MultiPageEditorPart?

How about you write your own selection provider that will listen for changes
to both viewers and knows which the active one is? Then you don't have to
change the SelectionProvider when changing tabs.

"Themis" <dakanalis@ced.tuc.gr> wrote in message
news:dc8a4n$b15$1@news.eclipse.org...
> Hello,
>
> 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. I
used
> the following code in order to fix that problem :
>
>
((AbstractSelectionService)editor.getSite().getWorkbenchWind ow().getSelectio
> nService()).partInputChanged(editor);
>
> It works but only with the 3.0 version of the eclipse. The problem is that
> the AbstractSelectionService is in the package org.eclipse.ui.internal
which
> has changed in the 3.1 version.
>
> Is there any other way to update the active selection provider for my
> editor?
>
>
>
Re: ACTIVE SELECTION PROVIDER PROBLEM!!!!!!!! [message #189523 is a reply to message #189478] Wed, 27 July 2005 17:02 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Themis" <dakanalis@ced.tuc.gr> wrote in message
news:dc8a4n$b15$1@news.eclipse.org...
> Hello,
>
> 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() );

Debug into how this method is implemented. If it doesn't query the new
provider for its selection and notify listeners that it has changed, open A
BUG against platform UI!!!!!!!!!!

>
> 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. I
> used
> the following code in order to fix that problem :
>
> ((AbstractSelectionService)editor.getSite().getWorkbenchWind ow().getSelectio
> nService()).partInputChanged(editor);
>
> It works but only with the 3.0 version of the eclipse. The problem is that
> the AbstractSelectionService is in the package org.eclipse.ui.internal
> which
> has changed in the 3.1 version.
>
> Is there any other way to update the active selection provider for my
> editor?
>
>
>
Previous Topic:java.lang.ExceptionInInitializerError with PaletteView
Next Topic:How to edit multiple fields from a ViewPart
Goto Forum:
  


Current Time: Fri Apr 26 10:04:47 GMT 2024

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

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

Back to the top