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.