Package org.freeplane.plugin.workspace.components.dialog

Examples of org.freeplane.plugin.workspace.components.dialog.NodeRenameDialogPanel


  public void actionPerformed(final ActionEvent e) {
    AWorkspaceTreeNode targetNode = this.getNodeFromActionEvent(e);
   
    String oldName = targetNode.getName();
    NodeRenameDialogPanel panel;
//    if (targetNode instanceof IMutableLinkNode) {
//      panel = new NodeRenameDialogPanel(oldName, true);
//    }
//    else {
      panel = new NodeRenameDialogPanel(oldName);
      if(targetNode instanceof DefaultFileNode) {
        panel.setCheckboxSelected(true);
      }
//    }
    int okButton = JOptionPane.showConfirmDialog(UITools.getFrame(), panel, TextUtils.getText("confirm_rename_file_action"),  JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    String newName = panel.getText();
   
    if(okButton != JOptionPane.OK_OPTION || oldName.equals(newName)) {
      return;
    }
   
    if (newName != null) {
      if (targetNode instanceof IMutableLinkNode) {
        if (((IMutableLinkNode) targetNode).changeName(newName, panel.applyChangesForLink())) {
          targetNode.refresh();
        }
        else {
          JOptionPane.showMessageDialog(UITools.getFrame(), TextUtils.getText("error_rename_file"),
              TextUtils.getText("error_rename_file_title"), JOptionPane.ERROR_MESSAGE);
View Full Code Here

TOP

Related Classes of org.freeplane.plugin.workspace.components.dialog.NodeRenameDialogPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.