Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-02-24 16:53:07 -0500
committerdonald.g.dunne2017-02-24 16:54:42 -0500
commitec0536b0957f8538d14bc0996e3dc6e5f5c5906f (patch)
tree23ed2eb9a39ece9230bfeec4557f3d424731946e
parent90931370ab0c708e4b39d020f436e63c33dfcc4c (diff)
downloadorg.eclipse.osee-ec0536b0957f8538d14bc0996e3dc6e5f5c5906f.tar.gz
org.eclipse.osee-ec0536b0957f8538d14bc0996e3dc6e5f5c5906f.tar.xz
org.eclipse.osee-ec0536b0957f8538d14bc0996e3dc6e5f5c5906f.zip
bug[ats_ATS355391]: Artifact Related Change column locks up UI
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/IAtsXViewerPreComputedColumn.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/RelatedArtifactChangedColumn.java49
2 files changed, 30 insertions, 22 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/IAtsXViewerPreComputedColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/IAtsXViewerPreComputedColumn.java
index 9991a9ba9c..b372137b67 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/IAtsXViewerPreComputedColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/IAtsXViewerPreComputedColumn.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.column;
import org.eclipse.nebula.widgets.xviewer.IXViewerPreComputedColumn;
import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.framework.jdk.core.type.Id;
/**
* @author Donald G. Dunne
@@ -28,6 +29,8 @@ public interface IAtsXViewerPreComputedColumn extends IXViewerPreComputedColumn
Long result = 0L;
if (obj instanceof IAtsObject) {
result = ((IAtsObject) obj).getUuid();
+ } else if (obj instanceof Id) {
+ return ((Id) obj).getId();
}
return result;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/RelatedArtifactChangedColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/RelatedArtifactChangedColumn.java
index 9b31bd84cd..a5752c913b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/RelatedArtifactChangedColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/RelatedArtifactChangedColumn.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.ats.column;
-import org.eclipse.nebula.widgets.xviewer.IXViewerValueColumn;
+import java.util.Collection;
+import java.util.Map;
import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
-import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsColumn;
import org.eclipse.osee.ats.world.WorldXViewerFactory;
@@ -26,7 +26,7 @@ import org.eclipse.osee.framework.ui.skynet.util.LogUtil;
/**
* @author Morgan E. Cook
*/
-public class RelatedArtifactChangedColumn extends XViewerAtsColumn implements IXViewerValueColumn {
+public class RelatedArtifactChangedColumn extends XViewerAtsColumn implements IAtsXViewerPreComputedColumn {
public static RelatedArtifactChangedColumn instance = new RelatedArtifactChangedColumn();
@@ -52,29 +52,34 @@ public class RelatedArtifactChangedColumn extends XViewerAtsColumn implements IX
}
@Override
- public String getColumnText(Object element, XViewerColumn column, int columnIndex) {
- try {
- if (element instanceof Artifact) {
- Artifact refArt =
- ((Artifact) element).getSoleAttributeValue(AtsAttributeTypes.TaskToChangedArtifactReference, null);
+ public void populateCachedValues(Collection<?> objects, Map<Long, String> preComputedValueMap) {
+ for (Object object : objects) {
+ String value = "";
+ try {
+ if (object instanceof Artifact) {
+ Artifact refArt =
+ ((Artifact) object).getSoleAttributeValue(AtsAttributeTypes.TaskToChangedArtifactReference, null);
- if (refArt != null) {
- BranchId refBranch = refArt.getBranch();
- if (refArt.isDeleted()) {
- return "Deleted";
- } else if (BranchManager.getState(refBranch).isCommitted() || BranchManager.getType(
- refBranch).isBaselineBranch()) {
- return "Commited";
- } else if (refArt.getLastModified().after(((Artifact) element).getLastModified())) {
- return refArt.getLastModified().toString();
- } else {
- return "Unmodified";
+ if (refArt != null) {
+ BranchId refBranch = refArt.getBranch();
+ if (refArt.isDeleted()) {
+ value = "Deleted";
+ } else if (BranchManager.getState(refBranch).isCommitted() || BranchManager.getType(
+ refBranch).isBaselineBranch()) {
+ value = "Commited";
+ } else if (refArt.getLastModified().after(((Artifact) object).getLastModified())) {
+ value = refArt.getLastModified().toString();
+ } else {
+ value = "Unmodified";
+ }
}
}
+ } catch (OseeCoreException ex) {
+ value = LogUtil.getCellExceptionString(ex);
}
- } catch (OseeCoreException ex) {
- return LogUtil.getCellExceptionString(ex);
+ Long key = getKey(object);
+ preComputedValueMap.put(key, value);
}
- return "";
}
+
} \ No newline at end of file

Back to the top