/** * The <code>PluginDropAdapter</code> implementation of this <code>ViewerDropAdapter</code> method * is used to notify the action that some aspect of the drop operation has changed. Subclasses may * override. */ public boolean validateDrop(Object target, int operation, TransferData transferType) { currentTransfer = transferType; if (currentTransfer != null && PluginTransfer.getInstance().isSupportedType(currentTransfer)) { // plugin cannot be loaded without the plugin data return true; } return false; }
/* (non-Javadoc) * Method declared on DropTargetAdapter. * The user has dropped something on the desktop viewer. */ public void drop(DropTargetEvent event) { try { if (PluginTransfer.getInstance().isSupportedType(event.currentDataType)) { PluginTransferData pluginData = (PluginTransferData) event.data; IDropActionDelegate delegate = getPluginAdapter(pluginData); if (!delegate.run(pluginData.getData(), getCurrentTarget())) { event.detail = DND.DROP_NONE; } } else { super.drop(event); } } catch (CoreException e) { WorkbenchPlugin.log("Drop Failed", e.getStatus()); // $NON-NLS-1$ } }