use of org.freeplane.plugin.workspace.dnd.WorkspaceTransferable in project freeplane by freeplane.
the class LinkTypeFileNode method getTransferable.
public WorkspaceTransferable getTransferable() {
WorkspaceTransferable transferable = new WorkspaceTransferable();
try {
URI uri = URIUtils.getAbsoluteURI(getLinkURI());
transferable.addData(WorkspaceTransferable.WORKSPACE_URI_LIST_FLAVOR, uri.toString());
List<File> fileList = new Vector<File>();
fileList.add(new File(uri));
transferable.addData(WorkspaceTransferable.WORKSPACE_FILE_LIST_FLAVOR, fileList);
if (!this.isSystem()) {
List<AWorkspaceTreeNode> objectList = new ArrayList<AWorkspaceTreeNode>();
objectList.add(this);
transferable.addData(WorkspaceTransferable.WORKSPACE_NODE_FLAVOR, objectList);
}
return transferable;
} catch (Exception e) {
LogUtils.warn(e);
}
return null;
}
use of org.freeplane.plugin.workspace.dnd.WorkspaceTransferable in project freeplane by freeplane.
the class FolderLinkNode method getTransferable.
public WorkspaceTransferable getTransferable() {
WorkspaceTransferable transferable = new WorkspaceTransferable();
try {
URI uri = URIUtils.getAbsoluteURI(getPath());
transferable.addData(WorkspaceTransferable.WORKSPACE_URI_LIST_FLAVOR, uri.toString());
List<File> fileList = new Vector<File>();
fileList.add(new File(uri));
transferable.addData(WorkspaceTransferable.WORKSPACE_FILE_LIST_FLAVOR, fileList);
if (!this.isSystem()) {
List<AWorkspaceTreeNode> objectList = new ArrayList<AWorkspaceTreeNode>();
objectList.add(this);
transferable.addData(WorkspaceTransferable.WORKSPACE_NODE_FLAVOR, objectList);
}
return transferable;
} catch (Exception e) {
LogUtils.warn(e);
}
return null;
}
use of org.freeplane.plugin.workspace.dnd.WorkspaceTransferable in project freeplane by freeplane.
the class NodeCutAction method actionPerformed.
public void actionPerformed(final ActionEvent event) {
AWorkspaceTreeNode[] targetNodes = getSelectedNodes(event);
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;
}
transferable.setAsCopy(false);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(transferable, new CutClipboardOwner(transferable));
// AWorkspaceTreeNode parent = targetNode.getParent();
//
// targetNode.getModel().cutNodeFromParent(targetNode);
// if(parent != null) {
// parent.refresh();
// //parent.getModel().requestSave();
// }
}
use of org.freeplane.plugin.workspace.dnd.WorkspaceTransferable in project freeplane by freeplane.
the class DefaultFileNode method getTransferable.
public WorkspaceTransferable getTransferable() {
WorkspaceTransferable transferable = new WorkspaceTransferable();
try {
URI uri = URIUtils.getAbsoluteURI(getFile().toURI());
transferable.addData(WorkspaceTransferable.WORKSPACE_URI_LIST_FLAVOR, uri.toString());
List<File> fileList = new Vector<File>();
fileList.add(new File(uri));
transferable.addData(WorkspaceTransferable.WORKSPACE_FILE_LIST_FLAVOR, fileList);
} catch (Exception e) {
LogUtils.warn(e);
}
if (!this.isSystem()) {
List<AWorkspaceTreeNode> objectList = new ArrayList<AWorkspaceTreeNode>();
objectList.add(this);
transferable.addData(WorkspaceTransferable.WORKSPACE_NODE_FLAVOR, objectList);
}
return transferable;
}
use of org.freeplane.plugin.workspace.dnd.WorkspaceTransferable in project freeplane by freeplane.
the class FolderVirtualNode method getTransferable.
public WorkspaceTransferable getTransferable() {
WorkspaceTransferable transferable = new WorkspaceTransferable();
try {
List<AWorkspaceTreeNode> objectList = new ArrayList<AWorkspaceTreeNode>();
objectList.add(this);
transferable.addData(WorkspaceTransferable.WORKSPACE_NODE_FLAVOR, objectList);
return transferable;
} catch (Exception e) {
LogUtils.warn(e);
}
return null;
}
Aggregations