use of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode in project freeplane by freeplane.
the class PhysicalFolderSortOrderAction method actionPerformed.
/**
*********************************************************************************
* REQUIRED METHODS FOR INTERFACES
*********************************************************************************
*/
/**
*/
public void actionPerformed(ActionEvent e) {
AWorkspaceTreeNode targetNode = getNodeFromActionEvent(e);
if (targetNode instanceof IFileSystemRepresentation) {
if (this.isSelected() == ((IFileSystemRepresentation) targetNode).orderDescending()) {
((IFileSystemRepresentation) targetNode).orderDescending(!this.isSelected());
targetNode.refresh();
}
}
}
use of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode in project freeplane by freeplane.
the class WorkspaceTransferHandler method drop.
/**
*********************************************************************************
* REQUIRED METHODS FOR INTERFACES
*********************************************************************************
*/
/* DropTarget Methods */
public final void drop(DropTargetDropEvent event) {
IWorkspaceView view = WorkspaceController.getCurrentModeExtension().getView();
if (view == null) {
return;
}
TreePath targetPath = view.getPathForLocation(event.getLocation().x, event.getLocation().y);
if (targetPath != null) {
AWorkspaceTreeNode targetNode = (AWorkspaceTreeNode) targetPath.getLastPathComponent();
if (processDrop(targetNode, event)) {
return;
}
}
event.rejectDrop();
}
use of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode in project freeplane by freeplane.
the class NodeRefreshAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
AWorkspaceTreeNode[] targetNodes = getSelectedNodes(e);
for (AWorkspaceTreeNode targetNode : targetNodes) {
if (targetNode == null) {
targetNode = WorkspaceController.getCurrentModel().getRoot();
} else {
targetNode.refresh();
}
}
IWorkspaceView view = WorkspaceController.getCurrentModeExtension().getView();
if (view != null) {
view.refreshView();
}
}
use of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode in project freeplane by freeplane.
the class FileFolderDropHandler method getPostOperation.
private ITask getPostOperation(final AWorkspaceTreeNode targetNode, final AWorkspaceTreeNode node, final File srcFile, final File destFile) {
return new ITask() {
public void exec(Properties properties) throws IOException {
if (onSkipList(destFile.getParentFile(), properties)) {
throw new SkipTaskException();
}
AWorkspaceTreeNode parent = node.getParent();
targetNode.getModel().cutNodeFromParent(node);
parent.refresh();
targetNode.getModel().nodeMoved(node, srcFile, destFile);
}
private boolean onSkipList(File dest, Properties properties) {
if (properties == null || dest == null) {
return false;
}
String list = properties.getProperty("skippedDirs", "");
String entry = dest.getPath() + ";";
if (list.contains(entry)) {
return true;
}
return false;
}
};
}
use of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode 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;
}
Aggregations