Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java1
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/StateColumn.java9
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractAtsAction.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractEditSubStatusAction.java96
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java201
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditBlockedStatusAction.java64
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditHoldStatusAction.java28
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeBlockedWorkflowHeader.java169
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java1
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHoldWorkflowHeader.java31
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/task/TaskXViewer.java6
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldLabelProvider.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/OSEE-INF/images/hold.gifbin0 -> 592 bytes
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java1
16 files changed, 398 insertions, 224 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java
index 022c12326bf..b788b4ef10e 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java
@@ -84,6 +84,7 @@ public interface AtsArtifactTypes {
ArtifactTypeToken AbstractWorkflowArtifact = ats.add(ats.artifactType(71L, "ats.State Machine", true, AtsArtifact)
.exactlyOne(AtsId, "0")
.zeroOrOne(BlockedReason)
+ .zeroOrOne(HoldReason)
.zeroOrOne(CancelledReasonEnum, null)
.zeroOrOne(CancelledBy)
.zeroOrOne(CancelledDate)
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java
index 76f21c91ed6..eb7cea6ddad 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java
@@ -66,6 +66,7 @@ public interface AtsAttributeTypes {
AttributeTypeString AtsIdSequenceName = ats.createString(1163054603768431493L, "ats.ATS Id Sequence Name", MediaType.TEXT_PLAIN, "ATS Id Sequence Name");
AttributeTypeString BaselineBranchId = ats.createString(1152932018686787753L, "ats.Baseline Branch Id", MediaType.TEXT_PLAIN, "Baseline branch associated with ATS object.");
AttributeTypeString BlockedReason = ats.createString(7797797474874870503L, "ats.Blocked Reason", MediaType.TEXT_PLAIN, "Reason for action being blocked");
+ AttributeTypeString HoldReason = ats.createString(5465485151546987972L, "ats.Hold Reason", MediaType.TEXT_PLAIN, "Reason for action being held");
AttributeTypeString BranchMetrics = ats.createString(1152921504606847190L, "ats.Branch Metrics", MediaType.TEXT_PLAIN, "");
AttributeTypeString CAM = ats.createString(1152921596009727571L, "ats.CAM", MediaType.TEXT_PLAIN, "");
AttributeTypeString CSCI = ats.createString(72063457007112443L, "ats.CSCI", MediaType.TEXT_PLAIN, "CSCI this Team is reponsible for.");
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/StateColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/StateColumn.java
index 301bea836e8..d571b970fd4 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/StateColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/StateColumn.java
@@ -37,8 +37,17 @@ public class StateColumn extends AbstractServicesColumn {
if (atsObject instanceof IAtsWorkItem) {
String isBlocked =
atsApi.getAttributeResolver().getSoleAttributeValue(atsObject, AtsAttributeTypes.BlockedReason, "");
+ String isHold =
+ atsApi.getAttributeResolver().getSoleAttributeValue(atsObject, AtsAttributeTypes.HoldReason, "");
+ if (Strings.isValid(isBlocked) && (Strings.isValid(isHold))) {
+ String hold = ((IAtsWorkItem) atsObject).getStateMgr().getCurrentStateName() + " (Hold)";
+ String block = " " + ((IAtsWorkItem) atsObject).getStateMgr().getCurrentStateName() + " (Blocked)";
+ return hold + block;
+ }
if (Strings.isValid(isBlocked)) {
return ((IAtsWorkItem) atsObject).getStateMgr().getCurrentStateName() + " (Blocked)";
+ } else if (Strings.isValid(isHold)) {
+ return ((IAtsWorkItem) atsObject).getStateMgr().getCurrentStateName() + " (Hold)";
} else {
return ((IAtsWorkItem) atsObject).getStateMgr().getCurrentStateName();
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractAtsAction.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractAtsAction.java
index 76d5b0bb5e5..ff8b8399a91 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractAtsAction.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractAtsAction.java
@@ -28,6 +28,10 @@ public class AbstractAtsAction extends Action {
super(string, imageDescriptor);
}
+ public AbstractAtsAction(String string, ISelectedAtsArtifacts selectedAtsArtifacts) {
+ super(string);
+ }
+
public AbstractAtsAction(String string) {
super(string);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractEditSubStatusAction.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractEditSubStatusAction.java
new file mode 100644
index 00000000000..ba4b17b83a5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractEditSubStatusAction.java
@@ -0,0 +1,96 @@
+/*********************************************************************
+ * Copyright (c) 2020 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.actions;
+
+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.internal.AtsApiService;
+import org.eclipse.osee.framework.core.data.AttributeTypeString;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Branden Philips
+ * @author Bhawana Mishra
+ */
+public abstract class AbstractEditSubStatusAction extends AbstractAtsAction {
+ private final ISelectedAtsArtifacts selectedAtsArtifacts;
+ private final AttributeTypeString attrType;
+ private final String positive;
+ private final String negative;
+
+ public AbstractEditSubStatusAction(ISelectedAtsArtifacts selectedAtsArtifacts, String positive, String negative, FrameworkImage image, AttributeTypeString attrType) {
+ super(positive + "/" + negative + " Workflow", selectedAtsArtifacts);
+ this.selectedAtsArtifacts = selectedAtsArtifacts;
+ this.attrType = attrType;
+ this.positive = positive;
+ this.negative = negative;
+ setImageDescriptor(ImageManager.getImageDescriptor(image));
+ }
+
+ @Override
+ public void runWithException() {
+ boolean setWorkflow = false;
+ boolean prompt = false;
+ boolean fetchedStatus = false;
+ String reason = "";
+ for (Artifact workItemArt : selectedAtsArtifacts.getSelectedWorkflowArtifacts()) {
+ IAtsChangeSet changes = AtsApiService.get().createChangeSet("Set " + positive + " status");
+ if (!fetchedStatus) {
+ reason = workItemArt.getSoleAttributeValue(attrType, "");
+ IAtsWorkItem workItem = AtsApiService.get().getWorkItemService().getWorkItem(workItemArt);
+ if (reason.equals("")) {
+ setWorkflow = true;
+ EntryDialog ed = new EntryDialog("Setting Workflow to " + positive,
+ "Enter the reason to set this workflow to " + positive);
+ if (ed.open() == 0) {
+ reason = ed.getEntry();
+ if (!Strings.isValid(reason)) {
+ reason = getSubStatusReason(workItem);
+ }
+ }
+ }
+ /*
+ * return or do nothing if the Workflow isn't already in block and user pressed either Cancel or OK without
+ * entering reason
+ */
+ if (reason.isEmpty() && getSubStatusReason(workItem).isEmpty()) {
+ return;
+ }
+ fetchedStatus = true;
+ }
+ if (setWorkflow) {
+ changes.setSoleAttributeValue(workItemArt, attrType, positive + " - " + reason);
+ } else {
+ if (!prompt) {
+ if (!MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ negative + " Workflow", "Are you sure you wish to set this workflow to " + negative + "?")) {
+ return;
+ }
+ prompt = true;
+ }
+ changes.deleteAttributes(workItemArt, attrType);
+ }
+ changes.executeIfNeeded();
+ }
+ }
+
+ private String getSubStatusReason(IAtsWorkItem workItem) {
+ return AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem, attrType, "");
+ }
+}
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
new file mode 100644
index 00000000000..e4c11c68a80
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/AbstractWfeSubWorkflow.java
@@ -0,0 +1,201 @@
+/*********************************************************************
+ * Copyright (c) 2020 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.actions;
+
+import java.util.logging.Level;
+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;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+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.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Bhawana Mishra
+ */
+public class AbstractWfeSubWorkflow extends Composite implements IWfeEventHandle {
+ protected IAtsWorkItem workItem;
+ private Hyperlink labelLink;
+ private Hyperlink reasonLink;
+
+ private final String positive;
+ private final String negative;
+ private final AttributeTypeToken attrType;
+ private final int color;
+
+ protected AbstractWfeSubWorkflow(Composite parent, int style, IAtsWorkItem workItem, WorkflowEditor editor, String positive, String negative, AttributeTypeToken attrType, int color) {
+ super(parent, style);
+ this.workItem = workItem;
+ setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ setLayout(ALayout.getZeroMarginLayout(4, false));
+ editor.getToolkit().adapt(this);
+ this.workItem = workItem;
+ this.positive = positive;
+ this.negative = negative;
+ this.attrType = attrType;
+ this.color = color;
+ try {
+ labelLink = editor.getToolkit().createHyperlink(this, "", SWT.NONE);
+ labelLink.addHyperlinkListener(new IHyperlinkListener() {
+
+ @Override
+ public void linkEntered(HyperlinkEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void linkExited(HyperlinkEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (editor.isDirty()) {
+ editor.doSave(null);
+ }
+ handlePositiveButtonSelection();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+
+ reasonLink = editor.getToolkit().createHyperlink(this, "", SWT.NONE);
+ reasonLink.addHyperlinkListener(new IHyperlinkListener() {
+
+ @Override
+ public void linkEntered(HyperlinkEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void linkExited(HyperlinkEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (editor.isDirty()) {
+ editor.doSave(null);
+ }
+ EntryDialog ed = new EntryDialog("View Or Change Reason for Workflow about" + positive,
+ "Current" + positive + "Reason: " + getReason() + "\n\n\nEnter the new reason for setting this workflow to" + positive + "if you wish to change");
+ setReason(ed);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+
+ } catch (OseeCoreException ex) {
+ labelLink.setText("Error: " + ex.getLocalizedMessage());
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+
+ refresh();
+ editor.registerEvent(this, attrType);
+ }
+
+ @Override
+ public void refresh() {
+ String reason = "";
+ String label = "";
+ try {
+ reason = getReason();
+ if (isNegative()) {
+ label = "Remove " + positive + " from Workflow";
+ } else {
+ label = "Set Workflow to " + positive;
+ }
+ } catch (OseeCoreException ex) {
+ reason = "Error: " + ex.getLocalizedMessage();
+ }
+
+ labelLink.setText(label);
+ labelLink.setLayoutData(new GridData());
+
+ reasonLink.setText("Reason: " + reason);
+ reasonLink.setToolTipText(reason);
+
+ boolean showReason = Strings.isValid(reason);
+ reasonLink.setVisible(showReason);
+ if (showReason) {
+ reasonLink.setForeground(Displays.getSystemColor(color));
+ } else {
+ reasonLink.setForeground(Displays.getSystemColor(SWT.COLOR_BLACK));
+ }
+ reasonLink.setLayoutData(new GridData());
+
+ layout();
+ }
+
+ private String getReason() {
+ return AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem, attrType, "");
+ }
+
+ private boolean isNegative() {
+ return Strings.isValid(getReason());
+ }
+
+ private void handlePositiveButtonSelection() {
+ if (isNegative()) {
+ IAtsChangeSet changes = AtsApiService.get().createChangeSet("Set" + positive + "status");
+ boolean unblock = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ negative + "Workflow", "Are you sure you wish to set this workflow to" + negative + "?");
+ if (unblock) {
+ changes.deleteSoleAttribute(workItem, attrType);
+ }
+ changes.executeIfNeeded();
+ } else {
+ EntryDialog ed =
+ new EntryDialog("Setting Workflow to" + positive, "Enter the reason to set this workflow to " + positive);
+ setReason(ed);
+ }
+ }
+
+ private void setReason(EntryDialog ed) {
+ String Reason = "";
+ IAtsChangeSet changes = AtsApiService.get().createChangeSet("Set" + positive + "reason");
+ if (ed.open() == 0) {
+ Reason = ed.getEntry();
+ if (!Strings.isValid(Reason)) {
+ Reason = getReason();
+ }
+ changes.setSoleAttributeValue(workItem, attrType, Reason);
+ }
+ changes.executeIfNeeded();
+ }
+
+ @Override
+ public IAtsWorkItem getWorkItem() {
+ return workItem;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditBlockedStatusAction.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditBlockedStatusAction.java
index 893e72887e6..23632fea25d 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditBlockedStatusAction.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditBlockedStatusAction.java
@@ -13,71 +13,15 @@
package org.eclipse.osee.ats.ide.actions;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.ide.internal.AtsApiService;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.ui.PlatformUI;
/**
- * @author Branden W. Phillips
+ * @author Bhawana Mishra
*/
-public class EditBlockedStatusAction extends AbstractAtsAction {
-
- private final ISelectedAtsArtifacts selectedAtsArtifacts;
+public class EditBlockedStatusAction extends AbstractEditSubStatusAction {
public EditBlockedStatusAction(ISelectedAtsArtifacts selectedAtsArtifacts) {
- super("Block/Unblock Workflow", IAction.AS_PUSH_BUTTON);
- this.selectedAtsArtifacts = selectedAtsArtifacts;
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.X_RED));
+ super(selectedAtsArtifacts, "Block", "UnBlock", FrameworkImage.X_RED, AtsAttributeTypes.BlockedReason);
}
-
- @Override
- public void runWithException() {
- boolean doBlocking = false;
- boolean promptUnBlock = false;
- boolean fetchedBlockedStatus = false;
- String blockedReason = "";
- for (Artifact workItem : selectedAtsArtifacts.getSelectedWorkflowArtifacts()) {
- IAtsChangeSet changes = AtsApiService.get().createChangeSet("Set blocked status");
- if (!fetchedBlockedStatus) {
- blockedReason = workItem.getSoleAttributeValue(AtsAttributeTypes.BlockedReason, "");
- if (blockedReason.equals("")) {
- doBlocking = true;
- EntryDialog ed =
- new EntryDialog("Setting Workflow to Blocked", "Enter the reason for this workflow being blocked");
- if (ed.open() == 0) {
- blockedReason = ed.getEntry();
- if (!Strings.isValid(blockedReason)) {
- blockedReason = "No reason given, please enter one";
- }
- }
- }
- fetchedBlockedStatus = true;
- }
- if (doBlocking) {
- changes.setSoleAttributeValue(workItem, AtsAttributeTypes.BlockedReason, "Blocked - " + blockedReason);
- } else {
- if (!promptUnBlock) {
- boolean doBlock =
- MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Unblock Workflow", "Are you sure you wish to set this workflow to unblocked?");
- if (!doBlock) {
- return;
- }
- promptUnBlock = true;
- }
- changes.deleteAttributes(workItem, AtsAttributeTypes.BlockedReason);
- }
-
- changes.executeIfNeeded();
- }
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditHoldStatusAction.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditHoldStatusAction.java
new file mode 100644
index 00000000000..ac0e726366c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/EditHoldStatusAction.java
@@ -0,0 +1,28 @@
+/*********************************************************************
+ * Copyright (c) 2020 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.actions;
+
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+
+/**
+ * @author Bhawana Mishra
+ */
+public class EditHoldStatusAction extends AbstractEditSubStatusAction {
+
+ public EditHoldStatusAction(ISelectedAtsArtifacts selectedAtsArtifacts) {
+ super(selectedAtsArtifacts, "Hold", "UnHold", FrameworkImage.HOLD, AtsAttributeTypes.HoldReason);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeBlockedWorkflowHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeBlockedWorkflowHeader.java
index a4edc7de7cc..8505341e604 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeBlockedWorkflowHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeBlockedWorkflowHeader.java
@@ -13,180 +13,21 @@
package org.eclipse.osee.ats.ide.editor.tab.workflow.header;
-import java.util.logging.Level;
-import org.eclipse.jface.dialogs.MessageDialog;
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.actions.AbstractWfeSubWorkflow;
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;
-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.skynet.widgets.dialog.EntryDialog;
import org.eclipse.osee.framework.ui.swt.ALayout;
-import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.Hyperlink;
/**
- * @author Branden W. Phillips
+ * @author Bhawana Mishra
*/
-public class WfeBlockedWorkflowHeader extends Composite implements IWfeEventHandle {
-
- private final IAtsWorkItem workItem;
- private Hyperlink blockedLabelLink;
- private Hyperlink blockedReasonLink;
+public class WfeBlockedWorkflowHeader extends AbstractWfeSubWorkflow {
WfeBlockedWorkflowHeader(Composite parent, int style, final IAtsWorkItem workItem, final WorkflowEditor editor) {
- super(parent, style);
- this.workItem = workItem;
- setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- setLayout(ALayout.getZeroMarginLayout(2, false));
- editor.getToolkit().adapt(this);
-
- try {
- blockedLabelLink = editor.getToolkit().createHyperlink(this, "", SWT.NONE);
- blockedLabelLink.addHyperlinkListener(new IHyperlinkListener() {
-
- @Override
- public void linkEntered(HyperlinkEvent e) {
- // do nothing
- }
-
- @Override
- public void linkExited(HyperlinkEvent e) {
- // do nothing
- }
-
- @Override
- public void linkActivated(HyperlinkEvent e) {
- try {
- if (editor.isDirty()) {
- editor.doSave(null);
- }
- handleBlockedButtonSelection();
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
-
- blockedReasonLink = editor.getToolkit().createHyperlink(this, "", SWT.NONE);
- blockedReasonLink.addHyperlinkListener(new IHyperlinkListener() {
-
- @Override
- public void linkEntered(HyperlinkEvent e) {
- // do nothing
- }
-
- @Override
- public void linkExited(HyperlinkEvent e) {
- // do nothing
- }
-
- @Override
- public void linkActivated(HyperlinkEvent e) {
- try {
- if (editor.isDirty()) {
- editor.doSave(null);
- }
- EntryDialog ed = new EntryDialog("Change Reason for Workflow Blockage",
- "Enter the new reason for this workflow being blocked");
- setBlockedReason(ed);
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
-
- } catch (OseeCoreException ex) {
- blockedLabelLink.setText("Error: " + ex.getLocalizedMessage());
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- refresh();
- editor.registerEvent(this, AtsAttributeTypes.BlockedReason);
- }
-
- @Override
- public void refresh() {
- String blockedReason = "";
- String blockedLabel = "";
- try {
- blockedReason = getBlockedReason();
- if (isBlocked()) {
- blockedLabel = "Set Workflow to Unblocked";
- } else {
- blockedLabel = "Set Workflow to Blocked";
- }
- } catch (OseeCoreException ex) {
- blockedReason = "Error: " + ex.getLocalizedMessage();
- }
-
- blockedLabelLink.setText(blockedLabel);
- blockedLabelLink.setLayoutData(new GridData());
-
- blockedReasonLink.setText("Reason: " + blockedReason);
- boolean showBlockedReason = Strings.isValid(blockedReason);
- blockedReasonLink.setVisible(showBlockedReason);
- if (showBlockedReason) {
- blockedReasonLink.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
- } else {
- blockedReasonLink.setForeground(Displays.getSystemColor(SWT.COLOR_BLACK));
- }
- blockedReasonLink.setLayoutData(new GridData());
-
- layout();
- }
-
- private String getBlockedReason() {
- return AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem,
- AtsAttributeTypes.BlockedReason, "");
- }
-
- private boolean isBlocked() {
- return Strings.isValid(getBlockedReason());
- }
-
- private void handleBlockedButtonSelection() {
- if (isBlocked()) {
- IAtsChangeSet changes = AtsApiService.get().createChangeSet("Set blocked status");
- boolean unblock = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Unblock Workflow", "Are you sure you wish to set this workflow to unblocked?");
- if (unblock) {
- changes.deleteSoleAttribute(workItem, AtsAttributeTypes.BlockedReason);
- }
- changes.executeIfNeeded();
- } else {
- EntryDialog ed =
- new EntryDialog("Setting Workflow to Blocked", "Enter the reason for this workflow being blocked");
- setBlockedReason(ed);
- }
- }
-
- private void setBlockedReason(EntryDialog ed) {
- String blockedReason = "";
- IAtsChangeSet changes = AtsApiService.get().createChangeSet("Set blocked reason");
- if (ed.open() == 0) {
- blockedReason = ed.getEntry();
- if (!Strings.isValid(blockedReason)) {
- blockedReason = "No reason given, please enter one";
- }
- changes.setSoleAttributeValue(workItem, AtsAttributeTypes.BlockedReason, blockedReason);
- }
- changes.executeIfNeeded();
- }
-
- @Override
- public IAtsWorkItem getWorkItem() {
- return workItem;
+ super(parent, style, workItem, editor, "Block", "UnBlock", AtsAttributeTypes.BlockedReason, SWT.COLOR_DARK_RED);
+ setLayout(ALayout.getZeroMarginLayout(4, false));
}
}
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 28fc84cad17..57be5a90a74 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
@@ -117,6 +117,7 @@ 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);
customHeader = createCustomHeader(this, editor.getToolkit(), workItem, editor, managedForm);
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHoldWorkflowHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHoldWorkflowHeader.java
new file mode 100644
index 00000000000..1c482f0ef07
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHoldWorkflowHeader.java
@@ -0,0 +1,31 @@
+/*********************************************************************
+ * 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.tab.workflow.header;
+
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.ide.actions.AbstractWfeSubWorkflow;
+import org.eclipse.osee.ats.ide.editor.WorkflowEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Bhawana Mishra
+ */
+public class WfeHoldWorkflowHeader extends AbstractWfeSubWorkflow {
+
+ WfeHoldWorkflowHeader(Composite parent, int style, final IAtsWorkItem workItem, final WorkflowEditor editor) {
+ super(parent, style, workItem, editor, "Hold", "UnHold", AtsAttributeTypes.HoldReason, SWT.COLOR_DARK_YELLOW);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/task/TaskXViewer.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/task/TaskXViewer.java
index 72f7b515901..2d38e466b36 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/task/TaskXViewer.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/task/TaskXViewer.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.ide.actions.AddTaskAction;
import org.eclipse.osee.ats.ide.actions.EditAssigneeAction;
import org.eclipse.osee.ats.ide.actions.EditBlockedStatusAction;
+import org.eclipse.osee.ats.ide.actions.EditHoldStatusAction;
import org.eclipse.osee.ats.ide.actions.EditStatusAction;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.ide.workflow.transition.TransitionToMenu;
@@ -42,6 +43,7 @@ public class TaskXViewer extends WorldXViewer {
Action editAssigneeAction;
Action addNewTaskAction;
EditBlockedStatusAction editBlockedStatusAction;
+ EditHoldStatusAction editHoldStatusAction;
private boolean tasksEditable = true;
private IAtsTeamWorkflow teamWf;
@@ -57,6 +59,7 @@ public class TaskXViewer extends WorldXViewer {
editStatusAction = new EditStatusAction(this, this, this);
editAssigneeAction = new EditAssigneeAction(this, this);
editBlockedStatusAction = new EditBlockedStatusAction(this);
+ editHoldStatusAction = new EditHoldStatusAction(this);
addNewTaskAction = new AddTaskAction(this);
}
@@ -87,6 +90,9 @@ public class TaskXViewer extends WorldXViewer {
mm.insertBefore(MENU_GROUP_PRE, editBlockedStatusAction);
editBlockedStatusAction.setEnabled(getSelectedWorkflowArtifacts().size() >= 1);
+ mm.insertBefore(MENU_GROUP_PRE, editHoldStatusAction);
+ editHoldStatusAction.setEnabled(getSelectedWorkflowArtifacts().size() >= 1);
+
}
public boolean isTasksEditable() {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldLabelProvider.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldLabelProvider.java
index d44b2494162..9f6907e2937 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldLabelProvider.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldLabelProvider.java
@@ -66,8 +66,12 @@ public class WorldLabelProvider extends XViewerLabelProvider {
IAtsWorkItem workItem = (IAtsWorkItem) element;
String isBlocked = AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem,
AtsAttributeTypes.BlockedReason, "");
+ String isHold = AtsApiService.get().getAttributeResolver().getSoleAttributeValue(workItem,
+ AtsAttributeTypes.HoldReason, "");
if (Strings.isValid(isBlocked)) {
return ImageManager.getImage(FrameworkImage.X_RED);
+ } else if (Strings.isValid(isHold)) {
+ return ImageManager.getImage(FrameworkImage.HOLD);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java
index 7a7ef943803..3db4b485e6c 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java
@@ -43,6 +43,7 @@ import org.eclipse.osee.ats.ide.actions.DeleteTasksAction;
import org.eclipse.osee.ats.ide.actions.EditActionableItemsAction;
import org.eclipse.osee.ats.ide.actions.EditAssigneeAction;
import org.eclipse.osee.ats.ide.actions.EditBlockedStatusAction;
+import org.eclipse.osee.ats.ide.actions.EditHoldStatusAction;
import org.eclipse.osee.ats.ide.actions.EditStatusAction;
import org.eclipse.osee.ats.ide.actions.EmailActionAction;
import org.eclipse.osee.ats.ide.actions.FavoriteAction;
@@ -153,6 +154,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
protected EditStatusAction editStatusAction;
EditAssigneeAction editAssigneeAction;
EditBlockedStatusAction editBlockedStatusAction;
+ EditHoldStatusAction editHoldStatusAction;
FavoriteAction favoritesAction;
SubscribedAction subscribedAction;
@@ -172,6 +174,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
editStatusAction = new EditStatusAction(this, this, this);
editAssigneeAction = new EditAssigneeAction(this, this);
editBlockedStatusAction = new EditBlockedStatusAction(this);
+ editHoldStatusAction = new EditHoldStatusAction(this);
addTaskAction = new AddTaskAction(this);
IAtsTaskArtifactProvider taskProvider = new IAtsTaskArtifactProvider() {
@@ -364,6 +367,9 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
mm.insertBefore(MENU_GROUP_PRE, editBlockedStatusAction);
editBlockedStatusAction.setEnabled(getSelectedWorkflowArtifacts().size() >= 1);
+ mm.insertBefore(MENU_GROUP_PRE, editHoldStatusAction);
+ editHoldStatusAction.setEnabled(getSelectedWorkflowArtifacts().size() >= 1);
+
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/OSEE-INF/images/hold.gif b/plugins/org.eclipse.osee.framework.ui.skynet/OSEE-INF/images/hold.gif
new file mode 100644
index 00000000000..6c6bd580872
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/OSEE-INF/images/hold.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java
index 485d24fb30e..ea4457e8b45 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkImage.java
@@ -120,6 +120,7 @@ public enum FrameworkImage implements KeyedImage {
GROUP("group.gif"),
HEADING("heading.gif"),
HELP("help.gif"),
+ HOLD("hold.gif"),
ID("id.gif"),
IMPLEMENTATION_DETAILS("implementationDetails.gif"),
IMPLEMENTATION_DETAILS_PROCEDURE("implementation_details_procedure.gif"),

Back to the top