Search in sources :

Example 1 with WorkspaceModel

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();
    }
}
Also used : AWorkspaceProject(org.freeplane.plugin.workspace.model.project.AWorkspaceProject) WorkspaceModel(org.freeplane.plugin.workspace.model.WorkspaceModel)

Aggregations

WorkspaceModel (org.freeplane.plugin.workspace.model.WorkspaceModel)1 AWorkspaceProject (org.freeplane.plugin.workspace.model.project.AWorkspaceProject)1