Project: Eclipse_Platform_UI
Bug 254547 [DND] PluginDropAdapter does not accept multiple actions in an extension
Reported: 2008-11-06 20:41:05 | Status: verified fixed

Build ID: I20080617-2000 Steps To Reproduce: 1. Create two IDropActionDelegates and declare them in the same gov.nga.geocompass.ica.ea.ui.attributeDropAction extension. 2. Test that the second Drop delegate never gets called More information: In the PluginDropAdapter class the method getPluginAdapter never checks beyond the first configuration element. Instead it should loop through each of the actions in the extension (lines 90 to 110). Here is the method fixed. protected static IDropActionDelegate getPluginAdapter( PluginTransferData data) throws CoreException { IExtensionRegistry registry = Platform.getExtensionRegistry(); String adapterName = data.getExtensionId(); IExtensionPoint xpt = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_DROP_ACTIONS); IExtension[] extensions = xpt.getExtensions(); for (int i = 0; i < extensions.length; i++) { IConfigurationElement[] configs = extensions[i] .getConfigurationElements(); if (configs != null && configs.length > 0) { for (int j=0; j < configs.length; j++) { String id = configs[j].getAttribute("id");//$NON-NLS-1$ if (id != null && id.equals(adapterName)) { return (IDropActionDelegate) WorkbenchPlugin .createExtension(configs[j], ATT_CLASS); } } } } return null; }

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java