diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-11-22 22:03:08 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-11-22 22:03:08 +0000 |
commit | 833210856da78b28b8690bcdaaff434ee90a77ff (patch) | |
tree | 258116d3086c8f9668aed7f29a4c9bbbeb09f392 /java/src/IceGridGUI/Application/ServerTemplate.java | |
parent | fixing common.xml to send absolute path to ant task instead of relative (diff) | |
download | ice-833210856da78b28b8690bcdaaff434ee90a77ff.tar.bz2 ice-833210856da78b28b8690bcdaaff434ee90a77ff.tar.xz ice-833210856da78b28b8690bcdaaff434ee90a77ff.zip |
Fixed various copy/paste bugs
Diffstat (limited to 'java/src/IceGridGUI/Application/ServerTemplate.java')
-rwxr-xr-x | java/src/IceGridGUI/Application/ServerTemplate.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/java/src/IceGridGUI/Application/ServerTemplate.java b/java/src/IceGridGUI/Application/ServerTemplate.java index 90a0501ece6..c418ccec73b 100755 --- a/java/src/IceGridGUI/Application/ServerTemplate.java +++ b/java/src/IceGridGUI/Application/ServerTemplate.java @@ -92,10 +92,19 @@ class ServerTemplate extends Communicator { boolean[] actions = new boolean[ACTION_COUNT]; actions[COPY] = true; + if(((TreeNode)_parent).getAvailableActions()[PASTE]) { actions[PASTE] = true; } + else + { + Object clipboard = getCoordinator().getClipboard(); + actions[PASTE] = clipboard != null && + ((isIceBox() && (clipboard instanceof ServiceInstanceDescriptor)) + || (!isIceBox() && (clipboard instanceof AdapterDescriptor + || clipboard instanceof DbEnvDescriptor))); + } actions[DELETE] = true; @@ -111,11 +120,8 @@ class ServerTemplate extends Communicator getCoordinator().setClipboard(copyDescriptor(_templateDescriptor)); getCoordinator().getActionsForMenu().get(PASTE).setEnabled(true); } - public void paste() - { - ((TreeNode)_parent).paste(); - } + public JPopupMenu getPopupMenu() { ApplicationActions actions = getCoordinator().getActionsForPopup(); @@ -304,7 +310,7 @@ class ServerTemplate extends Communicator { _adapters.init(_templateDescriptor.descriptor.adapters); - if(_templateDescriptor.descriptor instanceof IceBoxDescriptor) + if(isIceBox()) { IceBoxDescriptor iceBoxDescriptor = (IceBoxDescriptor)_templateDescriptor.descriptor; |