Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-08-29 13:08:16 -0400
committerdonald.g.dunne2016-09-01 20:21:25 -0400
commit95f99860a440fdeb31a7af2808be901e8604492d (patch)
tree634f045831f4bdc50edc241e54e84658452dd097
parentc6fd2a06bb320b4de123b6c1c082c8863d95f1ef (diff)
downloadorg.eclipse.osee-95f99860a440fdeb31a7af2808be901e8604492d.tar.gz
org.eclipse.osee-95f99860a440fdeb31a7af2808be901e8604492d.tar.xz
org.eclipse.osee-95f99860a440fdeb31a7af2808be901e8604492d.zip
bug[ats_ATS302825]: NR Alpha - Convert AtsColumnIdUI to pre-computed
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkItemEventHandler.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java25
2 files changed, 27 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkItemEventHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkItemEventHandler.java
index aeed731fae..091d861649 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkItemEventHandler.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkItemEventHandler.java
@@ -20,6 +20,8 @@ import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
/**
+ * Event handler to handle refreshing WorkflowEditor when work item is update remotely
+ *
* @author Donald G. Dunne
*/
public class AtsWorkItemEventHandler implements EventHandler {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
index 5ecfcd77bc..5300c10745 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
@@ -11,12 +11,15 @@
package org.eclipse.osee.ats.world;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.nebula.widgets.xviewer.IXViewerPreComputedColumn;
+import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
@@ -37,6 +40,7 @@ import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact
import org.eclipse.osee.framework.skynet.core.event.model.EventModType;
import org.eclipse.osee.framework.skynet.core.event.model.Sender;
import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.widgets.TreeItem;
/**
* Common location for event handling for task and world composites in order to keep number of registrations and
@@ -149,6 +153,8 @@ public class WorldXViewerEventManager {
try {
// Don't refresh deleted artifacts
if (!artifact.isDeleted() && AtsUtil.isAtsArtifact(artifact)) {
+ // Reset pre-computed column
+ clearPreComputedColumnValue(artifact, worldViewer);
worldViewer.refresh(artifact);
// If parent is loaded and child changed, refresh parent
if (artifact instanceof AbstractWorkflowArtifact) {
@@ -169,6 +175,24 @@ public class WorldXViewerEventManager {
}
}
+ private void clearPreComputedColumnValue(Artifact artifact, WorldXViewer worldViewer) {
+ try {
+ for (TreeItem item : worldViewer.getVisibleItems()) {
+ if (item.getData().equals(artifact)) {
+ for (XViewerColumn column : worldViewer.getCustomizeMgr().getCurrentVisibleTableColumns()) {
+ if (column instanceof IXViewerPreComputedColumn) {
+ ((IXViewerPreComputedColumn) column).populateCachedValues(Collections.singleton(artifact),
+ column.getPreComputedValueMap());
+ }
+ }
+ }
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+
+ }
+
private void processPurged(WorldXViewer worldViewer, IWorldViewerEventHandler handler) {
if (!deletedPurgedArts.isEmpty()) {
try {
@@ -210,4 +234,5 @@ public class WorldXViewerEventManager {
}
}
}
+
}

Back to the top