/[cashew-s-editor]/cashews/src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java
ViewVC logotype

Diff of /cashews/src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by gnu_andrew, Thu Mar 31 17:35:21 2005 UTC revision 1.2 by gnu_andrew, Thu May 5 23:47:58 2005 UTC
# Line 37  to any source code in the Content. Line 37  to any source code in the Content.
37    
38  package nongnu.cashews.eclipse.composer.commands;  package nongnu.cashews.eclipse.composer.commands;
39    
40    import nongnu.cashews.eclipse.composer.model.Diagram;
41  import nongnu.cashews.eclipse.composer.model.Node;  import nongnu.cashews.eclipse.composer.model.Node;
42  import nongnu.cashews.eclipse.composer.model.NodeRegistrar;  import nongnu.cashews.eclipse.composer.model.NodeRegistrar;
43  import nongnu.cashews.eclipse.composer.util.Dialogs;  import nongnu.cashews.eclipse.composer.util.Dialogs;
# Line 46  import org.eclipse.gef.commands.Command; Line 47  import org.eclipse.gef.commands.Command;
47  public class RenameNodeCommand  public class RenameNodeCommand
48    extends Command    extends Command
49  {  {
50      Diagram diagram;
51      
52    private Node node;    private Node node;
53    
54    private String newName;    private String newName;
# Line 73  public class RenameNodeCommand Line 75  public class RenameNodeCommand
75      return "Rename Node";      return "Rename Node";
76    }    }
77    
78      public boolean canExecute(){
79       return false;  
80      }
81    public void execute()    public void execute()
82    {    {/* if (newName.equals("")){
83      if (!NodeRegistrar.renameNode(oldName, newName))        Dialogs.displayErrorDialog("The name of the node can not be null!");
84        return;
85      }
86        if (!NodeRegistrar.renameNode(oldName, newName, (Diagram)DiagramSingleton.getInstance().getDiagram()))
87        {        {
88          Dialogs.displayErrorDialog("The node, " + newName + ", already exists.");          Dialogs.displayErrorDialog("The node, " + newName + ", already exists.");
89          return;          return;
90        }        }
91      oldName = this.node.getName();      oldName = this.node.getName();
92      this.node.setName(newName);      this.node.setName(newName);*/
93    }    }
94    
95    public void undo()    public void undo()
# Line 93  public class RenameNodeCommand Line 101  public class RenameNodeCommand
101    {    {
102      this.node.setName(newName);      this.node.setName(newName);
103    }    }
104      public void setDiagram(Diagram d)
105      {
106       this.diagram = d;
107       DiagramSingleton.getInstance().setDiagram(d);
108      }
109  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26