use of org.freeplane.plugin.workspace.dnd.WorkspaceTransferable in project freeplane by freeplane.
the class NodeCopyAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
AWorkspaceTreeNode[] targetNodes = getSelectedNodes(e);
WorkspaceTransferable transferable = null;
for (AWorkspaceTreeNode targetNode : targetNodes) {
if (targetNode instanceof IWorkspaceTransferableCreator) {
if (transferable == null) {
transferable = ((IWorkspaceTransferableCreator) targetNode).getTransferable();
} else {
transferable.merge(((IWorkspaceTransferableCreator) targetNode).getTransferable());
}
}
}
if (transferable == null) {
return;
}
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(transferable, new CopyClipboardOwner(transferable));
}
Aggregations