Project: Eclipse_Platform_UI
Bug 153081 [Commands] commands doesn't recognize the objectcontribution for popups
Reported: 2006-08-08 09:15:21 | Status: verified fixed

For a popup I defined a objectcontribution. This works correctly in a TableTree. If I select the popup item the action will run by executing the selectionChanged() method on the IObjectActionDelegate. Then I defined a definitionId for the popup action which associates the command correctly. It executes the action if I press the key defined by keybinding. But I got a Nullpointerexception because the selectionChanged() method isn't executed. Debugging brought me to the following code in ActionDelegateHandlerProxy: if (applicationContext instanceof IEvaluationContext) { final IEvaluationContext context = (IEvaluationContext) applicationContext; final Object selectionObject = context .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); if (selectionObject instanceof ISelection) { currentSelection = (ISelection) selectionObject; delegate.selectionChanged(action, currentSelection); } } Unfortunately the selectionObject is null and the delegate.selectionChanged() won't be executed. Here are the entries of my plugin.xml ====================================== The popup: ---------- <extension point="org.eclipse.ui.popupMenus"> <objectContribution adaptable="false" id="RSPCore.editWorkflowContribution" objectClass="com.rsp.core.base.model.DescriptiveElement"> <action class="com.rsp.core.client.view.editor.EditWorkflowAction" definitionId="RSPCore.editCommand" id="RSPCore.editDescriptiveWorkflowAction" label="%objectContribution.parameter.action.label.edit" menubarPath="default"/> </objectContribution> </extension> The command: ------------ <extension point="org.eclipse.ui.commands"> <category id="RSPCore.WorkflowCategory" name="RSPCore.WorkflowCategory"/> <command categoryId="RSPCore.WorkflowCategory" id="RSPCore.editCommand" name="RSPCore.editCommand"/> </extension> The keybinding: --------------- <extension point="org.eclipse.ui.bindings"> <key commandId="RSPCore.editCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="ENTER"/> </extension>

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java