Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-08-17 13:19:19 -0400
committerRyan D. Brooks2016-08-31 12:18:49 -0400
commitf313163ef2314472e411869a19dd9b19565659de (patch)
tree1215dada4da1006c5c7bb99203530658b75eaa59
parent3da9e3e579a726ac39a3308f4d2ea3e6a6b89689 (diff)
downloadorg.eclipse.osee-f313163ef2314472e411869a19dd9b19565659de.tar.gz
org.eclipse.osee-f313163ef2314472e411869a19dd9b19565659de.tar.xz
org.eclipse.osee-f313163ef2314472e411869a19dd9b19565659de.zip
bug[ats_ATS302825]: NR Alpha - Convert AgileFeatureGroupColumn to pre-computed
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java55
1 files changed, 36 insertions, 19 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java
index 3ddea93be9..ebe81e250a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java
@@ -16,14 +16,16 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.nebula.widgets.xviewer.IAltLeftClickProvider;
import org.eclipse.nebula.widgets.xviewer.IMultiColumnEditProvider;
-import org.eclipse.nebula.widgets.xviewer.IXViewerValueColumn;
+import org.eclipse.nebula.widgets.xviewer.IXViewerPreComputedColumn;
import org.eclipse.nebula.widgets.xviewer.XViewer;
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.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.agile.AgileEndpointApi;
import org.eclipse.osee.ats.api.agile.IAgileFeatureGroup;
@@ -33,7 +35,6 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
@@ -41,7 +42,6 @@ import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsColumn;
import org.eclipse.osee.ats.world.WorldXViewerFactory;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -59,7 +59,7 @@ import org.eclipse.swt.widgets.TreeItem;
/**
* @author Donald G. Dunne
*/
-public class AgileFeatureGroupColumn extends XViewerAtsColumn implements IXViewerValueColumn, IAltLeftClickProvider, IMultiColumnEditProvider {
+public class AgileFeatureGroupColumn extends XViewerAtsColumn implements IXViewerPreComputedColumn, IAltLeftClickProvider, IMultiColumnEditProvider {
public static AgileFeatureGroupColumn instance = new AgileFeatureGroupColumn();
@@ -94,6 +94,7 @@ public class AgileFeatureGroupColumn extends XViewerAtsColumn implements IXViewe
awa.persist("persist goals via alt-left-click");
}
if (modified) {
+ populateCachedValues(java.util.Collections.singleton(awa), preComputedValueMap);
xViewer.update(awa, null);
return true;
}
@@ -184,24 +185,40 @@ public class AgileFeatureGroupColumn extends XViewerAtsColumn implements IXViewe
}
@Override
- public String getColumnText(Object element, XViewerColumn column, int columnIndex) {
- try {
- if (Artifacts.isOfType(element, AtsArtifactTypes.Action)) {
- Set<String> strs = new HashSet<>();
- for (TeamWorkFlowArtifact team : ActionManager.getTeams(element)) {
- String str = getColumnText(team, column, columnIndex);
- if (Strings.isValid(str)) {
- strs.add(str);
+ public Long getKey(Object obj) {
+ Long result = 0L;
+ if (obj instanceof IAtsObject) {
+ result = ((IAtsObject) obj).getUuid();
+ }
+ return result;
+ }
+
+ @Override
+ public String getText(Object obj, Long key, String cachedValue) {
+ return cachedValue;
+ }
+
+ @Override
+ public void populateCachedValues(Collection<?> objects, Map<Long, String> preComputedValueMap) {
+ for (Object element : objects) {
+ try {
+ if (Artifacts.isOfType(element, AtsArtifactTypes.Action)) {
+ Set<String> strs = new HashSet<>();
+ for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(element)) {
+ for (Artifact art : ((Artifact) teamWf.getStoreObject()).getRelatedArtifacts(
+ AtsRelationTypes.AgileFeatureToItem_FeatureGroup)) {
+ strs.add(art.getName());
+ }
}
+ preComputedValueMap.put(getKey(element), Collections.toString(", ", strs));
+ } else {
+ preComputedValueMap.put(getKey(element),
+ Collections.toString(", ", ((Artifact) (IAtsWorkItem) element).getRelatedArtifacts(
+ AtsRelationTypes.AgileFeatureToItem_FeatureGroup)));
}
- return Collections.toString(", ", strs);
-
- } else {
- return Collections.toString(", ", ((Artifact) (IAtsWorkItem) element).getRelatedArtifacts(
- AtsRelationTypes.AgileFeatureToItem_FeatureGroup));
+ } catch (OseeCoreException ex) {
+ preComputedValueMap.put(getKey(element), LogUtil.getCellExceptionString(ex));
}
- } catch (OseeCoreException ex) {
- return LogUtil.getCellExceptionString(ex);
}
}

Back to the top