Community
Participate
Working Groups
I would like to take advantage of the new support in IAction for the runWithEvent(Event) method. I want to do this so I can access the state mask of the event, and determine if a key like Shift or Ctrl was held down when the action was invoked. The problem is that since my action is a contributed drop down action on the toolbar, my overridden version of runWithEvent is never called. The action contribution item's action is a WWinPluginPulldown, and this class does not override runWithEvent, but just uses the default supplied by Action, which just calls run(). The run() method defined by PluginPulldown creates the delegate and calls run(IAction) on it. Thus, the runWithEvent() I've defined in the delegate gets ignored. I realize this support is new and subject to change, but couldn't WWinPluginPulldown override runWithEvent to call runWithEvent on the delegate, passing in the event? I haven't tried it, but I suspect that regular (non-drop down) contributed actions might have the same issue.
Added org.eclipse.ui.IActionDelegate2, which adds run(IAction, Event). This gets called instead of run(IAction) if the delegate implements IActionDelegate2. This change applies to all action delegates.