Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Question regarding ESelectionService
Question regarding ESelectionService [message #735427] Tue, 11 October 2011 18:50 Go to next message
Thomas Blattner is currently offline Thomas BlattnerFriend
Messages: 5
Registered: July 2010
Junior Member
Hello,

I have a e4 part displaying data in a table. If I click on an element, I would like to open another e4 part depending on the concrete model implementation behind the selection etc.

Therefore I have created a controller class in my app (it get's created and can be injected through an Addon etc.). I inject the ESelectionService there and now I tried several ways to get notified about selection. First through the standard @Inject...ACTIVE_SELECTION, which did not work. The method was called only once the controller was created.

At second I tried to register an SelectionListener on the ESelectionService . I figured out that the concrete implementation is of type ApplicationSelectionServiceImpl in my case and attaching a listener there throws an UnsupportedOperationException.

My main question now is, what is the best way in E4 to do, what I would like to do. For sure there would be solutions like attach a selection listener to the viewer and handle selections directly there etc. But is this still best practice?

Thanks for any hints.

Best regards
Thomas
Re: Question regarding ESelectionService [message #736188 is a reply to message #735427] Thu, 13 October 2011 18:54 Go to previous messageGo to next message
Thomas Blattner is currently offline Thomas BlattnerFriend
Messages: 5
Registered: July 2010
Junior Member
In the meantime I had a look on the e4.simpleide example. There is implemented what I have been looking for. It is done using an OpenListener and a manual command handler execution.

This is fine for me.
Re: Question regarding ESelectionService [message #739480 is a reply to message #736188] Mon, 17 October 2011 14:18 Go to previous messageGo to next message
Christian Hanster is currently offline Christian HansterFriend
Messages: 22
Registered: March 2011
Junior Member
In my Application I have also a table with data and a part which should be updated when the selected data changed. I do it with the E4 selectionService (@Inject public void setPerson(@Optional @Named(IServiceConstants.ACTIVE_SELECTION)) and it works fine. Perhaps you have a look in the tutorial of Tom Schindl (http://tomsondev.bestsolution.at/2010/07/28/eclipse-4-0-and-tutorial-on-writing-e4-rcp-application-released/) on page 25 and page 26 or in the tutorial of Lars Vogel (http://www.vogella.de/articles/EclipseE4/article.html)

Christian
Re: Question regarding ESelectionService [message #740604 is a reply to message #735427] Tue, 18 October 2011 17:51 Go to previous message
Thomas Blattner is currently offline Thomas BlattnerFriend
Messages: 5
Registered: July 2010
Junior Member
Thanks.

But in my case I need to dynamically decide which Part to be opened depending on the concrete instance of the selected element in the viewer.

But it's already sorted out. See my previous post.
Previous Topic:Making the e4 pojo programming model accessible from org.eclipse.ui extension points
Next Topic:Problem updating 4.1.1
Goto Forum:
  


Current Time: Fri Dec 19 08:55:06 GMT 2014

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

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