diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-10-05 13:18:00 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-10-05 13:18:00 -0400 |
commit | 0ace9a91634271f30743792e9a57853485b1744e (patch) | |
tree | bf8926c60cc6666f3e3f82d8fcd264186b67053f /java/src/IceGridGUI/Application/Nodes.java | |
parent | Fixed bug 2506 (diff) | |
download | ice-0ace9a91634271f30743792e9a57853485b1744e.tar.bz2 ice-0ace9a91634271f30743792e9a57853485b1744e.tar.xz ice-0ace9a91634271f30743792e9a57853485b1744e.zip |
Fixed bug #2499
Diffstat (limited to 'java/src/IceGridGUI/Application/Nodes.java')
-rwxr-xr-x | java/src/IceGridGUI/Application/Nodes.java | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/java/src/IceGridGUI/Application/Nodes.java b/java/src/IceGridGUI/Application/Nodes.java index 5bfeab237f4..284e08ecd90 100755 --- a/java/src/IceGridGUI/Application/Nodes.java +++ b/java/src/IceGridGUI/Application/Nodes.java @@ -11,6 +11,7 @@ package IceGridGUI.Application; import java.awt.Component; import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTree; @@ -63,7 +64,46 @@ class Nodes extends ListTreeNode public void paste() { Object descriptor = getCoordinator().getClipboard(); - newNode(Node.copyDescriptor((NodeDescriptor)descriptor)); + NodeDescriptor nd = Node.copyDescriptor((NodeDescriptor)descriptor); + + // + // Verify / fix all template instances + // + + java.util.Iterator p = nd.serverInstances.iterator(); + while(p.hasNext()) + { + ServerInstanceDescriptor sid = (ServerInstanceDescriptor)p.next(); + TemplateDescriptor td = getRoot().findServerTemplateDescriptor(sid.template); + if(td == null) + { + JOptionPane.showMessageDialog( + getCoordinator().getMainFrame(), + "Descriptor refers to undefined server template '" + sid.template + "'", + "Cannot paste", + JOptionPane.ERROR_MESSAGE); + return; + } + else + { + sid.parameterValues.keySet().retainAll(td.parameters); + } + } + + p = nd.servers.iterator(); + while(p.hasNext()) + { + ServerDescriptor sd = (ServerDescriptor)p.next(); + if(sd instanceof IceBoxDescriptor) + { + if(!getRoot().pasteIceBox((IceBoxDescriptor)sd)) + { + return; + } + } + } + + newNode(nd); } public void newNode() |