Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Selection Service
Selection Service [message #692495] Mon, 04 July 2011 11:12 Go to next message
Eclipse UserFriend
Hi all,

I subscribe to the selection service using:

getSite().getPage().addSelectionListener(String id ,ISelectionListener listener);


This works fine as long as my GMF editor is not already open when Eclipse opens. I did set a breakpoint and found out that the editor is registering. When closing and reopening the editor this is fixed. How can I get around this behaviour?

Ralph
(no subject) [message #692565 is a reply to message #692495] Mon, 04 July 2011 14:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ralph,

Set the listener on a spot that gets visited when the editor is opened. A
good place is the editors createPartControl method.

Regards,

Wim


> Hi all,
>
> I subscribe to the selection service using:
>
>
> getSite().getPage().addSelectionListener(String id ,ISelectionListener
listener);
>
>
> This works fine as long as my GMF editor is not already open when Eclipse
opens. I did set a breakpoint and found out that the editor is registering.
When closing and reopening the editor this is fixed. How can I get around
this behaviour?
>
> Ralph
Re: (no subject) [message #692736 is a reply to message #692565] Tue, 05 July 2011 02:37 Go to previous message
Eclipse UserFriend
Hi,

adding the view as selection changed listener in the editor's plugin would violate the principle of loose coupeling. Is there no way to achieve this in the view's plugin? I have the code in the views createPart method. But somehow it must be related to Eclipse, because it only works when closing and opening the editor if it was open when eclipse started.

Ralph
Previous Topic:Declarative lightweight decorator
Next Topic:Unable to locate installable unit org.eclipse.ui.views
Goto Forum:
  


Current Time: Sun Aug 31 05:22:20 EDT 2025

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

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

Back to the top