use of org.freeplane.plugin.workspace.dnd.NoDropHandlerFoundExeption in project freeplane by freeplane.
the class NodePasteAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
AWorkspaceTreeNode targetNode = getNodeFromActionEvent(e);
if (DnDController.isDropAllowed(targetNode)) {
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable transf = clip.getContents(null);
if (transf == null) {
return;
}
int dndAction = DnDConstants.ACTION_COPY;
if (transf.isDataFlavorSupported(WorkspaceTransferable.WORKSPACE_MOVE_NODE_FLAVOR)) {
dndAction = DnDConstants.ACTION_MOVE;
}
if (WorkspaceController.getCurrentModeExtension().getView() != null) {
try {
WorkspaceController.getCurrentModeExtension().getView().getTransferHandler().handleDrop(targetNode, transf, dndAction);
if (dndAction == DnDConstants.ACTION_MOVE) {
clip.setContents(null, null);
}
} catch (NoDropHandlerFoundExeption ex) {
LogUtils.info("Exception in org.freeplane.plugin.workspace.actions.NodePasteAction.actionPerformed(ActionEvent): " + ex.getMessage());
}
}
}
}
Aggregations