I discovered a strange behavior with handler activation.
I have a command
<command categoryId="myCategory" id="myCommand"></command>
two handlers for that command
<handler class="EditorHandler" commandId="myCommand">
<handler class="SelectionHandler" commandId="myCommand">
<iterate ifEmpty="false" operator="and">
and a core expression definition
The SelectionHandler should be active only when the workbench selection contains instances of a SelectableObject.
The EditorHandler should be active only when a specific editor is active.
There are two editors, the first one is the one with editorWithSelectedObjectId id. It has no selection provider registered with its site.
The second one is an editor containing a table of SelectableObjects, so it has registered a selection provider with its site.
I put the command in main toolbar and open the editor with a table of SelectableObjects.
The SelectionHandler becomes active (ok). Now I open the second editor and the SelectionHandler is still active (bad)!! When I try it next time (the application must be restarted), the EditorHandler becomes active as it should (ok). This happens randomly. It looks like the sequence of handler activation matters or something.
Sometimes the SelectionHandler stay active forever. No matter what editor or view is active.
Does anybody have an idea what's going here? Thanks