Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2020-02-13 21:35:07 +0000
committerDonald Dunne2020-02-17 19:24:26 +0000
commit88e4dcd738899e072409bda98db547901e36f1b1 (patch)
tree73237ffef8337e4450cf0b3943e9366001d98411
parentbf9e14ef6f51e90a888e131084fb117607706cf4 (diff)
downloadorg.eclipse.osee-88e4dcd738899e072409bda98db547901e36f1b1.tar.gz
org.eclipse.osee-88e4dcd738899e072409bda98db547901e36f1b1.tar.xz
org.eclipse.osee-88e4dcd738899e072409bda98db547901e36f1b1.zip
feature[TW16545]: Recently Visited Items not restoring items on restart
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/RecentlyVisistedItem.java21
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItem.java33
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItems.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateContentProvider.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItem.java2
5 files changed, 42 insertions, 22 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/RecentlyVisistedItem.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/RecentlyVisistedItem.java
index 64211391c72..8b225770a99 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/RecentlyVisistedItem.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/RecentlyVisistedItem.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.util;
import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
/**
@@ -19,7 +20,7 @@ import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
public class RecentlyVisistedItem {
ArtifactToken idToken;
- ArtifactTypeToken typeToken;
+ ArtifactTypeId typeId;
public ArtifactToken getIdToken() {
return idToken;
@@ -29,18 +30,10 @@ public class RecentlyVisistedItem {
this.idToken = idToken;
}
- public ArtifactTypeToken getTypeToken() {
- return typeToken;
- }
-
- public void setTypeToken(ArtifactTypeToken typeToken) {
- this.typeToken = typeToken;
- }
-
public static RecentlyVisistedItem valueOf(ArtifactToken idToken, ArtifactTypeToken typeToken) {
RecentlyVisistedItem item = new RecentlyVisistedItem();
item.setIdToken(idToken);
- item.setTypeToken(typeToken);
+ item.setTypeId(typeToken);
return item;
}
@@ -78,4 +71,12 @@ public class RecentlyVisistedItem {
}
return true;
}
+
+ public ArtifactTypeId getTypeId() {
+ return typeId;
+ }
+
+ public void setTypeId(ArtifactTypeId typeId) {
+ this.typeId = typeId;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItem.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItem.java
index 39d9a6cac9f..45ea2f269cc 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItem.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItem.java
@@ -14,6 +14,12 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.core.util.RecentlyVisistedItem;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
import org.eclipse.osee.ats.ide.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
@@ -28,17 +34,32 @@ public class RecentlyVisitedNavigateItem extends XNavigateItemAction {
private final RecentlyVisistedItem item;
public RecentlyVisitedNavigateItem(XNavigateItem parent, RecentlyVisistedItem item) {
- super(parent, item.getIdToken().getName(),
- ArtifactImageManager.getArtifactTypeImage(
- item.getTypeToken()) != null ? ArtifactImageManager.getArtifactTypeImage(
- item.getTypeToken()) : FrameworkImage.OPEN);
+ super(parent, item.getIdToken().getName(), FrameworkImage.OPEN);
+ ArtifactTypeId id = item.getTypeId();
+ if (id != null) {
+ ArtifactTypeToken type = ArtifactTypeManager.getType(id);
+ if (type.isValid()) {
+ oseeImage = ArtifactImageManager.getArtifactTypeImage(type);
+ }
+ }
this.item = item;
}
@Override
public void run(TableLoadOption... tableLoadOptions) {
- IAtsWorkItem workItem = AtsClientService.get().getWorkItemService().getWorkItem(item.getIdToken());
- if (workItem != null && !AtsClientService.get().getStoreService().isDeleted(workItem)) {
+ // Load artifact to check for deleted
+ Artifact workItemArt = (Artifact) AtsClientService.get().getQueryService().getArtifact(item.getIdToken(),
+ AtsClientService.get().getAtsBranch(), DeletionFlag.INCLUDE_DELETED);
+ if (workItemArt != null) {
+ if (workItemArt.isDeleted()) {
+ AWorkbench.popup("Item has been deleted.");
+ return;
+ }
+ IAtsWorkItem workItem = AtsClientService.get().getWorkItemService().getWorkItem(workItemArt);
+ if (workItem == null) {
+ AWorkbench.popupf("Item %s can not be found.", item.getIdToken());
+ return;
+ }
WorkflowEditor.edit(workItem);
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItems.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItems.java
index 971675bd0cf..befbd4c9cbc 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItems.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/RecentlyVisitedNavigateItems.java
@@ -58,10 +58,7 @@ public class RecentlyVisitedNavigateItems extends XNavigateItemAction implements
ensureLoaded();
navigateItem.getChildren().clear();
for (RecentlyVisistedItem item : visitedItems.getReverseVisited()) {
- IAtsWorkItem workItem = AtsClientService.get().getWorkItemService().getWorkItem(item.getIdToken());
- if (workItem != null && !AtsClientService.get().getStoreService().isDeleted(item.getIdToken())) {
- new RecentlyVisitedNavigateItem(navigateItem, item);
- }
+ new RecentlyVisitedNavigateItem(navigateItem, item);
}
Displays.ensureInDisplayThread(new Runnable() {
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateContentProvider.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateContentProvider.java
index b7328122d05..f315a6edd27 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateContentProvider.java
@@ -53,7 +53,8 @@ public class XNavigateContentProvider implements ITreeContentProvider {
public boolean hasChildren(Object element) {
if (element instanceof XNavigateItem) {
try {
- return ((XNavigateItem) element).hasChildren();
+ boolean hasChildren = ((XNavigateItem) element).hasChildren();
+ return hasChildren;
} catch (Exception ex) {
OseeLog.log(UiPluginConstants.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItem.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItem.java
index 0308c53254f..94d4f85cf2c 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItem.java
@@ -27,7 +27,7 @@ public class XNavigateItem {
private final List<XNavigateItem> children = new ArrayList<>();
private String name;
private XNavigateItem parent;
- private final KeyedImage oseeImage;
+ protected KeyedImage oseeImage;
private List<IXNavigateMenuItem> menuItems;
private Object data;
private long id = 0L;

Back to the top