use of org.freeplane.plugin.workspace.model.WorkspaceModel in project freeplane by freeplane.
the class WorkspaceRemoveProjectAction method actionPerformed.
/**
*********************************************************************************
* REQUIRED METHODS FOR INTERFACES
*********************************************************************************
*/
public void actionPerformed(ActionEvent e) {
AWorkspaceProject project = WorkspaceController.getCurrentProject();
if (project == null) {
return;
}
// WORKSPACE - todo: dialog that asks for physical deletion as well
int option = JOptionPane.showConfirmDialog(UITools.getFrame(), TextUtils.format("workspace.action.node.remove.confirm.text", project.getModel().getRoot().getName()), TextUtils.getRawText("workspace.action.node.remove.confirm.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (option == JOptionPane.YES_OPTION) {
// AWorkspaceTreeNode targetNode = getNodeFromActionEvent(e);
WorkspaceModel model = WorkspaceController.getCurrentModel();
// model.removeProject(model.getProject(targetNode.getModel()));
model.removeProject(project);
model.getRoot().getModel().requestSave();
}
}
Aggregations