diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet')
3 files changed, 31 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java index 69dea3ee96e..6dc28e0441e 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java @@ -191,6 +191,8 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent private Branch branch; private IGlobalMenuHelper globalMenuHelper; + private ArtifactExplorerDragAndDrop dragAndDropWorker; + private Composite stackComposite; private Control branchWarningComposite; private StackLayout stackLayout; @@ -298,6 +300,7 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent IOseeBranch selectedBranch = branchSelect.getData(); if (selectedBranch != null) { branch = BranchManager.getBranch(selectedBranch); + dragAndDropWorker.updateBranch(selectedBranch); explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch)); } } catch (Exception ex) { @@ -362,7 +365,7 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent myTreeEditor.grabHorizontal = true; myTreeEditor.minimumWidth = 50; - new ArtifactExplorerDragAndDrop(treeViewer, VIEW_ID, this); + dragAndDropWorker = new ArtifactExplorerDragAndDrop(treeViewer, VIEW_ID, this, branch); OseeUiActions.addBugToViewToolbar(this, this, SkynetGuiPlugin.PLUGIN_ID, VIEW_ID, "Artifact Explorer"); @@ -1110,6 +1113,10 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent explorerRoot = artifact; branch = artifact.getBranch(); + if (dragAndDropWorker != null) { + dragAndDropWorker.updateBranch(branch); + } + refreshBranchWarning(); initializeSelectionBox(); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerDragAndDrop.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerDragAndDrop.java index 9a6f5a37ead..f109f92f534 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerDragAndDrop.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerDragAndDrop.java @@ -16,12 +16,14 @@ import java.util.logging.Level; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.AccessPolicy; +import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; @@ -45,6 +47,13 @@ public class ArtifactExplorerDragAndDrop extends SkynetDragAndDrop { private final IViewPart viewPart; private final InterArtifactExplorerDropHandler interArtifactExplorerHandler; + private IOseeBranch selectedBranch; + + public ArtifactExplorerDragAndDrop(TreeViewer treeViewer, String viewId, IViewPart viewPart, IOseeBranch selectedBranch) { + this(treeViewer, viewId, viewPart); + this.selectedBranch = selectedBranch; + } + public ArtifactExplorerDragAndDrop(TreeViewer treeViewer, String viewId, IViewPart viewPart) { super(treeViewer.getTree(), treeViewer.getTree(), viewId); @@ -54,6 +63,10 @@ public class ArtifactExplorerDragAndDrop extends SkynetDragAndDrop { this.interArtifactExplorerHandler = new InterArtifactExplorerDropHandler(); } + public void updateBranch(IOseeBranch branch) { + selectedBranch = branch; + } + @Override public Artifact[] getArtifacts() { IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection(); @@ -124,7 +137,16 @@ public class ArtifactExplorerDragAndDrop extends SkynetDragAndDrop { @Override public void performDrop(final DropTargetEvent event) { - final Artifact parentArtifact = getSelectedArtifact(event); + Artifact parentArtifact = getSelectedArtifact(event); + + if (parentArtifact == null && selectedBranch != null) { + //try Default Root Hierarchy + try { + parentArtifact = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(selectedBranch); + } catch (Exception ex) { + OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex); + } + } if (parentArtifact != null) { if (ArtifactTransfer.getInstance().isSupportedType(event.currentDataType)) { @@ -175,5 +197,4 @@ public class ArtifactExplorerDragAndDrop extends SkynetDragAndDrop { } } } - } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java index a817df09423..b781623f751 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java @@ -142,7 +142,6 @@ public class ArtifactImportPage extends WizardDataTransferPage { @Override public void handleEvent(Event arg0) { - updateWidgetEnablements(); updateExtractedElements(); updatePageCompletion(); } |