Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-03-09 22:40:28 -0500
committerDonald Dunne2016-03-10 11:49:18 -0500
commit3f65afe37d2ed2fd9e2946c0f79fb78c6c68107e (patch)
treeb7647163c2999361769c91e8865a374b55548c68
parent3a12002b35fed3078aafc746f97039a94c48c074 (diff)
downloadorg.eclipse.osee-3f65afe37d2ed2fd9e2946c0f79fb78c6c68107e.tar.gz
org.eclipse.osee-3f65afe37d2ed2fd9e2946c0f79fb78c6c68107e.tar.xz
org.eclipse.osee-3f65afe37d2ed2fd9e2946c0f79fb78c6c68107e.zip
bug[ats_ATS277126]: Paste disabled on top level artifacts
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/menu/ArtifactExplorerMenu.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/menu/ArtifactExplorerMenu.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/menu/ArtifactExplorerMenu.java
index 6bb29720fa..6ab9694843 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/menu/ArtifactExplorerMenu.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/menu/ArtifactExplorerMenu.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
@@ -168,8 +169,9 @@ public class ArtifactExplorerMenu {
copyMenuItem.setEnabled(isArtifact && permiss.isReadPermission());
boolean clipboardEmpty = artifactClipboard.isEmpty();
- pasteMenuItem.setEnabled(isArtifact && canModifyDH && !clipboardEmpty);
- pasteSpecialMenuItem.setEnabled(isArtifact && canModifyDH && !clipboardEmpty);
+ boolean pasteEnabled = !clipboardEmpty && ((isArtifact && canModifyDH) || (obj == null && isBranchEditable));
+ pasteMenuItem.setEnabled(pasteEnabled);
+ pasteSpecialMenuItem.setEnabled(pasteEnabled);
renameArtifactMenuItem.setEnabled(isArtifact && permiss.isWritePermission());
findOnAnotherBranch.setEnabled(isArtifact);
accessControlMenuItem.setEnabled(isArtifact);
@@ -663,10 +665,12 @@ public class ArtifactExplorerMenu {
boolean performPaste = true;
Artifact destinationArtifact = null;
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- if (selection != null && !selection.isEmpty()) {
- Object object = selection.getFirstElement();
-
- if (object instanceof Artifact) {
+ if (selection != null) {
+ if (selection.isEmpty()) {
+ destinationArtifact =
+ ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.DefaultHierarchyRoot, getBranch());
+ } else if (selection.getFirstElement() instanceof Artifact) {
+ Object object = selection.getFirstElement();
Artifact artifact = (Artifact) object;
if (!ArtifactTypeManager.isUserCreationAllowed(artifact.getArtifactType())) {
throw new OseeArgumentException("Artifact Type [%s] can not be copied", artifact.getArtifactTypeName());

Back to the top