Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2021-01-20 20:42:53 +0000
committerdonald.g.dunne2021-01-27 05:09:08 +0000
commitd8edf191f54616fd331b85f3c61c77f527e5273a (patch)
treee74e726317d01af0124145f461481e12bb2512d6
parent70c90ebf4a9f98f33f2d480afa7f7d2bd479a37c (diff)
downloadorg.eclipse.osee-d8edf191f54616fd331b85f3c61c77f527e5273a.tar.gz
org.eclipse.osee-d8edf191f54616fd331b85f3c61c77f527e5273a.tar.xz
org.eclipse.osee-d8edf191f54616fd331b85f3c61c77f527e5273a.zip
bug[TW18555]: Workflow Editor deletes attrs on transition
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/AtsTopicEvent.java7
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsTestUtilTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java9
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java207
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandle.java41
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandler.java27
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeArtifactEventManager.java113
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeBranchEventManager.java31
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsTab.java48
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsToolbar.java7
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java139
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemHeader.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemReviewHeader.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeAssigneesHeader.java14
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeEstimatedHoursHeader.java11
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java90
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeMetricsHeader.java20
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeOriginatorHeader.java20
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfePercentCompleteHeader.java16
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeRelationsHyperlinkComposite.java72
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeStateCreatedOrigHeader.java51
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTargetedVersionHeader.java34
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTeamAndIdsHeader.java83
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java11
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java38
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeWorkPackage.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeDetailsSection.java11
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeHistorySection.java36
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeRelationsSection.java9
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java29
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/widget/ReviewInfoXWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/ev/internal/AtsEarnedValueImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/internal/Activator.java5
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/ToggleAtsAdmin.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/XCancellationReasonTextWidget.java10
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/XWorkingBranchButtonCreate.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/defect/DefectUtil.java8
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemEventHandler.java58
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemServiceClientImpl.java5
39 files changed, 346 insertions, 967 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/AtsTopicEvent.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/AtsTopicEvent.java
index e29d40b6000..ed07d0c5fc9 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/AtsTopicEvent.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/AtsTopicEvent.java
@@ -26,9 +26,16 @@ public class AtsTopicEvent extends AbstractTopicEvent {
public static Map<String, AtsTopicEvent> idToEvent = new HashMap<String, AtsTopicEvent>();
+ /**
+ * Event for any work item modified including transition. Artifacts will be reloaded after a transition.
+ */
public static final AtsTopicEvent WORK_ITEM_MODIFIED =
new AtsTopicEvent(EventType.LocalAndRemote, "ats/workitem/modified");
+ /**
+ * Specific event for only transitions. No reloaded is done through this event for transitioning so the events don't
+ * collide.
+ */
public static final AtsTopicEvent WORK_ITEM_TRANSITIONED =
new AtsTopicEvent(EventType.LocalAndRemote, "ats/workitem/transitioned");
public static final AtsTopicEvent WORK_ITEM_TRANSITION_FAILED =
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsTestUtilTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsTestUtilTest.java
index 54928e4ceec..8d0a2f82d5a 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsTestUtilTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsTestUtilTest.java
@@ -105,10 +105,8 @@ public class AtsTestUtilTest extends AtsTestUtil {
Assert.assertNotSame(AtsTestUtil.getTeamWf(), AtsTestUtil.getTeamWf4());
Assert.assertNotSame(AtsTestUtil.getActionArt(), AtsTestUtil.getActionArt4());
Assert.assertNotSame(
- AtsApiService.get().getActionableItemService().getActionableItems(
- AtsTestUtil.getTeamWf()).iterator().next(),
- AtsApiService.get().getActionableItemService().getActionableItems(
- AtsTestUtil.getTeamWf4()).iterator().next());
+ AtsApiService.get().getActionableItemService().getActionableItems(AtsTestUtil.getTeamWf()).iterator().next(),
+ AtsApiService.get().getActionableItemService().getActionableItems(AtsTestUtil.getTeamWf4()).iterator().next());
Assert.assertEquals(AtsApiService.get().getVersionService().getTargetedVersion(AtsTestUtil.getTeamWf4()),
AtsTestUtil.getVerArt4());
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java
index 666cc58b151..4ed17a4faeb 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java
@@ -17,7 +17,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
@@ -39,7 +38,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Bhawana Mishra
*/
-public class AbstractWfeSubWorkflow extends Composite implements IWfeEventHandle {
+public class AbstractWfeSubWorkflow extends Composite {
protected IAtsWorkItem workItem;
private Hyperlink labelLink;
private Hyperlink reasonLink;
@@ -121,10 +120,8 @@ public class AbstractWfeSubWorkflow extends Composite implements IWfeEventHandle
}
refresh();
- editor.registerEvent(this, attrType);
}
- @Override
public void refresh() {
String reason = "";
String label = "";
@@ -194,8 +191,4 @@ public class AbstractWfeSubWorkflow extends Composite implements IWfeEventHandle
changes.executeIfNeeded();
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java
index fe305a5c2c2..505b6f6c73e 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java
@@ -17,9 +17,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
-import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -38,8 +36,6 @@ import org.eclipse.osee.ats.ide.AtsImage;
import org.eclipse.osee.ats.ide.actions.IDirtyReportable;
import org.eclipse.osee.ats.ide.actions.ISelectedAtsArtifacts;
import org.eclipse.osee.ats.ide.agile.SprintMemberProvider;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandler;
import org.eclipse.osee.ats.ide.editor.event.WfeArtifactEventManager;
import org.eclipse.osee.ats.ide.editor.event.WfeBranchEventManager;
import org.eclipse.osee.ats.ide.editor.tab.attributes.WfeAttributesTab;
@@ -62,17 +58,10 @@ import org.eclipse.osee.ats.ide.workflow.task.TaskComposite;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.ide.world.IAtsMetricsProvider;
import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.OrcsTokenService;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.ArtifactToken;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
-import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.PresentationType;
-import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.jdk.core.result.XResultData;
-import org.eclipse.osee.framework.jdk.core.type.DoubleKeyHashMap;
-import org.eclipse.osee.framework.jdk.core.type.HashCollectionSet;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -80,14 +69,7 @@ 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;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactLoader;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
-import org.eclipse.osee.framework.skynet.core.event.model.AttributeChange;
-import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact;
-import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidRelation;
-import org.eclipse.osee.framework.skynet.core.event.model.EventModifiedBasicGuidArtifact;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
@@ -116,7 +98,7 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
/**
* @author Donald G. Dunne
*/
-public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyReportable, IWfeEventHandler, ISelectedAtsArtifacts, IAtsMetricsProvider {
+public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyReportable, ISelectedAtsArtifacts, IAtsMetricsProvider {
public static final String EDITOR_ID = "org.eclipse.osee.ats.ide.editor.WorkflowEditor";
private AbstractWorkflowArtifact workItem;
private WfeWorkFlowTab workFlowTab;
@@ -126,16 +108,6 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
private WfeAttributesTab attrTab;
private final List<IWfeEditorListener> editorListeners = new ArrayList<>();
WfeOutlinePage outlinePage;
- private final HashCollectionSet<AttributeTypeToken, IWfeEventHandle> attrHandlers = new HashCollectionSet<>();
- private final HashCollectionSet<RelationTypeToken, IWfeEventHandle> relHandlers = new HashCollectionSet<>();
- // This MUST be string guid until types are converted to id all at once and events use id
- private final HashCollectionSet<String, IWfeEventHandle> artHandlers = new HashCollectionSet<>();
- /**
- * This MUST be string guid until types are converted to id all at once and events use id. Used when want to listen
- * for rel events for a artifact other than the editor workItem.
- */
- private final DoubleKeyHashMap<RelationTypeToken, String, List<IWfeEventHandle>> artRelHandlers =
- new DoubleKeyHashMap<>();
private WfeReloadTab reloadTab;
private WfeMetricsTab metricsTab;
@@ -435,8 +407,13 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
}
}
- public void refreshPages() {
+ /**
+ * Refresh all tabs, sections and widgets. Should be called on reload of artifact or artifact changed event.
+ * Attribute widgets are reset so they don't register as dirty cause they don't have latest value in artifact.
+ */
+ public void refresh() {
try {
+ System.err.println("WFE Refresh " + workItem.toStringWithId());
if (getContainer() == null || getContainer().isDisposed()) {
return;
}
@@ -449,6 +426,10 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
if (taskTab != null) {
taskTab.refresh();
}
+ if (defectsTab != null) {
+ defectsTab.refresh();
+ }
+ // Don't refresh attribute tab, it listens for reload events and ArtifactEvents
onDirtied();
updatePartName();
} catch (Exception ex) {
@@ -644,12 +625,6 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
return this;
}
- @Override
- public WorkflowEditor getWorkflowEditor() {
- return this;
- }
-
- @Override
public boolean isDisposed() {
return getContainer() == null || getContainer().isDisposed();
}
@@ -739,166 +714,6 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
setPageText(index, tabName);
}
- public void registerEvent(IWfeEventHandle handler, AttributeTypeToken... attrTypes) {
- for (AttributeTypeToken attrType : attrTypes) {
- attrHandlers.put(attrType, handler);
- }
- }
-
- public void registerEvent(IWfeEventHandle handler, RelationTypeToken... relTypes) {
- for (RelationTypeToken relType : relTypes) {
- relHandlers.put(relType, handler);
- }
- }
-
- public void registerEvent(IWfeEventHandle handler, Artifact... artifacts) {
- for (Artifact art : artifacts) {
- artHandlers.put(art.getGuid(), handler);
- }
- }
-
- /**
- * Listen to events for other artifact relation changes (like TeamWf siblings added/deleted)
- */
- public void registerEvent(IWfeEventHandle handler, ArtifactToken artifact, RelationTypeToken... relTypes) {
- for (RelationTypeToken relType : relTypes) {
- List<IWfeEventHandle> handlers = artRelHandlers.get(relType, artifact.getGuid());
- if (handlers == null) {
- handlers = new ArrayList<>();
- artRelHandlers.put(relType, artifact.getGuid(), handlers);
- }
- handlers.add(handler);
- }
- }
-
- /**
- * Handle Events for attributes change to this WorkItem or relations against this WorkItem
- */
- public void handleEvent(ArtifactEvent artifactEvent) {
- OrcsTokenService tokenService = OsgiUtil.getService(ArtifactLoader.class, OrcsTokenService.class);
-
- // Only want to call artHandlers once if an artifact changed for any reason
- Set<String> handledArts = new HashSet<>();
- for (EventBasicGuidArtifact eArt : artifactEvent.getArtifacts()) {
- if (eArt instanceof EventModifiedBasicGuidArtifact) {
- EventModifiedBasicGuidArtifact eMArt = (EventModifiedBasicGuidArtifact) eArt;
- handleArtifactEvent(handledArts, eMArt.getGuid());
- if (eMArt.getGuid().equals(getWorkItem().getGuid())) {
- for (AttributeChange attr : eMArt.getAttributeChanges()) {
- handleEvent(tokenService.getAttributeType(attr.getAttrTypeGuid()));
- }
- }
- }
- }
- for (EventBasicGuidRelation eRel : artifactEvent.getRelations()) {
- if (eRel.getArtA().getGuid().equals(getWorkItem().getGuid()) || eRel.getArtB().getGuid().equals(
- getWorkItem().getGuid())) {
-
- Set<IWfeEventHandle> handlers = relHandlers.getValues(tokenService.getRelationType(eRel.getRelTypeGuid()));
- if (handlers != null) {
- for (IWfeEventHandle handler : handlers) {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- handler.refresh();
- }
- });
- }
- }
- handledArts.clear();
- if (!handledArts.contains(getWorkItem().getGuid())) {
- Set<IWfeEventHandle> handlers2 = artHandlers.getValues(getWorkItem().getStoreObject().getGuid());
- if (handlers2 != null) {
- for (IWfeEventHandle handler : handlers2) {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- handler.refresh();
- }
- });
- }
- }
- }
- handledArts.add(getWorkItem().getGuid());
- }
- }
- for (EventBasicGuidRelation eRel : artifactEvent.getRelations()) {
- for (Entry<RelationTypeToken, String> relArt : artRelHandlers.keySet().entrySet()) {
- String artGuid = relArt.getValue();
- RelationTypeToken relation = relArt.getKey();
- if (eRel.getArtA().getGuid().equals(artGuid) || eRel.getArtB().getGuid().equals(artGuid)) {
- if (eRel.getRelTypeGuid().equals(relation.getId())) {
- List<IWfeEventHandle> handlers = artRelHandlers.get(relation, artGuid);
- if (handlers != null) {
- for (IWfeEventHandle handler : handlers) {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- handler.refresh();
- }
- });
- }
- }
- }
- handledArts.clear();
- if (!handledArts.contains(artGuid)) {
- List<IWfeEventHandle> handlers2 = artRelHandlers.get(relation, artGuid);
- if (handlers2 != null) {
- for (IWfeEventHandle handler : handlers2) {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- handler.refresh();
- }
- });
- }
- }
- }
- }
- }
- handledArts.add(getWorkItem().getGuid());
- }
-
- onDirtied();
-
- updatePartName();
- }
-
- private void handleArtifactEvent(Set<String> handledArts, String guid) {
- if (!handledArts.contains(guid)) {
- Artifact loadedWf = ArtifactCache.getActive(guid, AtsApiService.get().getAtsBranch());
- if (loadedWf != null) {
- if (artHandlers.containsKey(loadedWf.getGuid())) {
- Set<IWfeEventHandle> handlers = new HashSet<IWfeEventHandle>();
- handlers.addAll(artHandlers.getValues(loadedWf.getGuid()));
- for (IWfeEventHandle handler : handlers) {
- handler.refresh();
- }
- }
- }
- handledArts.add(guid);
- }
- }
-
- public void handleEvent(AttributeTypeToken attrType) {
- Set<IWfeEventHandle> handlers = attrHandlers.getValues(attrType);
- if (handlers != null && !handlers.isEmpty()) {
- for (IWfeEventHandle handler : handlers) {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- handler.refresh();
- }
- });
- }
- }
- }
-
public void setPage(int pageId) {
setActivePage(pageId);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandle.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandle.java
deleted file mode 100644
index 2b3c7d7677b..00000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandle.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2019 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Boeing - initial API and implementation
- **********************************************************************/
-
-package org.eclipse.osee.ats.ide.editor.event;
-
-import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
-
-/**
- * Implement to be notified of change to attr or rel type
- *
- * @author Donald G. Dunne
- */
-public interface IWfeEventHandle {
-
- IAtsWorkItem getWorkItem();
-
- default void refresh() {
- // do nothing
- }
-
- default void refresh(ArtifactEvent artifactEvent) {
- // do nothing
- }
-
- default void setEditor(WorkflowEditor editor) {
- // do nothing
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandler.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandler.java
deleted file mode 100644
index 3fce1428d8c..00000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/IWfeEventHandler.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2010 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Boeing - initial API and implementation
- **********************************************************************/
-
-package org.eclipse.osee.ats.ide.editor.event;
-
-import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-
-/**
- * @author Donald G. Dunne
- */
-public interface IWfeEventHandler {
-
- public WorkflowEditor getWorkflowEditor();
-
- public boolean isDisposed();
-
-}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeArtifactEventManager.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeArtifactEventManager.java
index ded9ed4bd31..6ae08cd3ecf 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeArtifactEventManager.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeArtifactEventManager.java
@@ -17,21 +17,15 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.util.AtsTopicEvent;
-import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.AtsUtilClient;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.ide.workflow.review.AbstractReviewArtifact;
-import org.eclipse.osee.ats.ide.workflow.review.ReviewManager;
-import org.eclipse.osee.ats.ide.workflow.task.TaskArtifact;
-import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.event.listener.IArtifactEventListener;
@@ -42,27 +36,27 @@ import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
/**
- * Common location for event handling for SMAEditors in order to keep number of registrations and processing to a
- * minimum.
+ * Common location for event handling for ATS objects
*
* @author Donald G. Dunne
*/
public class WfeArtifactEventManager implements IArtifactEventListener, EventHandler {
- static List<IWfeEventHandler> handlers = new CopyOnWriteArrayList<>();
+ static List<WorkflowEditor> editors = new CopyOnWriteArrayList<>();
static WfeArtifactEventManager instance = new WfeArtifactEventManager();
+ // Singleton
private WfeArtifactEventManager() {
OseeEventManager.addListener(this);
}
- public static void add(IWfeEventHandler iWorldEventHandler) {
- WfeArtifactEventManager.handlers.add(iWorldEventHandler);
+ public static void add(WorkflowEditor editor) {
+ WfeArtifactEventManager.editors.add(editor);
}
- public static void remove(IWfeEventHandler iWorldEventHandler) {
+ public static void remove(WorkflowEditor editor) {
if (instance != null) {
- WfeArtifactEventManager.handlers.remove(iWorldEventHandler);
+ WfeArtifactEventManager.editors.remove(editor);
}
}
@@ -73,9 +67,9 @@ public class WfeArtifactEventManager implements IArtifactEventListener, EventHan
@Override
public void handleArtifactEvent(final ArtifactEvent artifactEvent, Sender sender) {
- for (IWfeEventHandler handler : handlers) {
- if (handler.isDisposed()) {
- handlers.remove(handler);
+ for (WorkflowEditor editor : editors) {
+ if (editor.isDisposed()) {
+ editors.remove(editor);
}
}
try {
@@ -85,31 +79,20 @@ public class WfeArtifactEventManager implements IArtifactEventListener, EventHan
} catch (OseeCoreException ex) {
return;
}
- for (final IWfeEventHandler handler : handlers) {
+ for (final WorkflowEditor editor : editors) {
try {
- safelyProcessHandler(artifactEvent, handler);
+ safelyProcessHandler(artifactEvent, editor);
} catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, "Error processing event handler - " + handler, ex);
+ OseeLog.log(Activator.class, Level.SEVERE, "Error processing event handler - " + editor, ex);
}
}
}
- private void safelyProcessHandler(final ArtifactEvent artifactEvent, final IWfeEventHandler handler) {
- final AbstractWorkflowArtifact awa = handler.getWorkflowEditor().getWorkItem();
- // boolean refreshed = false;
+ private void safelyProcessHandler(final ArtifactEvent artifactEvent, final WorkflowEditor editor) {
+ final AbstractWorkflowArtifact awa = editor.getWorkItem();
if (artifactEvent.isDeletedPurged(awa)) {
- handler.getWorkflowEditor().closeEditor();
- return;
- }
-
- if (isReloaded(artifactEvent, awa)) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- handler.getWorkflowEditor().refreshPages();
- }
- });
+ editor.closeEditor();
return;
}
@@ -117,53 +100,12 @@ public class WfeArtifactEventManager implements IArtifactEventListener, EventHan
@Override
public void run() {
- handler.getWorkflowEditor().handleEvent(artifactEvent);
+ editor.refresh();
}
});
}
- private boolean isReloaded(ArtifactEvent artifactEvent, AbstractWorkflowArtifact sma) {
- try {
- if (artifactEvent.isReloaded(sma)) {
- return true;
- }
- if (sma instanceof TeamWorkFlowArtifact) {
- for (IAtsTask task : AtsApiService.get().getTaskService().getTasks((TeamWorkFlowArtifact) sma)) {
- if (artifactEvent.isReloaded((TaskArtifact) task.getStoreObject())) {
- return true;
- }
- }
- }
- if (sma.isTeamWorkflow()) {
- for (AbstractReviewArtifact reviewArt : ReviewManager.getReviews((TeamWorkFlowArtifact) sma)) {
- if (artifactEvent.isReloaded(reviewArt)) {
- return true;
- }
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- return false;
- }
- return false;
- }
-
- public static boolean isLoaded(Artifact artifact) {
- for (IWfeEventHandler handler : handlers) {
- try {
- if (!handler.isDisposed()) {
- if (artifact.equals(handler.getWorkflowEditor().getArtifactFromEditorInput())) {
- return true;
- }
- }
- } catch (Exception ex) {
- OseeLog.logf(Activator.class, Level.SEVERE, ex, "Error processing event handler for - %s", handler);
- }
- }
- return false;
- }
-
@Override
public void handleEvent(Event event) {
try {
@@ -171,20 +113,15 @@ public class WfeArtifactEventManager implements IArtifactEventListener, EventHan
String ids = (String) event.getProperty(AtsTopicEvent.WORK_ITEM_IDS_KEY);
for (Long workItemId : Collections.fromString(ids, ";", Long::valueOf)) {
ArtifactId workItemArtId = ArtifactId.valueOf(workItemId);
- String attrTypeIds = (String) event.getProperty(AtsTopicEvent.WORK_ITEM_ATTR_TYPE_IDS_KEY);
- for (Long attrTypeId : Collections.fromString(attrTypeIds, ";", Long::valueOf)) {
- for (IWfeEventHandler handler : handlers) {
- try {
- if (!handler.isDisposed()) {
- if (handler.getWorkflowEditor().getArtifactFromEditorInput().equals(workItemArtId)) {
- handler.getWorkflowEditor().handleEvent(
- AttributeTypeManager.getAttributeType(attrTypeId));
- }
+ for (WorkflowEditor editor : editors) {
+ try {
+ if (!editor.isDisposed()) {
+ if (editor.getWorkItem().equals(workItemArtId)) {
+ editor.refresh();
}
- } catch (Exception ex) {
- OseeLog.logf(Activator.class, Level.SEVERE, ex, "Error processing event handler for - %s",
- handler);
}
+ } catch (Exception ex) {
+ OseeLog.logf(Activator.class, Level.SEVERE, ex, "Error processing event handler for - %s", editor);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeBranchEventManager.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeBranchEventManager.java
index 40e9cf645a5..6d1b544ea44 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeBranchEventManager.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/event/WfeBranchEventManager.java
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
+import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
@@ -39,23 +40,23 @@ import org.eclipse.osee.framework.ui.swt.Displays;
*/
public class WfeBranchEventManager implements IBranchEventListener {
- List<IWfeEventHandler> handlers = new CopyOnWriteArrayList<>();
+ List<WorkflowEditor> editors = new CopyOnWriteArrayList<>();
static WfeBranchEventManager instance = new WfeBranchEventManager();
private WfeBranchEventManager() {
OseeEventManager.addListener(this);
}
- public static void add(IWfeEventHandler iWorldEventHandler) {
+ public static void add(WorkflowEditor editor) {
OseeEventManager.addListener(instance);
if (instance != null) {
- instance.handlers.add(iWorldEventHandler);
+ instance.editors.add(editor);
}
}
- public static void remove(IWfeEventHandler iWorldEventHandler) {
+ public static void remove(WorkflowEditor editor) {
if (instance != null) {
- instance.handlers.remove(iWorldEventHandler);
+ instance.editors.remove(editor);
}
}
@@ -66,12 +67,12 @@ public class WfeBranchEventManager implements IBranchEventListener {
@Override
public void handleBranchEvent(Sender sender, BranchEvent branchEvent) {
- for (IWfeEventHandler handler : new ArrayList<>(handlers)) {
- if (handler.isDisposed()) {
- handlers.remove(handler);
+ for (WorkflowEditor editor : new ArrayList<>(editors)) {
+ if (editor.isDisposed()) {
+ editors.remove(editor);
}
}
- for (final IWfeEventHandler handler : handlers) {
+ for (final WorkflowEditor handler : editors) {
try {
safelyProcessHandler(branchEvent.getEventType(), branchEvent.getSourceBranch());
} catch (Exception ex) {
@@ -81,11 +82,11 @@ public class WfeBranchEventManager implements IBranchEventListener {
}
private void safelyProcessHandler(BranchEventType branchEventType, BranchId branch) {
- for (final IWfeEventHandler handler : handlers) {
- if (handler.isDisposed()) {
+ for (final WorkflowEditor editor : editors) {
+ if (editor.isDisposed()) {
OseeLog.log(Activator.class, Level.SEVERE, "Unexpected handler disposed but not unregistered.");
}
- final AbstractWorkflowArtifact awa = handler.getWorkflowEditor().getWorkItem();
+ final AbstractWorkflowArtifact awa = editor.getWorkItem();
try {
if (!awa.isTeamWorkflow()) {
return;
@@ -105,12 +106,12 @@ public class WfeBranchEventManager implements IBranchEventListener {
Displays.ensureInDisplayThread(new Runnable() {
@Override
public void run() {
- if (handler.isDisposed()) {
+ if (editor.isDisposed()) {
return;
}
try {
- handler.getWorkflowEditor().refreshPages();
- handler.getWorkflowEditor().onDirtied();
+ editor.refresh();
+ editor.onDirtied();
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsTab.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsTab.java
index 9cb2b46ba97..23c4c3c7f2a 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsTab.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsTab.java
@@ -13,15 +13,12 @@
package org.eclipse.osee.ats.ide.editor.tab.defects;
-import java.util.Arrays;
-import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
import org.eclipse.osee.ats.core.review.ReviewDefectError;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
@@ -37,21 +34,11 @@ import org.eclipse.osee.ats.ide.workflow.review.defect.ReviewDefectValidator;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
-import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
-import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactTypeEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.filter.BranchIdEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.listener.IArtifactEventListener;
-import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
-import org.eclipse.osee.framework.skynet.core.event.model.Sender;
-import org.eclipse.osee.framework.ui.skynet.action.RefreshAction.IRefreshActionHandler;
import org.eclipse.osee.framework.ui.skynet.util.FormsUtil;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -62,10 +49,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class WfeDefectsTab extends WfeAbstractTab implements IRefreshActionHandler, DefectRefreshListener, IArtifactEventListener {
- private static final List<IEventFilter> EVENT_FILTERS =
- Arrays.asList(new BranchIdEventFilter(AtsApiService.get().getAtsBranch()),
- new ArtifactTypeEventFilter(AtsArtifactTypes.PeerToPeerReview));
+public class WfeDefectsTab extends WfeAbstractTab implements DefectRefreshListener {
private Composite bodyComp;
private ScrolledForm scrolledForm;
public final static String ID = "ats.review.defects.tab";
@@ -73,13 +57,10 @@ public class WfeDefectsTab extends WfeAbstractTab implements IRefreshActionHandl
private DefectXViewer xViewer;
private WfeDefectsToolbar toolBar;
private Label messageLabel;
- private final WfeDefectsTab fTab;
public WfeDefectsTab(WorkflowEditor editor, IAtsPeerToPeerReview review) {
super(editor, ID, review, "Defects");
this.review = review;
- fTab = this;
- OseeEventManager.addListener(this);
}
@Override
@@ -93,13 +74,6 @@ public class WfeDefectsTab extends WfeAbstractTab implements IRefreshActionHandl
bodyComp.setLayout(gridLayout);
GridData gd = new GridData(SWT.LEFT, SWT.LEFT, true, true);
bodyComp.setLayoutData(gd);
- bodyComp.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- OseeEventManager.removeListener(fTab);
- }
- });
final Composite mainComp = new Composite(bodyComp, SWT.BORDER);
GridData gd2 = new GridData(SWT.FILL, SWT.FILL, true, true);
@@ -159,7 +133,6 @@ public class WfeDefectsTab extends WfeAbstractTab implements IRefreshActionHandl
public void run() {
try {
if (!Widgets.isAccessible(messageLabel)) {
- OseeEventManager.removeListener(fTab);
return;
}
ReviewDefectError error = data.getError();
@@ -179,10 +152,8 @@ public class WfeDefectsTab extends WfeAbstractTab implements IRefreshActionHandl
});
}
- @Override
- public void refreshActionHandler() {
+ public void refresh() {
if (xViewer != null) {
- AtsApiService.get().getQueryServiceIde().getArtifact(review).reloadAttributesAndRelations();
xViewer.loadTable(this);
}
}
@@ -194,22 +165,9 @@ public class WfeDefectsTab extends WfeAbstractTab implements IRefreshActionHandl
}
@Override
- public List<? extends IEventFilter> getEventFilters() {
- return EVENT_FILTERS;
- }
-
- @Override
- public void handleArtifactEvent(ArtifactEvent artifactEvent, Sender sender) {
- if (artifactEvent.isModified(AtsApiService.get().getQueryServiceIde().getArtifact(review.getStoreObject()))) {
- refreshActionHandler();
- refreshMessageLabel();
- }
- }
-
- @Override
public IToolBarManager createToolbar(IManagedForm managedForm) {
- toolBar = new WfeDefectsToolbar(scrolledForm, xViewer, review, this);
+ toolBar = new WfeDefectsToolbar(scrolledForm, xViewer, review);
toolBar.build();
return super.createToolbar(managedForm);
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsToolbar.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsToolbar.java
index 6956227226c..f510b63e488 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsToolbar.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/defects/WfeDefectsToolbar.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
import org.eclipse.osee.ats.ide.util.widgets.defect.DefectUtil;
import org.eclipse.osee.ats.ide.util.widgets.defect.DefectXViewer;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.action.RefreshAction.IRefreshActionHandler;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
@@ -40,18 +39,16 @@ public class WfeDefectsToolbar {
private final DefectXViewer defectXViewer;
private DefectUtil defectUtil;
private Action importDefectsAction;
- private final IRefreshActionHandler refreshActionHandler;
- public WfeDefectsToolbar(ScrolledForm scrolledForm, DefectXViewer defectXViewer, IAtsPeerToPeerReview review, IRefreshActionHandler refreshActionHandler) {
+ public WfeDefectsToolbar(ScrolledForm scrolledForm, DefectXViewer defectXViewer, IAtsPeerToPeerReview review) {
this.scrolledForm = scrolledForm;
this.defectXViewer = defectXViewer;
this.review = review;
- this.refreshActionHandler = refreshActionHandler;
}
public DefectUtil getDefectUtil() {
if (defectUtil == null) {
- defectUtil = new DefectUtil(defectXViewer, review, refreshActionHandler);
+ defectUtil = new DefectUtil(defectXViewer, review);
}
return defectUtil;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java
index 6249550b785..92b74b49610 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java
@@ -26,8 +26,6 @@ import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.api.event.IAtsWorkItemTopicEventListener;
-import org.eclipse.osee.ats.api.util.AtsTopicEvent;
import org.eclipse.osee.ats.help.ui.AtsHelpContext;
import org.eclipse.osee.ats.ide.config.AtsBulkLoad;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
@@ -40,12 +38,10 @@ import org.eclipse.osee.ats.ide.editor.tab.workflow.section.WfeRelationsSection;
import org.eclipse.osee.ats.ide.editor.tab.workflow.section.WfeUndefinedStateSection;
import org.eclipse.osee.ats.ide.editor.tab.workflow.section.WfeWorkflowSection;
import org.eclipse.osee.ats.ide.internal.Activator;
-import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workdef.StateXWidgetPage;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.ide.workflow.WorkflowManager;
import org.eclipse.osee.ats.ide.world.IWorldViewerEventHandler;
-import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.util.Result;
@@ -65,8 +61,6 @@ import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ExceptionComposite;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -82,9 +76,9 @@ import org.eclipse.ui.progress.UIJob;
/**
* @author Donald G. Dunne
*/
-public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventHandler, IAtsWorkItemTopicEventListener {
+public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventHandler {
private final AbstractWorkflowArtifact awa;
- private final List<WfeWorkflowSection> sections = new ArrayList<>();
+ private final List<WfeWorkflowSection> stateSections = new ArrayList<>();
private final List<StateXWidgetPage> statePages = new ArrayList<>();
private IManagedForm managedForm;
private Composite bodyComp;
@@ -93,9 +87,9 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
public final static String ID = "ats.workflow.tab";
private final WorkflowEditor editor;
private final List<WfeUndefinedStateSection> undefinedStateSections = new ArrayList<>();
- private WfeDetailsSection smaDetailsSection;
- private WfeRelationsSection smaRelationsSection;
- private WfeHistorySection smaHistorySection;
+ private WfeDetailsSection detailsSection;
+ private WfeRelationsSection relationsSection;
+ private WfeHistorySection historySection;
public WfeWorkFlowTab(WorkflowEditor editor, AbstractWorkflowArtifact awa) {
super(editor, ID, awa, "Workflow");
@@ -129,24 +123,11 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
HelpUtil.setHelp(managedForm.getForm(), AtsHelpContext.WORKFLOW_EDITOR__WORKFLOW_TAB);
}
- // Register for events and deregister on dispose
- AtsApiService.get().getEventService().registerAtsWorkItemTopicEvent(this, AtsTopicEvent.WORK_ITEM_TRANSITIONED,
- AtsTopicEvent.WORK_ITEM_TRANSITION_FAILED);
-
List<IOperation> ops = new ArrayList<>();
ops.addAll(AtsBulkLoad.getConfigLoadingOperations());
IOperation operation = Operations.createBuilder("Load Workflow Tab").addAll(ops).build();
Operations.executeAsJob(operation, false, Job.LONG, new ReloadJobChangeAdapter(editor));
- final WfeWorkFlowTab fThis = this;
- bodyComp.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- AtsApiService.get().getEventService().deRegisterAtsWorkItemTopicEvent(fThis);
- }
- });
-
} catch (Exception ex) {
handleException(ex);
}
@@ -259,8 +240,8 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
private void createDetailsSection() {
try {
- smaDetailsSection = new WfeDetailsSection(editor, atsBody, editor.getToolkit(), SWT.NONE);
- managedForm.addPart(smaDetailsSection);
+ detailsSection = new WfeDetailsSection(editor, atsBody, editor.getToolkit(), SWT.NONE);
+ managedForm.addPart(detailsSection);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -278,8 +259,8 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
private void createRelationsSection() {
try {
- smaRelationsSection = new WfeRelationsSection(editor, atsBody, editor.getToolkit(), SWT.NONE);
- managedForm.addPart(smaRelationsSection);
+ relationsSection = new WfeRelationsSection(editor, atsBody, editor.getToolkit(), SWT.NONE);
+ managedForm.addPart(relationsSection);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
@@ -303,8 +284,8 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
private void createHistorySection() {
try {
- smaHistorySection = new WfeHistorySection(editor, atsBody, editor.getToolkit(), SWT.NONE);
- managedForm.addPart(smaHistorySection);
+ historySection = new WfeHistorySection(editor, atsBody, editor.getToolkit(), SWT.NONE);
+ managedForm.addPart(historySection);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -348,7 +329,7 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
private void createStateSection(Composite sectionsComp, StateXWidgetPage statePage) {
WfeWorkflowSection section = new WfeWorkflowSection(sectionsComp, SWT.NONE, statePage, awa, editor);
managedForm.addPart(section);
- sections.add(section);
+ stateSections.add(section);
statePages.add(statePage);
}
@@ -378,7 +359,7 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
rd.log("======> WFE - Header\n");
headerComp.isXWidgetDirty(rd);
}
- for (WfeWorkflowSection section : sections) {
+ for (WfeWorkflowSection section : stateSections) {
rd.logf("======> WFE Section - %s\n", section.getStatePage().getName());
section.isXWidgetDirty(rd);
}
@@ -390,7 +371,7 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
if (Widgets.isAccessible(headerComp)) {
result = headerComp.isXWidgetSavable();
}
- for (WfeWorkflowSection section : sections) {
+ for (WfeWorkflowSection section : stateSections) {
result = section.isXWidgetSavable();
if (result.isFalse()) {
return result;
@@ -403,7 +384,7 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
List<IArtifactStoredWidget> artWidgets = new ArrayList<>();
headerComp.getDirtyIArtifactWidgets(artWidgets);
// Collect all dirty widgets first (so same attribute shown on different sections don't colide
- for (WfeWorkflowSection section : sections) {
+ for (WfeWorkflowSection section : stateSections) {
section.getDirtyIArtifactWidgets(artWidgets);
}
for (IArtifactStoredWidget widget : artWidgets) {
@@ -416,19 +397,19 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
if (Widgets.isAccessible(headerComp)) {
headerComp.dispose();
}
- if (smaDetailsSection != null) {
- smaDetailsSection.dispose();
+ if (detailsSection != null) {
+ detailsSection.dispose();
}
for (WfeUndefinedStateSection section : undefinedStateSections) {
section.dispose();
}
- if (smaHistorySection != null) {
- smaHistorySection.dispose();
+ if (historySection != null) {
+ historySection.dispose();
}
- if (smaRelationsSection != null) {
- smaRelationsSection.dispose();
+ if (relationsSection != null) {
+ relationsSection.dispose();
}
- for (WfeWorkflowSection section : sections) {
+ for (WfeWorkflowSection section : stateSections) {
section.dispose();
}
}
@@ -436,7 +417,7 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
private WfeHeaderComposite headerComp;
public WfeWorkflowSection getCurrentStateSection() {
- for (WfeWorkflowSection section : sections) {
+ for (WfeWorkflowSection section : stateSections) {
if (section.getPage().getName().equals(editor.getWorkItem().getCurrentStateName())) {
return section;
}
@@ -446,32 +427,47 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
public void refresh() {
if (editor != null) {
- String stateName = awa.getCurrentStateName();
+ Displays.ensureInDisplayThread(new Runnable() {
- // Determine if state already exists
- boolean found = false;
- for (WfeWorkflowSection section : sections) {
- if (section.getPage().getName().equals(stateName)) {
- found = true;
- }
- }
+ @Override
+ public void run() {
+ String stateName = awa.getCurrentStateName();
+
+ // Determine if state already exists
+ boolean found = false;
+ for (WfeWorkflowSection section : stateSections) {
+ if (section.getPage().getName().equals(stateName)) {
+ found = true;
+ }
+ }
+
+ headerComp.refresh();
- // Create state if not exist
- if (!found) {
- Pair<StateXWidgetPage, Composite> pageAndComp = stateNameToPageAndComposite.get(stateName);
- if (pageAndComp != null) {
- StateXWidgetPage statePage = pageAndComp.getFirst();
- createStateSection(pageAndComp.getSecond(), statePage);
+ // Create state if not exist
+ if (!found) {
+ Pair<StateXWidgetPage, Composite> pageAndComp = stateNameToPageAndComposite.get(stateName);
+ if (pageAndComp != null) {
+ StateXWidgetPage statePage = pageAndComp.getFirst();
+ createStateSection(pageAndComp.getSecond(), statePage);
+ }
+ }
+
+ for (WfeWorkflowSection section : stateSections) {
+ section.refresh();
+ }
+ refreshExpandStates();
+
+ relationsSection.refresh();
+ historySection.refresh();
+ detailsSection.refresh();
}
- }
- for (WfeWorkflowSection section : sections) {
- section.refresh();
- }
+
+ });
}
}
public void refreshExpandStates() {
- for (WfeWorkflowSection wfeSection : sections) {
+ for (WfeWorkflowSection wfeSection : stateSections) {
if (!Widgets.isAccessible(wfeSection.getMainComp())) {
continue;
}
@@ -510,27 +506,8 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
return statePages;
}
- @Override
- public void handleEvent(AtsTopicEvent topicEvent, Collection<ArtifactId> workItems) {
- if (topicEvent.equals(AtsTopicEvent.WORK_ITEM_TRANSITIONED) || topicEvent.equals(
- AtsTopicEvent.WORK_ITEM_TRANSITION_FAILED)) {
- if (this.isDisposed()) {
- AtsApiService.get().getEventService().deRegisterAtsWorkItemTopicEvent(this);
- return;
- }
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- refresh();
- refreshExpandStates();
- }
- });
- }
- }
-
public void computeSizeAndReflow() {
- for (WfeWorkflowSection section : sections) {
+ for (WfeWorkflowSection section : stateSections) {
section.computeTextSizesAndReflow();
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemHeader.java
index f2f0f79e6d0..2d9a1331462 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemHeader.java
@@ -15,12 +15,10 @@ package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.ide.actions.EditActionableItemsAction;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
@@ -40,7 +38,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeActionableItemHeader extends Composite implements IWfeEventHandle {
+public class WfeActionableItemHeader extends Composite {
private Label label;
private final IAtsWorkItem workItem;
@@ -86,14 +84,11 @@ public class WfeActionableItemHeader extends Composite implements IWfeEventHandl
label = toolkit.createLabel(this, " ");
refresh();
- editor.registerEvent(this, AtsAttributeTypes.ActionableItemReference);
-
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
- @Override
public void refresh() {
if (label.isDisposed()) {
return;
@@ -126,9 +121,4 @@ public class WfeActionableItemHeader extends Composite implements IWfeEventHandl
layout();
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemReviewHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemReviewHeader.java
index b188487558e..6c4f19df09c 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemReviewHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeActionableItemReviewHeader.java
@@ -17,10 +17,8 @@ import java.util.Collection;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.widgets.dialog.AICheckTreeDialog;
@@ -42,7 +40,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeActionableItemReviewHeader extends Composite implements IWfeEventHandle {
+public class WfeActionableItemReviewHeader extends Composite {
private Label label;
private final AbstractReviewArtifact review;
@@ -82,8 +80,6 @@ public class WfeActionableItemReviewHeader extends Composite implements IWfeEven
});
refresh();
- editor.registerEvent(this, AtsAttributeTypes.ActionableItemReference);
-
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -118,7 +114,6 @@ public class WfeActionableItemReviewHeader extends Composite implements IWfeEven
}
- @Override
public void refresh() {
label.setText("This \"" + review.getArtifactTypeName() +
//
@@ -129,9 +124,4 @@ public class WfeActionableItemReviewHeader extends Composite implements IWfeEven
layout();
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return review;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeAssigneesHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeAssigneesHeader.java
index bfde825817a..d1c59d73cd9 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeAssigneesHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeAssigneesHeader.java
@@ -14,11 +14,9 @@
package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.AtsCoreUsers;
import org.eclipse.osee.ats.ide.column.AssigneeColumnUI;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -39,7 +37,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeAssigneesHeader extends Composite implements IWfeEventHandle {
+public class WfeAssigneesHeader extends Composite {
private final static String TARGET_VERSION = "Assignee(s):";
Label valueLabel;
@@ -93,10 +91,8 @@ public class WfeAssigneesHeader extends Composite implements IWfeEventHandle {
valueLabel = editor.getToolkit().createLabel(this, "Not Set");
valueLabel.setLayoutData(new GridData());
refresh();
- editor.registerEvent(this, AtsAttributeTypes.CurrentState);
}
- @Override
public void refresh() {
if (Widgets.isAccessible(valueLabel)) {
String value = "";
@@ -113,13 +109,9 @@ public class WfeAssigneesHeader extends Composite implements IWfeEventHandle {
valueLabel.setToolTipText(value);
}
valueLabel.setText(Strings.truncate(value, 150, true));
- valueLabel.getParent().getParent().layout();
+ valueLabel.getParent().layout(true);
+ valueLabel.getParent().getParent().layout(true);
}
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeEstimatedHoursHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeEstimatedHoursHeader.java
index bafe2eedf61..6eb1654f421 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeEstimatedHoursHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeEstimatedHoursHeader.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.AtsUtil;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.PromptChangeUtil;
@@ -38,7 +37,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeEstimatedHoursHeader extends Composite implements IWfeEventHandle {
+public class WfeEstimatedHoursHeader extends Composite {
private final static String LABEL = "Estimated Hours:";
Label valueLabel;
@@ -87,8 +86,6 @@ public class WfeEstimatedHoursHeader extends Composite implements IWfeEventHandl
valueLabel.setToolTipText(getToolTip());
valueLabel.setLayoutData(new GridData());
refresh();
- editor.registerEvent(this, AtsAttributeTypes.EstimatedHours);
-
} catch (OseeCoreException ex) {
Label errorLabel = editor.getToolkit().createLabel(this, "Error: " + ex.getLocalizedMessage());
errorLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
@@ -115,7 +112,6 @@ public class WfeEstimatedHoursHeader extends Composite implements IWfeEventHandl
}
}
- @Override
public void refresh() {
valueLabel.setText(getEstHoursStr());
valueLabel.getParent().getParent().layout();
@@ -125,9 +121,4 @@ public class WfeEstimatedHoursHeader extends Composite implements IWfeEventHandl
return "[Workflow Estimate] | [Calculation: Sum estimated hours for workflow and all tasks and reviews]";
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
index 7beac824d99..17b905c3c66 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
@@ -68,18 +68,24 @@ public class WfeHeaderComposite extends Composite {
private final WorkflowEditor editor;
private final IAtsWorkItem workItem;
- private WfeRelationsHyperlinkComposite smaRelationsComposite;
+ private WfeRelationsHyperlinkComposite relationsComposite;
private WfeActionableItemHeader actionableItemHeader;
- private WfeMetricsHeader workflowMetricsHeader;
+ private WfeMetricsHeader metricsHeader;
private final StateXWidgetPage currentStateXWidgetPage;
private static Color LIGHT_GREY;
private final IManagedForm managedForm;
private WfeCustomHeader customHeader;
private WfeTitleHeader titleHeader;
- private WfeTransitionHeader wfeTransitionComposite;
+ private WfeTransitionHeader transitionHeader;
+ private WfeStateCreatedOrigHeader stateHeader;
+ private WfeTeamAndIdsHeader teamHeader;
+ private WfeTargetedVersionHeader versionHeader;
+ private WfeAssigneesHeader assigneeHeader;
+ private WfeWorkPackage workPackageHeader;
+ private WfeActionableItemReviewHeader aiReviewHeader;
public WfeTransitionHeader getWfeTransitionComposite() {
- return wfeTransitionComposite;
+ return transitionHeader;
}
public WfeHeaderComposite(Composite parent, int style, WorkflowEditor editor, StateXWidgetPage currentStateXWidgetPage, IManagedForm managedForm) {
@@ -90,6 +96,51 @@ public class WfeHeaderComposite extends Composite {
this.workItem = editor.getWorkItem();
}
+ public void refresh() {
+ if (titleHeader != null) {
+ titleHeader.refresh();
+ }
+ if (stateHeader != null) {
+ stateHeader.refresh();
+ }
+ if (teamHeader != null) {
+ teamHeader.refresh();
+ }
+ if (versionHeader != null) {
+ versionHeader.refresh();
+ }
+ if (assigneeHeader != null) {
+ assigneeHeader.refresh();
+ }
+ if (actionableItemHeader != null) {
+ actionableItemHeader.refresh();
+ }
+ if (metricsHeader != null) {
+ metricsHeader.refresh();
+ }
+ if (workPackageHeader != null) {
+ workPackageHeader.refresh();
+ }
+ if (relationsComposite != null) {
+ relationsComposite.refresh();
+ }
+ if (transitionHeader != null) {
+ transitionHeader.refresh();
+ }
+ if (blockedWfHeader != null) {
+ blockedWfHeader.refresh();
+ }
+ if (holdWfHeader != null) {
+ holdWfHeader.refresh();
+ }
+ if (aiReviewHeader != null) {
+ aiReviewHeader.refresh();
+ }
+ if (customHeader != null) {
+ customHeader.refresh();
+ }
+ }
+
public void create() {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 100;
@@ -98,8 +149,8 @@ public class WfeHeaderComposite extends Composite {
try {
titleHeader = new WfeTitleHeader(this, SWT.NONE, workItem, editor, xModListener);
- new WfeStateCreatedOrigHeader(this, SWT.NONE, workItem, editor);
- new WfeTeamAndIdsHeader(this, SWT.NONE, workItem, editor);
+ stateHeader = new WfeStateCreatedOrigHeader(this, SWT.NONE, workItem, editor);
+ teamHeader = new WfeTeamAndIdsHeader(this, SWT.NONE, workItem, editor);
createTargetVersionAndAssigneeHeader(this, currentStateXWidgetPage, editor.getToolkit());
createLatestHeader(this, editor.getToolkit());
@@ -108,7 +159,7 @@ public class WfeHeaderComposite extends Composite {
}
if (workItem.getWorkDefinition().getHeaderDef().isShowMetricsHeader()) {
- workflowMetricsHeader = new WfeMetricsHeader(this, editor.getToolkit(), workItem, editor, managedForm);
+ metricsHeader = new WfeMetricsHeader(this, editor.getToolkit(), workItem, editor, managedForm);
}
int workPackageNumColumns = 2;
@@ -117,8 +168,8 @@ public class WfeHeaderComposite extends Composite {
}
int numColumns = 4;
createWorkDefHeader(this, editor.getToolkit(), workItem, numColumns);
- new WfeBlockedWorkflowHeader(this, SWT.NONE, workItem, editor);
- new WfeHoldWorkflowHeader(this, SWT.NONE, workItem, editor);
+ blockedWfHeader = new WfeBlockedWorkflowHeader(this, SWT.NONE, workItem, editor);
+ holdWfHeader = new WfeHoldWorkflowHeader(this, SWT.NONE, workItem, editor);
customHeader = createCustomHeader(this, editor.getToolkit(), workItem, editor, managedForm);
@@ -127,17 +178,18 @@ public class WfeHeaderComposite extends Composite {
createAnnotationsHeader(this, editor.getToolkit());
if (WfeRelationsHyperlinkComposite.relationExists((AbstractWorkflowArtifact) workItem)) {
- smaRelationsComposite = new WfeRelationsHyperlinkComposite(this, SWT.NONE, editor);
- smaRelationsComposite.create();
+ relationsComposite = new WfeRelationsHyperlinkComposite(this, SWT.NONE, editor);
+ relationsComposite.create();
}
if (WfeActionableItemReviewHeader.isApplicable(workItem)) {
- new WfeActionableItemReviewHeader(this, editor.getToolkit(), (AbstractReviewArtifact) workItem, editor);
+ aiReviewHeader =
+ new WfeActionableItemReviewHeader(this, editor.getToolkit(), (AbstractReviewArtifact) workItem, editor);
}
boolean isEditable = WorkflowManagerCore.isEditable(AtsApiService.get().getUserService().getCurrentUser(),
workItem, workItem.getStateDefinition(), AtsApiService.get().getUserService());
- wfeTransitionComposite = new WfeTransitionHeader(this, editor, isEditable);
+ transitionHeader = new WfeTransitionHeader(this, editor, isEditable);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
@@ -212,7 +264,7 @@ public class WfeHeaderComposite extends Composite {
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
comp.setLayout(ALayout.getZeroMarginLayout(6, false));
- new WfeWorkPackage(comp, SWT.NONE, workItem, editor);
+ workPackageHeader = new WfeWorkPackage(comp, SWT.NONE, workItem, editor);
}
}
@@ -248,7 +300,7 @@ public class WfeHeaderComposite extends Composite {
// Targeted Version
if (isShowTargetedVersion) {
- new WfeTargetedVersionHeader(comp, SWT.NONE, (IAtsTeamWorkflow) workItem, editor);
+ versionHeader = new WfeTargetedVersionHeader(comp, SWT.NONE, (IAtsTeamWorkflow) workItem, editor);
toolkit.createLabel(comp, " ");
}
@@ -256,7 +308,7 @@ public class WfeHeaderComposite extends Composite {
if (isCurrentNonCompleteCanceledState) {
boolean editable = WorkflowManager.isAssigneeEditable((AbstractWorkflowArtifact) workItem.getStoreObject());
- new WfeAssigneesHeader(comp, SWT.NONE, workItem, editable, editor);
+ assigneeHeader = new WfeAssigneesHeader(comp, SWT.NONE, workItem, editable, editor);
}
}
@@ -283,8 +335,8 @@ public class WfeHeaderComposite extends Composite {
if (actionableItemHeader != null) {
actionableItemHeader.dispose();
}
- if (workflowMetricsHeader != null) {
- workflowMetricsHeader.dispose();
+ if (metricsHeader != null) {
+ metricsHeader.dispose();
}
}
@@ -345,6 +397,8 @@ public class WfeHeaderComposite extends Composite {
}
}
};
+ private WfeBlockedWorkflowHeader blockedWfHeader;
+ private WfeHoldWorkflowHeader holdWfHeader;
public Collection<XWidget> getXWidgets(ArrayList<XWidget> widgets) {
titleHeader.getXWidgets(widgets);
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeMetricsHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeMetricsHeader.java
index 09fd8e92031..be6d676597e 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeMetricsHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeMetricsHeader.java
@@ -15,13 +15,11 @@ package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.AtsUtil;
import org.eclipse.osee.ats.core.util.HoursSpentUtil;
import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.ide.column.RemainingHoursColumn;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.framework.core.util.Result;
@@ -39,7 +37,7 @@ import org.eclipse.ui.forms.IManagedForm;
/**
* @author Donald G. Dunne
*/
-public class WfeMetricsHeader extends Composite implements IWfeEventHandle {
+public class WfeMetricsHeader extends Composite {
private final IAtsWorkItem workItem;
private Label percentLabel, hoursSpentLabel, remainHoursLabel;
@@ -72,14 +70,11 @@ public class WfeMetricsHeader extends Composite implements IWfeEventHandle {
RemainingHoursColumn.getInstance().getDescription());
refresh();
- editor.registerEvent(this, AtsAttributeTypes.EstimatedHours, AtsAttributeTypes.CurrentState,
- AtsAttributeTypes.State, AtsAttributeTypes.PercentComplete);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
- @Override
public void refresh() {
if (!Widgets.isAccessible(hoursSpentLabel)) {
return;
@@ -89,15 +84,15 @@ public class WfeMetricsHeader extends Composite implements IWfeEventHandle {
totalPercentHeader.refresh();
}
if (percentLabel != null && !percentLabel.isDisposed()) {
- percentLabel.setText(String.valueOf(
- PercentCompleteTotalUtil.getPercentCompleteTotal(workItem, AtsApiService.get())));
+ percentLabel.setText(
+ String.valueOf(PercentCompleteTotalUtil.getPercentCompleteTotal(workItem, AtsApiService.get())));
}
if (estimatedHoursHeader != null) {
estimatedHoursHeader.refresh();
}
if (hoursSpentLabel != null && !hoursSpentLabel.isDisposed()) {
- hoursSpentLabel.setText(String.valueOf(AtsUtil.doubleToI18nString(
- HoursSpentUtil.getHoursSpentTotal(workItem, AtsApiService.get()))));
+ hoursSpentLabel.setText(String.valueOf(
+ AtsUtil.doubleToI18nString(HoursSpentUtil.getHoursSpentTotal(workItem, AtsApiService.get()))));
}
if (hoursSpentLabel != null && !hoursSpentLabel.isDisposed()) {
Result result = RemainingHoursColumn.isRemainingHoursValid(workItem);
@@ -119,9 +114,4 @@ public class WfeMetricsHeader extends Composite implements IWfeEventHandle {
layout();
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeOriginatorHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeOriginatorHeader.java
index 7106e2e3e39..e39a442a46c 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeOriginatorHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeOriginatorHeader.java
@@ -16,10 +16,8 @@ package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
import java.util.Arrays;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.ide.column.OriginatorColumn;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -40,7 +38,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeOriginatorHeader extends Composite implements IWfeEventHandle {
+public class WfeOriginatorHeader extends Composite {
private final static String ORIGINATOR = "Originator:";
private Label userIconLabel;
@@ -77,11 +75,7 @@ public class WfeOriginatorHeader extends Composite implements IWfeEventHandle {
if (editor.isDirty()) {
editor.doSave(null);
}
- if (OriginatorColumn.promptChangeOriginator(workItem, true)) {
- origLabel.setText(workItem.getCreatedBy().getName());
- origLabel.getParent().layout();
- editor.onDirtied();
- }
+ OriginatorColumn.promptChangeOriginator(workItem, true);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
@@ -90,7 +84,6 @@ public class WfeOriginatorHeader extends Composite implements IWfeEventHandle {
userIconLabel = editor.getToolkit().createLabel(this, "");
origLabel = editor.getToolkit().createLabel(this, "");
origLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- editor.registerEvent(this, AtsAttributeTypes.CreatedBy);
refresh();
} catch (OseeCoreException ex) {
@@ -100,12 +93,6 @@ public class WfeOriginatorHeader extends Composite implements IWfeEventHandle {
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
- @Override
public void refresh() {
try {
if (workItem.getCreatedBy() == null) {
@@ -117,7 +104,8 @@ public class WfeOriginatorHeader extends Composite implements IWfeEventHandle {
origLabel.setText(workItem.getCreatedBy().getName());
origLabel.setForeground(Displays.getSystemColor(SWT.COLOR_BLACK));
}
- origLabel.getParent().getParent().layout();
+ origLabel.getParent().layout(true);
+ origLabel.getParent().getParent().layout(true);
} catch (OseeCoreException ex) {
Label errorLabel = editor.getToolkit().createLabel(this, "Error: " + ex.getLocalizedMessage());
errorLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfePercentCompleteHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfePercentCompleteHeader.java
index 33cb66655dd..4e58ff36645 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfePercentCompleteHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfePercentCompleteHeader.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -39,7 +38,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfePercentCompleteHeader extends Composite implements IWfeEventHandle {
+public class WfePercentCompleteHeader extends Composite {
private final static String PERCENT_COMPLETE = "Percent Complete:";
Label valueLabel;
@@ -101,8 +100,6 @@ public class WfePercentCompleteHeader extends Composite implements IWfeEventHand
valueLabel.setToolTipText(getToolTip());
valueLabel.setLayoutData(new GridData());
refresh();
- editor.registerEvent(this, AtsAttributeTypes.PercentComplete);
-
} catch (OseeCoreException ex) {
Label errorLabel = editor.getToolkit().createLabel(this, "Error: " + ex.getLocalizedMessage());
errorLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
@@ -114,8 +111,7 @@ public class WfePercentCompleteHeader extends Composite implements IWfeEventHand
public String getPercentCompleteStr() {
int awaPercent = AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem,
AtsAttributeTypes.PercentComplete, 0);
- int totalPecent =
- PercentCompleteTotalUtil.getPercentCompleteTotal(workItem, AtsApiService.get());
+ int totalPecent = PercentCompleteTotalUtil.getPercentCompleteTotal(workItem, AtsApiService.get());
if (awaPercent != totalPecent) {
return String.format("%d | %d", awaPercent, totalPecent);
} else {
@@ -123,18 +119,14 @@ public class WfePercentCompleteHeader extends Composite implements IWfeEventHand
}
}
- @Override
public void refresh() {
valueLabel.setText(getPercentCompleteStr());
- valueLabel.getParent().getParent().layout();
+ valueLabel.getParent().layout(true);
+ valueLabel.getParent().getParent().layout(true);
}
private String getToolTip() {
return " [Workflow Percent] | [Calculation: Sum of percent for workflow, reviews and tasks / # workflows, reviews and tasks] ";
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeRelationsHyperlinkComposite.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeRelationsHyperlinkComposite.java
index f4297317e7d..b757de439cb 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeRelationsHyperlinkComposite.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeRelationsHyperlinkComposite.java
@@ -43,7 +43,6 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.ide.AtsOpenOption;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.AtsEditors;
@@ -67,6 +66,7 @@ import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -78,7 +78,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeRelationsHyperlinkComposite extends Composite implements IWfeEventHandle {
+public class WfeRelationsHyperlinkComposite extends Composite {
private static RelationTypeSide[] sides = new RelationTypeSide[] {
AtsRelationTypes.TeamWorkflowToReview_Review,
@@ -91,14 +91,11 @@ public class WfeRelationsHyperlinkComposite extends Composite implements IWfeEve
AtsRelationTypes.Derive_To,
CoreRelationTypes.Dependency_Artifact,
CoreRelationTypes.Dependency_Dependency};
- private static RelationTypeSide[] siblings =
- new RelationTypeSide[] {AtsRelationTypes.ActionToWorkflow_TeamWorkflow, AtsRelationTypes.ActionToWorkflow_Action};
private final WorkflowEditor editor;
private final IAtsWorkItem workItem;
private final HashCollection<Long, Hyperlink> relIdToHyperlink = new HashCollection<>();
private final Map<Long, Label> relIdToLabel = new HashMap<>();
private final Set<Long> existingRels = new HashSet<>();
- private IWfeEventHandle siblingHandler;
public WfeRelationsHyperlinkComposite(Composite parent, int style, WorkflowEditor editor) {
super(parent, style);
@@ -114,40 +111,6 @@ public class WfeRelationsHyperlinkComposite extends Composite implements IWfeEve
editor.getToolkit().adapt(this);
createUpdateLinks();
-
- editor.registerEvent(this, sides);
- // If team workflow, register for siblings
- if (workItem.isTeamWorkflow()) {
- for (IAtsTeamWorkflow wf : AtsApiService.get().getWorkItemService().getTeams(workItem.getParentAction())) {
- if (!workItem.equals(wf)) {
- editor.registerEvent(getSiblingEventHandler(), wf.getParentAction().getStoreObject(), siblings);
- }
- }
- }
- }
-
- private IWfeEventHandle getSiblingEventHandler() {
- if (siblingHandler == null) {
- siblingHandler = new IWfeEventHandle() {
-
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
- @Override
- public void refresh() {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- createUpdateLinks();
- }
- });
- }
- };
- }
- return siblingHandler;
}
private void createUpdateLinks() {
@@ -164,7 +127,6 @@ public class WfeRelationsHyperlinkComposite extends Composite implements IWfeEve
} else {
createLink(workItemArt, " has sibling ", relation.getArtifactB(),
AtsRelationTypes.ActionToWorkflow_TeamWorkflow, relation, OpenType.Open);
- editor.registerEvent(this, relation.getArtifactB());
}
}
}
@@ -192,28 +154,31 @@ public class WfeRelationsHyperlinkComposite extends Composite implements IWfeEve
editor.getWorkFlowTab().getManagedForm().reflow(true);
}
- @Override
public void refresh() {
createUpdateLinks();
}
private void removeRelations(final Set<Long> existingRels) {
+ final Composite fComp = this;
+
Displays.ensureInDisplayThread(new Runnable() {
@Override
public void run() {
- for (Long relationId : existingRels) {
- for (Hyperlink link : relIdToHyperlink.getValues(relationId)) {
- if (link != null) {
- link.dispose();
+ if (Widgets.isAccessible(fComp) && relIdToHyperlink != null) {
+ for (Long relationId : existingRels) {
+ for (Hyperlink link : relIdToHyperlink.getValues(relationId)) {
+ if (link != null) {
+ link.dispose();
+ }
}
+ relIdToHyperlink.removeValues(relationId);
+ Label label = relIdToLabel.get(relationId);
+ if (label != null) {
+ label.dispose();
+ }
+ relIdToLabel.remove(relationId);
}
- relIdToHyperlink.removeValues(relationId);
- Label label = relIdToLabel.get(relationId);
- if (label != null) {
- label.dispose();
- }
- relIdToLabel.remove(relationId);
}
}
});
@@ -323,11 +288,6 @@ public class WfeRelationsHyperlinkComposite extends Composite implements IWfeEve
}
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
public static enum OpenType {
Open,
Read,
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeStateCreatedOrigHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeStateCreatedOrigHeader.java
index 28b1f0f878a..2d8e87c5d7c 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeStateCreatedOrigHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeStateCreatedOrigHeader.java
@@ -13,17 +13,12 @@
package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
-import java.util.Collection;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.event.IAtsWorkItemTopicEventListener;
-import org.eclipse.osee.ats.api.util.AtsTopicEvent;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
-import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -33,8 +28,6 @@ import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -43,11 +36,12 @@ import org.eclipse.swt.widgets.Label;
/**
* @author Donald G. Dunne
*/
-public class WfeStateCreatedOrigHeader extends Composite implements IWfeEventHandle, IAtsWorkItemTopicEventListener {
+public class WfeStateCreatedOrigHeader extends Composite {
private final IAtsWorkItem workItem;
Label stateValueLabel, createdValueLabel;
private final static Color BLOCKED_COLOR = new Color(null, 244, 80, 66);
+ private final WfeOriginatorHeader originatorHeader;
public WfeStateCreatedOrigHeader(Composite parent, int style, final IAtsWorkItem workItem, final WorkflowEditor editor) {
super(parent, style);
@@ -63,42 +57,11 @@ public class WfeStateCreatedOrigHeader extends Composite implements IWfeEventHan
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
- final IAtsWorkItemTopicEventListener fListener = this;
- stateValueLabel.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- AtsApiService.get().getEventService().deRegisterAtsWorkItemTopicEvent(fListener);
- }
- });
-
- new WfeOriginatorHeader(this, SWT.NONE, workItem, editor);
+ originatorHeader = new WfeOriginatorHeader(this, SWT.NONE, workItem, editor);
refresh();
- editor.registerEvent(this, AtsAttributeTypes.CurrentState, AtsAttributeTypes.CreatedDate);
- AtsApiService.get().getEventService().registerAtsWorkItemTopicEvent(this, AtsTopicEvent.WORK_ITEM_TRANSITIONED,
- AtsTopicEvent.WORK_ITEM_TRANSITION_FAILED);
- }
-
- @Override
- public void handleEvent(AtsTopicEvent topicEvent, Collection<ArtifactId> workItems) {
- if (topicEvent.equals(AtsTopicEvent.WORK_ITEM_TRANSITIONED) || topicEvent.equals(
- AtsTopicEvent.WORK_ITEM_TRANSITION_FAILED)) {
- if (this.isDisposed()) {
- AtsApiService.get().getEventService().deRegisterAtsWorkItemTopicEvent(this);
- return;
- }
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- refresh();
- }
- });
- }
}
- @Override
public void refresh() {
if (Widgets.isAccessible(stateValueLabel)) {
String isBlocked = AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem,
@@ -108,13 +71,13 @@ public class WfeStateCreatedOrigHeader extends Composite implements IWfeEventHan
stateValueLabel.setForeground(BLOCKED_COLOR);
} else {
stateValueLabel.setText(workItem.getStateMgr().getCurrentStateName());
+ stateValueLabel.setForeground(Displays.getSystemColor(SWT.COLOR_BLACK));
}
createdValueLabel.setText(DateUtil.getMMDDYYHHMM(workItem.getCreatedDate()));
}
+ if (Widgets.isAccessible(originatorHeader)) {
+ originatorHeader.refresh();
+ }
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTargetedVersionHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTargetedVersionHeader.java
index ce0403e51a1..90b42bdc2f9 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTargetedVersionHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTargetedVersionHeader.java
@@ -14,14 +14,11 @@
package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
import java.util.logging.Level;
-import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.version.VersionLockedType;
import org.eclipse.osee.ats.api.version.VersionReleaseType;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.ide.column.TargetedVersionColumnUI;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
@@ -43,16 +40,18 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeTargetedVersionHeader extends Composite implements IWfeEventHandle {
+public class WfeTargetedVersionHeader extends Composite {
private final static String TARGET_VERSION = "Target Version:";
Label valueLabel;
Hyperlink link;
private final IAtsTeamWorkflow teamWf;
+ private final WorkflowEditor editor;
public WfeTargetedVersionHeader(Composite parent, int style, final IAtsTeamWorkflow teamWf, final WorkflowEditor editor) {
super(parent, style);
this.teamWf = teamWf;
+ this.editor = editor;
setLayoutData(new GridData());
setLayout(ALayout.getZeroMarginLayout(2, false));
editor.getToolkit().adapt(this);
@@ -76,20 +75,13 @@ public class WfeTargetedVersionHeader extends Composite implements IWfeEventHand
if (editor.isDirty()) {
editor.doSave(null);
}
- if (chooseVersion(teamWf)) {
- refresh();
-
- }
-
- editor.onDirtied();
+ promptChangeVersion();
}
});
valueLabel = editor.getToolkit().createLabel(this, "Not Set");
valueLabel.setLayoutData(new GridData());
refresh();
- editor.registerEvent(this, AtsRelationTypes.TeamWorkflowTargetedForVersion_Version);
-
} catch (OseeCoreException ex) {
Label errorLabel = editor.getToolkit().createLabel(this, "Error: " + ex.getLocalizedMessage());
errorLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
@@ -98,9 +90,17 @@ public class WfeTargetedVersionHeader extends Composite implements IWfeEventHand
}
- public static boolean chooseVersion(final IAtsTeamWorkflow teamWf) {
+ public boolean promptChangeVersion() {
+ return promptChangeVersion(editor, teamWf);
+ }
+
+ public static boolean promptChangeVersion(final IAtsTeamWorkflow teamWf) {
+ WorkflowEditor editor = WorkflowEditor.getWorkflowEditor(teamWf);
+ return promptChangeVersion(editor, teamWf);
+ }
+
+ public static boolean promptChangeVersion(WorkflowEditor editor, final IAtsTeamWorkflow teamWf) {
try {
- WorkflowEditor editor = WorkflowEditor.getWorkflowEditor(teamWf);
if (editor.isDirty()) {
editor.doSave(null);
@@ -117,7 +117,6 @@ public class WfeTargetedVersionHeader extends Composite implements IWfeEventHand
return false;
}
- @Override
public void refresh() {
if (Widgets.isAccessible(valueLabel)) {
String value = "Not Set";
@@ -140,9 +139,4 @@ public class WfeTargetedVersionHeader extends Composite implements IWfeEventHand
}
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return teamWf;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTeamAndIdsHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTeamAndIdsHeader.java
index c310a9c6a6e..1e982b98deb 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTeamAndIdsHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTeamAndIdsHeader.java
@@ -19,16 +19,15 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.util.FormsUtil;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -37,7 +36,7 @@ import org.eclipse.swt.widgets.Text;
/**
* @author Donald G. Dunne
*/
-public class WfeTeamAndIdsHeader extends Composite implements IWfeEventHandle {
+public class WfeTeamAndIdsHeader extends Composite {
private final IAtsWorkItem workItem;
Text teamWfIdValue, parentIdValue, idValue, actionIdValue;
@@ -77,38 +76,62 @@ public class WfeTeamAndIdsHeader extends Composite implements IWfeEventHandle {
}
refresh();
- if (workItem.getStoreObject() instanceof Artifact) {
- editor.registerEvent(this, (Artifact) workItem.getStoreObject());
- }
-
}
- @Override
public void refresh() {
if (Widgets.isAccessible(idValue)) {
- String legacyPcrId = (AtsApiService.get()).getAttributeResolver().getSoleAttributeValueAsString(workItem,
- AtsAttributeTypes.LegacyPcrId, "");
- if (Strings.isValid(legacyPcrId)) {
- legacyPcrId = " | " + legacyPcrId;
- } else {
- legacyPcrId = "";
- }
- idValue.setText(workItem.getAtsId() + legacyPcrId);
- if (workItem.isTeamWorkflow()) {
- teamWfIdValue.setText(((TeamWorkFlowArtifact) workItem).getTeamName());
- } else if ((workItem.isTask() || workItem.isReview()) && workItem.getParentTeamWorkflow() != null) {
- IAtsTeamWorkflow parentTeamWorkflow = workItem.getParentTeamWorkflow();
- parentIdValue.setText(AtsApiService.get().getWorkItemService().getCombinedPcrId(parentTeamWorkflow));
- }
- IAtsAction action = workItem.getParentAction();
- if (action != null) {
- actionIdValue.setText(action.getAtsId());
- }
+ Thread refreshThread = new Thread("Refresh Workflow Editor") {
+
+ @Override
+ public void run() {
+ super.run();
+ String legacyPcrId = (AtsApiService.get()).getAttributeResolver().getSoleAttributeValueAsString(workItem,
+ AtsAttributeTypes.LegacyPcrId, "");
+ if (Strings.isValid(legacyPcrId)) {
+ legacyPcrId = " | " + legacyPcrId;
+ } else {
+ legacyPcrId = "";
+ }
+ String idValueStr = workItem.getAtsId() + legacyPcrId;
+ String teamWfIdValueStr = "";
+ String parentIdValueStr = "";
+ if (workItem.isTeamWorkflow()) {
+ teamWfIdValueStr = ((TeamWorkFlowArtifact) workItem).getTeamName();
+ } else if ((workItem.isTask() || workItem.isReview()) && workItem.getParentTeamWorkflow() != null) {
+ IAtsTeamWorkflow parentTeamWorkflow = workItem.getParentTeamWorkflow();
+ parentIdValueStr = AtsApiService.get().getWorkItemService().getCombinedPcrId(parentTeamWorkflow);
+ }
+ IAtsAction action = workItem.getParentAction();
+ String actionIdValueStr = "";
+ if (action != null) {
+ actionIdValueStr = action.getAtsId();
+ }
+
+ final String fTeamWfIdValueStr = teamWfIdValueStr;
+ final String fIdValueStr = idValueStr;
+ final String fParentIdValueStr = parentIdValueStr;
+ final String fActionIdValueStrr = actionIdValueStr;
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ idValue.setText(fIdValueStr);
+ if (Widgets.isAccessible(teamWfIdValue)) {
+ teamWfIdValue.setText(fTeamWfIdValueStr);
+ }
+ if (Widgets.isAccessible(parentIdValue)) {
+ parentIdValue.setText(fParentIdValueStr);
+ }
+ if (Widgets.isAccessible(actionIdValue)) {
+ actionIdValue.setText(fActionIdValueStrr);
+ }
+ }
+ });
+ }
+
+ };
+ refreshThread.start();
}
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java
index 0ce4b36e4ea..d1960610636 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java
@@ -19,9 +19,7 @@ import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.util.Result;
@@ -41,7 +39,7 @@ import org.eclipse.swt.widgets.Composite;
/**
* @author Donald G. Dunne
*/
-public class WfeTitleHeader extends Composite implements IWfeEventHandle {
+public class WfeTitleHeader extends Composite {
private final IAtsWorkItem workItem;
private XTextDam titleText;
@@ -66,19 +64,12 @@ public class WfeTitleHeader extends Composite implements IWfeEventHandle {
}
refresh();
- editor.registerEvent(this, AtsAttributeTypes.Title);
}
- @Override
public void refresh() {
titleText.setAttributeType((Artifact) workItem.getStoreObject(), CoreAttributeTypes.Name);
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
public XTextDam getTitleText() {
return titleText;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java
index 72902072370..0fbc6e7669b 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java
@@ -24,9 +24,7 @@ import org.eclipse.osee.ats.api.AtsApi;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.event.IAtsWorkItemTopicEventListener;
import org.eclipse.osee.ats.api.user.AtsUser;
-import org.eclipse.osee.ats.api.util.AtsTopicEvent;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.StateOption;
@@ -45,7 +43,6 @@ import org.eclipse.osee.ats.ide.util.widgets.dialog.CancelledReasonEnumDialog;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.ide.workflow.transition.TransitionResultsUi;
import org.eclipse.osee.ats.ide.workflow.transition.TransitionToOperation;
-import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -59,8 +56,6 @@ import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.FontManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -72,7 +67,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeTransitionHeader extends Composite implements IAtsWorkItemTopicEventListener {
+public class WfeTransitionHeader extends Composite {
private final Label transitionAssigneesLabel;
private final AbstractWorkflowArtifact awa;
@@ -96,18 +91,6 @@ public class WfeTransitionHeader extends Composite implements IAtsWorkItemTopicE
setLayout(layout);
editor.getWorkFlowTab().getManagedForm().getToolkit().adapt(this);
- // Register for events and deregister on dispose
- AtsApiService.get().getEventService().registerAtsWorkItemTopicEvent(this, AtsTopicEvent.WORK_ITEM_TRANSITIONED,
- AtsTopicEvent.WORK_ITEM_TRANSITION_FAILED);
- final WfeTransitionHeader fThis = this;
- addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- AtsApiService.get().getEventService().deRegisterAtsWorkItemTopicEvent(fThis);
- }
- });
-
transitionLabelLink = editor.getToolkit().createHyperlink(this, "Transition", SWT.NONE);
transitionLabelLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
@@ -414,25 +397,6 @@ public class WfeTransitionHeader extends Composite implements IAtsWorkItemTopicE
editor.onDirtied();
}
- @Override
- public void handleEvent(AtsTopicEvent topicEvent, Collection<ArtifactId> workItems) {
- if (topicEvent.equals(AtsTopicEvent.WORK_ITEM_TRANSITIONED) || topicEvent.equals(
- AtsTopicEvent.WORK_ITEM_TRANSITION_FAILED)) {
- if (this.isDisposed()) {
- AtsApiService.get().getEventService().deRegisterAtsWorkItemTopicEvent(this);
- return;
- }
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- userSelectedTransitionToState = null;
- refresh();
- }
- });
- }
- }
-
public boolean isSelected() {
return userSelectedTransitionToState != null;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeWorkPackage.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeWorkPackage.java
index 29d3bbdc63e..9aae8be0c83 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeWorkPackage.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeWorkPackage.java
@@ -15,11 +15,9 @@ package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.ev.IAtsWorkPackage;
import org.eclipse.osee.ats.ide.column.ev.WorkPackageColumnUI;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -41,7 +39,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public class WfeWorkPackage extends Composite implements IWfeEventHandle {
+public class WfeWorkPackage extends Composite {
private final static String WORK_PACKAGE = "Work Package:";
Text valueLabel;
@@ -90,9 +88,7 @@ public class WfeWorkPackage extends Composite implements IWfeEventHandle {
valueLabel.setLayoutData(new GridData());
editor.getToolkit().adapt(valueLabel, true, true);
valueLabel.setText("Not Set");
- editor.registerEvent(this, AtsAttributeTypes.WorkPackage, AtsAttributeTypes.WorkPackageReference);
refresh();
-
} catch (OseeCoreException ex) {
Label errorLabel = editor.getToolkit().createLabel(this, "Error: " + ex.getLocalizedMessage());
errorLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
@@ -101,7 +97,6 @@ public class WfeWorkPackage extends Composite implements IWfeEventHandle {
}
- @Override
public void refresh() {
if (Widgets.isAccessible(valueLabel)) {
String value = "Not Set";
@@ -126,9 +121,4 @@ public class WfeWorkPackage extends Composite implements IWfeEventHandle {
}
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeDetailsSection.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeDetailsSection.java
index 970f11b5802..89c5c190055 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeDetailsSection.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeDetailsSection.java
@@ -21,7 +21,6 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.ide.access.AtsBranchAccessManager;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
@@ -55,17 +54,15 @@ import org.eclipse.ui.forms.widgets.Section;
/**
* @author Donald G. Dunne
*/
-public class WfeDetailsSection extends SectionPart implements IWfeEventHandle {
+public class WfeDetailsSection extends SectionPart {
private Browser browser;
private final WorkflowEditor editor;
private boolean sectionCreated = false;
- private final IAtsWorkItem workItem;
public WfeDetailsSection(WorkflowEditor editor, Composite parent, FormToolkit toolkit, int style) {
super(parent, toolkit, style | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
this.editor = editor;
- workItem = editor.getWorkItem();
}
@Override
@@ -84,7 +81,6 @@ public class WfeDetailsSection extends SectionPart implements IWfeEventHandle {
createSection();
}
});
- editor.registerEvent(this, editor.getWorkItem());
}
private synchronized void createSection() {
@@ -190,9 +186,8 @@ public class WfeDetailsSection extends SectionPart implements IWfeEventHandle {
return message;
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
+ public boolean isDisposed() {
+ return browser == null || browser.isDisposed();
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeHistorySection.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeHistorySection.java
index 4b0c2be4c53..cc0ac500c21 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeHistorySection.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeHistorySection.java
@@ -14,9 +14,7 @@
package org.eclipse.osee.ats.ide.editor.tab.workflow.section;
import java.util.logging.Level;
-import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.editor.tab.workflow.history.XHistoryViewer;
import org.eclipse.osee.ats.ide.editor.tab.workflow.log.XLogViewer;
import org.eclipse.osee.ats.ide.internal.Activator;
@@ -24,7 +22,6 @@ import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.swt.FontManager;
import org.eclipse.swt.SWT;
@@ -43,21 +40,17 @@ import org.eclipse.ui.forms.widgets.Section;
/**
* @author Donald G. Dunne
*/
-public class WfeHistorySection extends SectionPart implements IWfeEventHandle {
+public class WfeHistorySection extends SectionPart {
private final WorkflowEditor editor;
private boolean sectionCreated = false;
- private final IAtsWorkItem workItem;
private XHistoryViewer xHistoryViewer;
private XLogViewer xLogViewer;
+ private Composite mainComp;
public WfeHistorySection(WorkflowEditor editor, Composite parent, FormToolkit toolkit, int style) {
super(parent, toolkit, style | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
this.editor = editor;
- workItem = editor.getWorkItem();
- if (workItem.getStoreObject() instanceof Artifact) {
- editor.registerEvent(this, (Artifact) workItem.getStoreObject());
- }
}
@Override
@@ -85,21 +78,21 @@ public class WfeHistorySection extends SectionPart implements IWfeEventHandle {
AbstractWorkflowArtifact awa = editor.getWorkItem();
final FormToolkit toolkit = getManagedForm().getToolkit();
- Composite composite = toolkit.createComposite(getSection(), SWT.WRAP);
- composite.setLayout(new GridLayout(1, false));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ mainComp = toolkit.createComposite(getSection(), SWT.WRAP);
+ mainComp.setLayout(new GridLayout(1, false));
+ mainComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- Label logLabel = toolkit.createLabel(composite, "ATS Log:", SWT.NONE);
+ Label logLabel = toolkit.createLabel(mainComp, "ATS Log:", SWT.NONE);
logLabel.setFont(FontManager.getCourierNew12Bold());
xLogViewer = new XLogViewer(awa);
- xLogViewer.createWidgets(composite, 2);
+ xLogViewer.createWidgets(mainComp, 2);
- Label historyLabel = toolkit.createLabel(composite, "Detailed History (if available):", SWT.NONE);
+ Label historyLabel = toolkit.createLabel(mainComp, "Detailed History (if available):", SWT.NONE);
historyLabel.setFont(FontManager.getCourierNew12Bold());
xHistoryViewer = new XHistoryViewer(awa);
- xHistoryViewer.createWidgets(composite, 2);
+ xHistoryViewer.createWidgets(mainComp, 2);
- Label button = toolkit.createLabel(composite, " ", SWT.NONE);
+ Label button = toolkit.createLabel(mainComp, " ", SWT.NONE);
button.setText(" ");
final AbstractWorkflowArtifact fSma = awa;
button.addListener(SWT.MouseDoubleClick, new Listener() {
@@ -113,8 +106,8 @@ public class WfeHistorySection extends SectionPart implements IWfeEventHandle {
}
});
- getSection().setClient(composite);
- toolkit.paintBordersFor(composite);
+ getSection().setClient(mainComp);
+ toolkit.paintBordersFor(mainComp);
sectionCreated = true;
}
@@ -129,9 +122,8 @@ public class WfeHistorySection extends SectionPart implements IWfeEventHandle {
}
}
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
+ public boolean isDisposed() {
+ return mainComp == null || mainComp.isDisposed();
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeRelationsSection.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeRelationsSection.java
index 66945c2a62f..289f16c8786 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeRelationsSection.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeRelationsSection.java
@@ -20,7 +20,6 @@ import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.editor.tab.workflow.WfeWorkFlowTab;
import org.eclipse.osee.ats.ide.editor.tab.workflow.header.WfeDragAndDrop;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
@@ -38,12 +37,11 @@ import org.eclipse.ui.forms.widgets.Section;
* @author Roberto E. Escobar
* @author Donald G. Dunne
*/
-public class WfeRelationsSection extends RelationsFormSection implements IWfeEventHandle {
+public class WfeRelationsSection extends RelationsFormSection {
IAtsWorkItem workItem;
public WfeRelationsSection(WorkflowEditor editor, Composite parent, FormToolkit toolkit, int style) {
super(editor, parent, toolkit, style | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR, true);
- editor.registerEvent(this, editor.getWorkItem());
workItem = editor.getWorkItem();
}
@@ -88,9 +86,8 @@ public class WfeRelationsSection extends RelationsFormSection implements IWfeEve
AtsRelationTypes.TeamMember_Member.getName(), AtsRelationTypes.TeamWorkflowToReview_Review.getName(),
CoreRelationTypes.DefaultHierarchical_Child.getName(), CoreRelationTypes.Users_Artifact.getName());
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
+ public boolean isDisposed() {
+ return getRelationComposite() == null || getRelationComposite().isDisposed();
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java
index 17c3255e7f8..b1b14f143af 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java
@@ -18,14 +18,12 @@ import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.core.workflow.WorkflowManagerCore;
import org.eclipse.osee.ats.core.workflow.log.AtsLogUtility;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.editor.tab.workflow.header.WfeHeaderComposite;
import org.eclipse.osee.ats.ide.editor.tab.workflow.widget.ReviewInfoXWidget;
import org.eclipse.osee.ats.ide.editor.tab.workflow.widget.StateHoursSpentXWidget;
@@ -229,25 +227,6 @@ public class WfeWorkflowSection extends SectionPart {
// Set all XWidget labels to bold font
WorkflowEditor.setLabelFonts(xWidget.getLabelWidget(), FontManager.getDefaultLabelFont());
}
- // Set editor if applicable
- if (xWidget instanceof IWfeEventHandle) {
- ((IWfeEventHandle) xWidget).setEditor(editor);
- } else if (xWidget instanceof IAttributeWidget) {
- IAttributeWidget attrWidget = (IAttributeWidget) xWidget;
- editor.registerEvent(new IWfeEventHandle() {
-
- @Override
- public IAtsWorkItem getWorkItem() {
- return sma;
- }
-
- @Override
- public void refresh() {
- attrWidget.reSet();
- }
-
- }, attrWidget.getAttributeType());
- }
}
computeTextSizesAndReflow();
@@ -490,10 +469,14 @@ public class WfeWorkflowSection extends SectionPart {
super.refresh();
try {
for (XWidget xWidget : allXWidgets) {
- xWidget.refresh();
+ if (xWidget instanceof IAttributeWidget) {
+ // Reload with with current artifact/attribute value
+ ((IAttributeWidget) xWidget).reSet();
+ } else {
+ xWidget.refresh();
+ }
}
refreshStateTitle();
- editor.onDirtied();
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/widget/ReviewInfoXWidget.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/widget/ReviewInfoXWidget.java
index 6233d9eeb70..0df3a2b7486 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/widget/ReviewInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/widget/ReviewInfoXWidget.java
@@ -323,7 +323,7 @@ public class ReviewInfoXWidget extends XLabelValueBase {
if (!results.isEmpty()) {
AWorkbench.popup(String.format("Transition Error %s", results.toString()));
}
- workflowSection.getEditor().refreshPages();
+ workflowSection.getEditor().refresh();
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/ev/internal/AtsEarnedValueImpl.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/ev/internal/AtsEarnedValueImpl.java
index 9109e8f266a..1609c99951b 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/ev/internal/AtsEarnedValueImpl.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/ev/internal/AtsEarnedValueImpl.java
@@ -13,7 +13,6 @@
package org.eclipse.osee.ats.ide.ev.internal;
-import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.ats.api.AtsApi;
import org.eclipse.osee.ats.api.IAtsWorkItem;
@@ -31,7 +30,6 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.event.TopicEvent;
import org.eclipse.osee.framework.jdk.core.result.XResultData;
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.Conditions;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
@@ -90,9 +88,6 @@ public class AtsEarnedValueImpl extends AtsAbstractEarnedValueImpl {
TopicEvent event = new TopicEvent(AtsTopicEvent.WORK_ITEM_MODIFIED, AtsTopicEvent.WORK_ITEM_IDS_KEY,
AtsObjects.toIdsString(";", workItems));
- event.addProperty(AtsTopicEvent.WORK_ITEM_ATTR_TYPE_IDS_KEY,
- Collections.toString(";", Arrays.asList(AtsAttributeTypes.WorkPackage.getIdString(),
- AtsAttributeTypes.WorkPackageReference.getIdString())));
OseeEventManager.kickTopicEvent(getClass(), event);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/internal/Activator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/internal/Activator.java
index efa6cbe62b6..626c946e5f9 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/internal/Activator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/internal/Activator.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.ats.api.util.AtsTopicEvent;
import org.eclipse.osee.ats.api.util.AtsUtil;
import org.eclipse.osee.ats.ide.access.AtsBranchAccessManager;
import org.eclipse.osee.ats.ide.navigate.SavedSearchesNavigateItem;
-import org.eclipse.osee.ats.ide.workflow.AtsWorkItemEventHandler;
import org.eclipse.osee.framework.plugin.core.OseeActivator;
import org.eclipse.osee.framework.skynet.core.event.model.AccessTopicEvent;
import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
@@ -35,10 +34,6 @@ public class Activator extends OseeActivator {
@Override
public void start(final BundleContext context) {
- context.registerService(EventHandler.class.getName(), new AtsWorkItemEventHandler(),
- AtsUtil.hashTable(EventConstants.EVENT_TOPIC, AtsTopicEvent.WORK_ITEM_TRANSITIONED.getTopic()));
- context.registerService(EventHandler.class.getName(), new AtsWorkItemEventHandler(),
- AtsUtil.hashTable(EventConstants.EVENT_TOPIC, AtsTopicEvent.WORK_ITEM_MODIFIED.getTopic()));
context.registerService(EventHandler.class.getName(), new AtsBranchAccessManager(),
AtsUtil.hashTable(EventConstants.EVENT_TOPIC, AccessTopicEvent.ACCESS_BRANCH_MODIFIED.getTopic()));
context.registerService(EventHandler.class.getName(), new SavedSearchesNavigateItem(),
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/ToggleAtsAdmin.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/ToggleAtsAdmin.java
index 7c25cb241f0..584444fd55e 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/ToggleAtsAdmin.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/ToggleAtsAdmin.java
@@ -93,7 +93,7 @@ public class ToggleAtsAdmin extends XNavigateItemAction {
AtsApiService.get().getUserService().clearCaches();
NavigateViewItems.getInstance().clearCaches();
for (WorkflowEditor editor : WorkflowEditor.getWorkflowEditors()) {
- editor.refreshPages();
+ editor.refresh();
}
if (NavigateView.getNavigateView() != null && NavigateView.isAccessible()) {
NavigateView.getNavigateView().refreshData();
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/XCancellationReasonTextWidget.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/XCancellationReasonTextWidget.java
index 062d3bb701c..8aa038d28c7 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/XCancellationReasonTextWidget.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/XCancellationReasonTextWidget.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
-import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -29,14 +28,13 @@ import org.eclipse.osee.framework.ui.swt.Widgets;
/**
* @author Donald G. Dunne
*/
-public class XCancellationReasonTextWidget extends XText implements IArtifactWidget, IWfeEventHandle {
+public class XCancellationReasonTextWidget extends XText implements IArtifactWidget {
private AbstractWorkflowArtifact awa;
public XCancellationReasonTextWidget(AbstractWorkflowArtifact sma, final WorkflowEditor editor) {
super("Cancallation Reason");
setArtifact(sma);
- editor.registerEvent(this, AtsAttributeTypes.CancelledReason);
}
@Override
@@ -66,7 +64,7 @@ public class XCancellationReasonTextWidget extends XText implements IArtifactWid
public void setArtifact(Artifact artifact) {
if (artifact instanceof AbstractWorkflowArtifact) {
this.awa = (AbstractWorkflowArtifact) artifact;
- setText(awa.getCancelledReason());
+ refresh();
}
}
@@ -76,8 +74,8 @@ public class XCancellationReasonTextWidget extends XText implements IArtifactWid
}
@Override
- public IAtsWorkItem getWorkItem() {
- return awa;
+ public void refresh() {
+ setText(awa.getCancelledReason());
}
public void setCancellationReason(String reason, IAtsChangeSet changes) {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/XWorkingBranchButtonCreate.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/XWorkingBranchButtonCreate.java
index 34f78c56d1b..9591822b70b 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/XWorkingBranchButtonCreate.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/XWorkingBranchButtonCreate.java
@@ -101,7 +101,7 @@ public class XWorkingBranchButtonCreate extends XWorkingBranchButtonAbstract {
AtsBranchServiceIde.PARENT_BRANCH_CAN_NOT_BE_DETERMINED, MessageDialog.ERROR,
new String[] {"Select Targeted Version", "Cancel"}, 0);
if (dialog.open() == 0) {
- WfeTargetedVersionHeader.chooseVersion(getTeamArt());
+ WfeTargetedVersionHeader.promptChangeVersion(getTeamArt());
}
} else {
MessageDialog dialog = new MessageDialog(Displays.getActiveShell(), "Create Working Branch", null,
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/defect/DefectUtil.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/defect/DefectUtil.java
index 14a41354313..1e8ef05d96b 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/defect/DefectUtil.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/widgets/defect/DefectUtil.java
@@ -25,7 +25,6 @@ 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.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.skynet.action.RefreshAction.IRefreshActionHandler;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.PlatformUI;
@@ -37,12 +36,10 @@ public class DefectUtil {
private final DefectXViewer defectXViewer;
private final IAtsPeerToPeerReview review;
- private final IRefreshActionHandler refreshActionHandler;
- public DefectUtil(DefectXViewer defectXViewer, IAtsPeerToPeerReview review, IRefreshActionHandler refreshActionHandler) {
+ public DefectUtil(DefectXViewer defectXViewer, IAtsPeerToPeerReview review) {
this.defectXViewer = defectXViewer;
this.review = review;
- this.refreshActionHandler = refreshActionHandler;
}
public void handleNewDefect() {
@@ -65,7 +62,6 @@ public class DefectUtil {
defectManager.addOrUpdateDefectItem(item);
defectManager.saveToArtifact(review, changes);
changes.execute();
- refreshActionHandler.refreshActionHandler();
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
@@ -98,7 +94,6 @@ public class DefectUtil {
defectManager.saveToArtifact(review, changes);
}
changes.executeIfNeeded();
- refreshActionHandler.refreshActionHandler();
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
@@ -120,7 +115,6 @@ public class DefectUtil {
}
}
changes.execute();
- refreshActionHandler.refreshActionHandler();
}
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemEventHandler.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemEventHandler.java
deleted file mode 100644
index 9df2f819f3a..00000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemEventHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2015 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Boeing - initial API and implementation
- **********************************************************************/
-
-package org.eclipse.osee.ats.ide.workflow;
-
-import org.eclipse.osee.ats.api.util.AtsTopicEvent;
-import org.eclipse.osee.ats.ide.editor.event.WfeArtifactEventManager;
-import org.eclipse.osee.ats.ide.internal.AtsApiService;
-import org.eclipse.osee.framework.core.data.TransactionId;
-import org.eclipse.osee.framework.core.event.EventUtil;
-import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/**
- * Event handler to handle refreshing WorkItems when work item is update remotely an no ArtifactEvent is propogated.
- * Usually used for when changes, like transition or setting Work Package are done on server and not the client.
- * Eventually, all ATS work items changes will be done on server and events handled by this and not ArtifactEvent.
- *
- * @author Donald G. Dunne
- */
-public class AtsWorkItemEventHandler implements EventHandler {
-
- @Override
- public void handleEvent(Event event) {
- try {
- // If artifact in cache, then could be in open editor/view. Just reload.
- if (event.getTopic().equals(AtsTopicEvent.WORK_ITEM_MODIFIED.getTopic()) || event.getTopic().equals(
- AtsTopicEvent.WORK_ITEM_TRANSITIONED.getTopic())) {
- String ids = (String) event.getProperty(AtsTopicEvent.WORK_ITEM_IDS_KEY);
- for (Long workItemId : Collections.fromString(ids, ";", Long::valueOf)) {
- Artifact artifact = ArtifactCache.getActive(workItemId, AtsApiService.get().getAtsBranch());
- TransactionId transaction = EventUtil.getTransaction(event);
- if (artifact != null && artifact.getTransaction().notEqual(transaction)) {
- artifact.reloadAttributesAndRelations();
- }
- }
- // And, handle event for those WorkflowEditor listeners to specific attr, rel or arts
- WfeArtifactEventManager.handleEventAfterReload(event);
- }
- } catch (Exception ex) {
- // do nothing
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemServiceClientImpl.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemServiceClientImpl.java
index f36c3f339cb..b812c165dee 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemServiceClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AtsWorkItemServiceClientImpl.java
@@ -32,7 +32,6 @@ import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.workflow.hooks.IAtsWorkItemHookIde;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
/**
* All client transitions should go through this service which handles transitioning on server, reloading client work
@@ -132,9 +131,11 @@ public class AtsWorkItemServiceClientImpl extends AtsWorkItemServiceImpl impleme
*/
private TransitionResults postEventAndReturn(TransitionData transData, TransitionResults results) {
Conditions.assertNotNullOrEmpty(results.getWorkItemIds(), "workItemIds");
+ AtsApiService.get().getStoreService().reload(transData.getWorkItems());
if (results.isSuccess()) {
- ArtifactQuery.reloadArtifacts(transData.getWorkItemIds());
+ atsApi.getEventService().postAtsWorkItemTopicEvent(AtsTopicEvent.WORK_ITEM_MODIFIED, transData.getWorkItems(),
+ results.getTransaction());
atsApi.getEventService().postAtsWorkItemTopicEvent(AtsTopicEvent.WORK_ITEM_TRANSITIONED,
transData.getWorkItems(), results.getTransaction());
} else {

Back to the top