| 
| SelectionProvider is not set in the WindowSelectionService [message #334587] | Thu, 19 February 2009 04:45  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 I'm designing a RCP application with views and editor parts. In some part,
 i'm using the SelectionService mechanism and i set SelectionProvider
 object on their site "getSite().setSelectionProvider(provider)".
 In a other hand, i'm using the "org.eclipse.ui.menus" to display popup
 menu with command. Each command refered to a
 "org.eclipse.core.expressions.definitions" extension point to test if we
 display the command or not. I use the expression "selection" and it seems
 to do not work correctly. At the initialization of the RCP, the
 "selection" is not updated and the item associated to the command is not
 displayed in the popup menu.
 I need to re-activate the part to make it work. I've seen that there are
 two SelectionService which are declared at the beginning :
 PageSelectionService and WindowSelectionService. The
 WindowSelectionService does not call its setActivePart() method at the
 initialization of the application so the provider is not set for this
 service. So the selection is not updated for the
 "org.eclipse.core.expressions.definitions" extension point. And i think
 it's the reason why it is not working properly but i might be wrong.
 
 If someone knows a way to make it work correctly without reactivating the
 part everytime we have to launch the application, i would appreciate it.
 
 Thanks.
 |  |  |  | 
|  | 
|  | 
|  | 
|  | 
| 
| Re: SelectionProvider is not set in the WindowSelectionService [message #334637 is a reply to message #334626] | Sat, 21 February 2009 03:53  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 I've used the "activeMenuSelection" and it works well, thanks you Paul and
 Tom. But i'm trying to understand how the "selection" works. I have a view
 with a viewer which contributes to the selection service as selection
 provider. And i have created another view which listens to this provider.
 I would like to display in this view the same menu items which appear in
 the pop up menu of the first view when i do a selection in that part. I
 would to use the extension point "org.eclipse.expressions.definitions"
 where i defined the rules which allow to display the menu item or not. But
 this time, i use the "selection" variable to know the selection in the
 first view. And it does not work properly, i need to re-activate the first
 view to make it work correctly. I'm wondering how can i do this correctly.
 Moreover i use in the first view a "dynamic selection provider" because i
 have several viewers. But i don't think it is linked to my problem.
 
 Maghen.
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.04621 seconds