Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » SelectionProviders in RAP have strange behavior(Selection is always empty, strange notification behavior)
SelectionProviders in RAP have strange behavior [message #1042111] Tue, 16 April 2013 02:06 Go to next message
Mark Leone is currently offline Mark LeoneFriend
Messages: 69
Registered: April 2012
Member
I've been asked to provide a RAP implementation for an existing RCP app. The app has numerous Views, each with several viewers, and it uses the selection service to coordinate selections between designated viewers. There is a SelectionProvider delegate which the Views use to set the current selection provider when one of its viewers gains focus. And various Views listen to the selection service and react in accordance with what was selected. This works properly in RCP, but in RAP I'm seeing problems that I haven't encountered in other RAP apps.

On one View, items appear in the topmost viewer, and items aren't supposed to appear in other viewers until a selection is made in one of the viewers above. There are two items in the topmost viewer. When user selects one, the listener on the selection service receives the selection, but the selection is found to be empty. Furthermore, a separate View with a single viewer, listening to the selection service detects nothing.

But then if I make a different View active, its selection seems to work. The listener on the selection service detects a non-empty selection. And then when I go back to the first View, the selection is sort of working. The listeners on the selection service now detect a non-empty selection, but it is always the same item, even if the other item was selected.

I realize it sounds like the selection providers and listeners are just not wired up correctly, and maybe they aren't. But I spent the entire day looking through the code, and I don't see anything wrong. I carefully compared the implementation of selection providers and listeners between the View that seems to work and the one that only partly works after the other View has been made active, and I don't see any differences. Furthermore it works perfectly fine in RCP.

So I'm wondering if there is something I'm supposed to do different in RAP with respect to using the selection service. I've built apps in RAP before, but they were always 1.3 apps unti now. I'm using RAP 1.5 for this app. Is there perhaps something different required in RAP 1.5? Are there common (or not so common) inplementation errors that anyone can think of that might account for this behavior?
Re: SelectionProviders in RAP have strange behavior [message #1046811 is a reply to message #1042111] Mon, 22 April 2013 12:01 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Mark,

On 4/16/2013 5:06 AM, Mark Leone wrote:
> So I'm wondering if there is something I'm supposed to do different in
> RAP with respect to using the selection service. I've built apps in
> RAP before, but they were always 1.3 apps unti now. I'm using RAP 1.5
> for this app. Is there perhaps something different required in RAP
> 1.5? Are there common (or not so common) inplementation errors that
> anyone can think of that might account for this behavior?
I'm not aware of any RAP change related to the selection service
handling. Could you provide a simple snippet that demonstrate the
difference between RAP 1.3 and RAP 1.5?
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: SelectionProviders in RAP have strange behavior [message #1046994 is a reply to message #1042111] Mon, 22 April 2013 16:49 Go to previous message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

Mark,

You may already know this, but if you don't implement ViewPart#setFocus() properly then it can cause problems in RCP as well as RAP. The setFocus method should call setFocus on an appropriate control within your view. For instance, if you have a JFace TableViewer or TreeViewer, you should call something like viewer.getControl().setFocus().

Hope that helps,

Cole Markham
Previous Topic:How to restore UISession?
Next Topic:Custom JFace Dialogs LifeCyle
Goto Forum:
  


Current Time: Sat Apr 20 03:57:57 GMT 2024

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

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

Back to the top