summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2011-06-22 18:22:45 (EDT)
committer Ryan D. Brooks2011-06-22 18:22:45 (EDT)
commit656412ac2d482b249474442a8549e9edb1372edb (patch)
treee7fc0599a5bf5c85d446b79085aa1f391f74cbf0
parent62120e461e2ea99d906b0a3140f80fba4c670c13 (diff)
downloadorg.eclipse.osee-656412ac2d482b249474442a8549e9edb1372edb.zip
org.eclipse.osee-656412ac2d482b249474442a8549e9edb1372edb.tar.gz
org.eclipse.osee-656412ac2d482b249474442a8549e9edb1372edb.tar.bz2
feature: ArtifactImport now offers intuitive Default Hierarchy as import destination
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerDragAndDrop.java25
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java1
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 69dea3e..6dc28e0 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 9a6f5a3..f109f92 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 a817df0..b781623 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();
}