Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Selection Service
Selection Service [message #692495] Mon, 04 July 2011 15:12 Go to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
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 18:34 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
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 06:37 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
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: Fri Apr 19 12:48:18 GMT 2024

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

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

Back to the top