Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-08-16 17:23:39 -0400
committerRyan D. Brooks2016-08-31 12:18:47 -0400
commit3da9e3e579a726ac39a3308f4d2ea3e6a6b89689 (patch)
treea49778004c317fa161aa376127c7f6b24ab11ad9
parent734bd8e38c9a69f76a86a7f56790979db34f87a9 (diff)
downloadorg.eclipse.osee-3da9e3e579a726ac39a3308f4d2ea3e6a6b89689.tar.gz
org.eclipse.osee-3da9e3e579a726ac39a3308f4d2ea3e6a6b89689.tar.xz
org.eclipse.osee-3da9e3e579a726ac39a3308f4d2ea3e6a6b89689.zip
bug[ats_ATS302825]: NR Alpha - Convert AtsColumnIdUI to pre-computed
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AtsColumnIdUI.java37
1 files changed, 30 insertions, 7 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AtsColumnIdUI.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AtsColumnIdUI.java
index 070d226df1..1b383c4b71 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AtsColumnIdUI.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AtsColumnIdUI.java
@@ -10,22 +10,25 @@
*******************************************************************************/
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.IXViewerPreComputedColumn;
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.IAtsServices;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.column.AtsColumnIdValueColumn;
import org.eclipse.osee.ats.api.config.ColumnAlign;
import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsColumn;
+import org.eclipse.osee.framework.ui.skynet.util.LogUtil;
/**
* XViewerAtsColumn for columns that provide their text through AtsColumnService and are not strictly attribute based.
*
* @author Donald G. Dunne
*/
-public class AtsColumnIdUI extends XViewerAtsColumn implements IXViewerValueColumn {
+public class AtsColumnIdUI extends XViewerAtsColumn implements IXViewerPreComputedColumn {
private final AtsColumnIdValueColumn columnIdColumn;
private final IAtsServices services;
@@ -53,14 +56,34 @@ public class AtsColumnIdUI extends XViewerAtsColumn implements IXViewerValueColu
}
@Override
- public String getColumnText(Object element, XViewerColumn column, int columnIndex) {
- String result = "";
- if (element instanceof IAtsObject) {
- result = services.getColumnService().getColumnText(columnIdColumn.getColumnId(), (IAtsObject) element);
+ public Long getKey(Object obj) {
+ Long result = 0L;
+ if (obj instanceof IAtsWorkItem) {
+ result = ((IAtsObject) obj).getUuid();
}
return result;
}
+ @Override
+ public void populateCachedValues(Collection<?> objects, Map<Long, String> preComputedValueMap) {
+ for (Object element : objects) {
+ String value = "";
+ try {
+ if (element instanceof IAtsObject) {
+ value = services.getColumnService().getColumnText(columnIdColumn.getColumnId(), (IAtsObject) element);
+ }
+ } catch (Exception ex) {
+ value = LogUtil.getCellExceptionString(ex);
+ }
+ preComputedValueMap.put(getKey(element), value);
+ }
+ }
+
+ @Override
+ public String getText(Object obj, Long key, String cachedValue) {
+ return cachedValue;
+ }
+
public static XViewerAlign getXViewerAlign(ColumnAlign align) {
if (align == ColumnAlign.Center) {
return XViewerAlign.Center;

Back to the top