Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2018-09-14 15:13:48 -0400
committerDonald Dunne2018-09-17 12:21:26 -0400
commit430d960bba96cdc87c00e1263e07209c10e18eaa (patch)
tree73463906998d667e63ede7b2d12cc3ec11d42b23
parente6b423e4ad769947da70b335aa0a9dd0fb61c36a (diff)
downloadorg.eclipse.osee-430d960bba96cdc87c00e1263e07209c10e18eaa.tar.gz
org.eclipse.osee-430d960bba96cdc87c00e1263e07209c10e18eaa.tar.xz
org.eclipse.osee-430d960bba96cdc87c00e1263e07209c10e18eaa.zip
feature[ats_TW10722]: Add ids to relation link artifacts in UI
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java16
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java39
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java19
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java10
10 files changed, 72 insertions, 41 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
index aa7cd8e4c7..6d7d80f774 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
@@ -1793,4 +1793,8 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A
public ArtifactToken getHashableToken() {
return ArtifactToken.valueOf(getId(), getBranch());
}
+
+ public String getGammaIdString() {
+ return String.valueOf(getGammaId());
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
index 520738ad82..c9f070d809 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
@@ -71,13 +71,13 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
}
return areDeltasEqual && change.getArtId() == getArtId() &&
//
- change.getGamma() == getGamma() &&
- //
- change.getChangeArtifact().equals(getChangeArtifact()) &&
- //
- change.getModificationType() == getModificationType() &&
- //
- change.getTxDelta().equals(getTxDelta());
+ change.getGamma() == getGamma() &&
+ //
+ change.getChangeArtifact().equals(getChangeArtifact()) &&
+ //
+ change.getModificationType() == getModificationType() &&
+ //
+ change.getTxDelta().equals(getTxDelta());
}
}
return false;
@@ -120,7 +120,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
}
public String getArtifactName() {
- return getChangeArtifact().getName();
+ return getChangeArtifact().toStringWithId();
}
public GammaId getGamma() {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
index 5249934860..343dc2a035 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
@@ -72,7 +72,8 @@ public final class RelationChange extends Change {
@Override
public String getName() {
- return String.format("%s <- [%s] -> %s", getArtifactName(), getItemTypeName(), getEndTxBArtifact().getName());
+ return String.format("%s <- [%s] -> %s", getArtifactName(), getItemTypeName(),
+ getEndTxBArtifact().toStringWithId());
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java
index 93f3b1cc94..c8ed92fb9b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java
@@ -395,4 +395,8 @@ public class RelationLink implements HasBranch {
public boolean isUseBackingData() {
return useBackingData;
}
+
+ public String getIdString() {
+ return String.valueOf(getId());
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
index 33227487ab..5e99809472 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.framework.skynet.core.relation;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.RelationSorter.PREEXISTING;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -22,7 +21,6 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
-
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java
index 5414606315..28746a6fde 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java
@@ -14,7 +14,9 @@ package org.eclipse.osee.framework.skynet.core.relation;
import static org.eclipse.osee.framework.core.enums.RelationSorter.PREEXISTING;
import static org.eclipse.osee.framework.core.enums.RelationSorter.USER_DEFINED;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
@@ -35,6 +37,7 @@ public class RelationTypeSideSorter extends RelationTypeSide {
private final RelationType relationType;
private final RelationOrderData orderData;
private final RelationSorterProvider sorterProvider;
+ private final Map<Artifact, RelationLink> artToRelation = new HashMap<>();
public RelationTypeSideSorter(RelationType relationType, RelationSide side, RelationSorterProvider sorterProvider, RelationOrderData orderData) {
super(relationType, side);
@@ -75,6 +78,10 @@ public class RelationTypeSideSorter extends RelationTypeSide {
order.sort(listToOrder, relativeOrder);
}
+ public RelationLink getRelation(Artifact artifact) {
+ return artToRelation.get(artifact);
+ }
+
public void addItem(RelationSorter sorterId, Artifact itemToAdd) throws OseeCoreException {
RelationSorter sorterIdToUse = sorterId;
if (sorterIdToUse == PREEXISTING) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java
index cd391844e3..b897312de3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSideSorter;
@@ -33,7 +34,7 @@ import org.eclipse.osee.framework.ui.skynet.internal.Activator;
/**
* The basis for the comments in this class can be found at
* http://www.eclipse.org/articles/treeviewer-cg/TreeViewerArticle.htm
- *
+ *
* @author Ryan D. Brooks
*/
public class RelationContentProvider implements ITreeContentProvider {
@@ -53,7 +54,7 @@ public class RelationContentProvider implements ITreeContentProvider {
* model-specific means), and deregistering the viewer from the old input. In response to these change notifications,
* the content provider propagates the changes to the viewer.
* </p>
- *
+ *
* @param viewer the viewer
* @param oldInput the old input element, or <code>null</code> if the viewer did not previously have an input
* @param newInput the new input element, or <code>null</code> if the viewer does not have an input
@@ -68,7 +69,7 @@ public class RelationContentProvider implements ITreeContentProvider {
* The tree viewer calls its content provider&#8217;s getChildren method when it needs to create or display the child
* elements of the domain object, <b>parent </b>. This method should answer an array of domain objects that represent
* the unfiltered children of <b>parent </b>
- *
+ *
* @see ITreeContentProvider#getChildren(Object)
*/
@Override
@@ -108,16 +109,16 @@ public class RelationContentProvider implements ITreeContentProvider {
}
} else if (parentElement instanceof RelationTypeSideSorter) {
RelationTypeSideSorter relationSorter = (RelationTypeSideSorter) parentElement;
- List<Artifact> artifacts = artifactRoot.getRelatedArtifacts(relationSorter);
- WrapperForRelationLink[] wrapper = new WrapperForRelationLink[artifacts.size()];
- for (int i = 0; i < artifacts.size(); i++) {
- Artifact sideArtifact = artifacts.get(i);
+ List<RelationLink> relations = artifactRoot.getRelations(relationSorter);
+ WrapperForRelationLink[] wrapper = new WrapperForRelationLink[relations.size()];
+ for (int i = 0; i < relations.size(); i++) {
+ RelationLink relation = relations.get(i);
if (relationSorter.getSide().isSideA()) {
- wrapper[i] = new WrapperForRelationLink(relationSorter.getRelationType(), sideArtifact, sideArtifact,
- relationSorter.getArtifact());
+ wrapper[i] = new WrapperForRelationLink(relation, relationSorter.getRelationType(),
+ relation.getArtifactA(), relation.getArtifactA(), relationSorter.getArtifact());
} else {
- wrapper[i] = new WrapperForRelationLink(relationSorter.getRelationType(), sideArtifact,
- relationSorter.getArtifact(), sideArtifact);
+ wrapper[i] = new WrapperForRelationLink(relation, relationSorter.getRelationType(),
+ relation.getArtifactB(), relationSorter.getArtifact(), relation.getArtifactB());
}
childToParentMap.put(wrapper[i], parentElement);
}
@@ -139,7 +140,7 @@ public class RelationContentProvider implements ITreeContentProvider {
* The tree viewer asks its content provider if the domain object represented by <b>element </b> has any children.
* This method is used by the tree viewer to determine whether or not a plus or minus should appear on the tree
* widget.
- *
+ *
* @see ITreeContentProvider#hasChildren(Object)
*/
@Override
@@ -161,13 +162,13 @@ public class RelationContentProvider implements ITreeContentProvider {
}
/**
- * This is the method invoked by calling the <b>setInput </b> method on the tree viewer. In fact, the
- * <b>getElements </b> method is called only in response to the tree viewer's <b>setInput </b> method and should
- * answer with the appropriate domain objects of the inputElement. The <b>getElements </b> and <b>getChildren </b>
- * methods operate in a similar way. Depending on your domain objects, you may have the <b>getElements </b> simply
- * return the result of calling <b>getChildren </b>. The two methods are kept distinct because it provides a clean
- * way to differentiate between the root domain object and all other domain objects.
- *
+ * This is the method invoked by calling the <b>setInput </b> method on the tree viewer. In fact, the <b>getElements
+ * </b> method is called only in response to the tree viewer's <b>setInput </b> method and should answer with the
+ * appropriate domain objects of the inputElement. The <b>getElements </b> and <b>getChildren </b> methods operate in
+ * a similar way. Depending on your domain objects, you may have the <b>getElements </b> simply return the result of
+ * calling <b>getChildren </b>. The two methods are kept distinct because it provides a clean way to differentiate
+ * between the root domain object and all other domain objects.
+ *
* @see IStructuredContentProvider#getElements(Object)
*/
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java
index 2c6edf8715..6fe8346d81 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java
@@ -113,7 +113,20 @@ public class RelationLabelProvider implements ITableLabelProvider, ILabelProvide
} catch (OseeCoreException ex) {
return ex.toString();
}
- } else if (element instanceof RelationType) {
+ }
+ if (columnIndex == 1 && element instanceof WrapperForRelationLink) {
+ WrapperForRelationLink wrapper = (WrapperForRelationLink) element;
+ return wrapper.getOther().getIdString();
+ }
+ if (columnIndex == 3 && element instanceof WrapperForRelationLink) {
+ WrapperForRelationLink wrapper = (WrapperForRelationLink) element;
+ return wrapper.getRelation().getIdString();
+ }
+ if (columnIndex == 4 && element instanceof WrapperForRelationLink) {
+ WrapperForRelationLink wrapper = (WrapperForRelationLink) element;
+ return String.valueOf(wrapper.getRelation().getGammaId());
+ }
+ if (element instanceof RelationType) {
if (columnIndex == 0) {
return ((RelationType) element).getName();
}
@@ -125,14 +138,14 @@ public class RelationLabelProvider implements ITableLabelProvider, ILabelProvide
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
- } else if (columnIndex == 1) {
+ } else if (columnIndex == 2) {
return link.getRationale();
}
} else if (element instanceof WrapperForRelationLink) {
WrapperForRelationLink wrapper = (WrapperForRelationLink) element;
if (columnIndex == 0) {
return wrapper.getOther().getName();
- } else if (columnIndex == 1) {
+ } else if (columnIndex == 2) {
String rationale = "";
try {
RelationLink link = RelationManager.getRelationLink(wrapper.getArtifactA(), wrapper.getArtifactB(),
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java
index a106c0b17c..4c361f4770 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java
@@ -81,11 +81,8 @@ public class RelationsComposite extends Composite implements ISelectedArtifact {
private NeedSelectedArtifactListener needSelectedArtifactListener;
private final IDirtiableEditor editor;
public static final String VIEW_ID = "osee.define.relation.RelationExplorer";
- public static final String[] columnNames = new String[] {" ", "Rationale"};
- public static final Integer[] columnLengths = new Integer[] {500, 50};
-
- // the index of column order
- private static int COLUMN_ORDER = 1;
+ public static final String[] columnNames = new String[] {"Type/Side/Name", "Art Id", "Rationale", "Id", "Gamma Id"};
+ public static final Integer[] columnLengths = new Integer[] {600, 50, 300, 50, 50};
private MenuItem openMenuItem, wordPreviewItem, editMenuItem, viewRelationTreeItem, deleteRelationMenuItem,
massEditMenuItem, deleteArtifactMenuItem, revealInArtifactExporerMenuItem;
@@ -330,8 +327,6 @@ public class RelationsComposite extends Composite implements ISelectedArtifact {
TreeViewerReport report =
new TreeViewerReport("Relation View Report for " + artifact.getName(), treeViewer);
ArrayList<Integer> ignoreCols = new ArrayList<>();
- ignoreCols.add(COLUMN_ORDER);
- report.setIgnoreColumns(ignoreCols);
report.open();
}
});
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java
index 63d60fad55..e2e1cb7247 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
/**
* @author Andrew M. Finkbeiner
@@ -24,14 +25,20 @@ class WrapperForRelationLink implements IAdaptable {
private final Artifact artifactA;
private final Artifact artifactB;
private final Artifact other;
+ private final RelationLink relation;
- public WrapperForRelationLink(RelationTypeToken relationType, Artifact other, Artifact artifactA, Artifact artifactB) {
+ public WrapperForRelationLink(RelationLink relation, RelationTypeToken relationType, Artifact other, Artifact artifactA, Artifact artifactB) {
+ this.relation = relation;
this.relationType = relationType;
this.artifactA = artifactA;
this.artifactB = artifactB;
this.other = other;
}
+ public RelationLink getRelation() {
+ return relation;
+ }
+
RelationTypeToken getRelationType() {
return relationType;
}
@@ -67,4 +74,5 @@ class WrapperForRelationLink implements IAdaptable {
T object = (T) obj;
return object;
}
+
}

Back to the top