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/DbEnv.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/DbEnv.java')
-rwxr-xr-x | java/src/IceGridGUI/Application/DbEnv.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/java/src/IceGridGUI/Application/DbEnv.java b/java/src/IceGridGUI/Application/DbEnv.java index 446cf5c4cac..9f285f5d147 100755 --- a/java/src/IceGridGUI/Application/DbEnv.java +++ b/java/src/IceGridGUI/Application/DbEnv.java @@ -51,7 +51,6 @@ class DbEnv extends TreeNode implements DescriptorHolder tree, value, sel, expanded, leaf, row, hasFocus); } - // // Actions // @@ -59,13 +58,16 @@ class DbEnv extends TreeNode implements DescriptorHolder { boolean[] actions = new boolean[ACTION_COUNT]; actions[COPY] = true; - boolean[] parentActions = ((TreeNode)_parent).getAvailableActions(); - - actions[PASTE] = parentActions[PASTE]; + + Object clipboard = getCoordinator().getClipboard(); + actions[PASTE] = clipboard != null && + (clipboard instanceof AdapterDescriptor + || clipboard instanceof DbEnvDescriptor); actions[DELETE] = true; if(!_ephemeral) { + boolean[] parentActions = ((TreeNode)_parent).getAvailableActions(); actions[SHOW_VARS] = parentActions[SHOW_VARS]; actions[SUBSTITUTE_VARS] = parentActions[SUBSTITUTE_VARS]; } @@ -75,11 +77,9 @@ class DbEnv extends TreeNode implements DescriptorHolder public void copy() { getCoordinator().setClipboard(copyDescriptor(_descriptor)); - if(((TreeNode)_parent).getAvailableActions()[PASTE]) - { - getCoordinator().getActionsForMenu().get(PASTE).setEnabled(true); - } + getCoordinator().getActionsForMenu().get(PASTE).setEnabled(true); } + public void paste() { ((TreeNode)_parent).paste(); |