Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-06-15 21:44:47 +0000
committerdonald.g.dunne2017-06-16 16:16:42 +0000
commitf7a498e471a55de3afac7b5220c43f89e2e957dd (patch)
tree65e080e5d418d4f1123809130d0f6066e1e7511f
parent644a75f70d6c3f9e3d4c28aaea456e2405ca5e93 (diff)
downloadorg.eclipse.osee-f7a498e471a55de3afac7b5220c43f89e2e957dd.tar.gz
org.eclipse.osee-f7a498e471a55de3afac7b5220c43f89e2e957dd.tar.xz
org.eclipse.osee-f7a498e471a55de3afac7b5220c43f89e2e957dd.zip
feature[ats_ATS371066]: HLR - Changes in support of action
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/AbstractWizardItem.java44
1 files changed, 34 insertions, 10 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/AbstractWizardItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/AbstractWizardItem.java
index 5c8085fdb51..40cd617e673 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/AbstractWizardItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/AbstractWizardItem.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.agile.IAgileFeatureGroup;
import org.eclipse.osee.ats.api.agile.IAgileSprint;
+import org.eclipse.osee.ats.api.agile.IAgileTeam;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
@@ -34,17 +35,19 @@ import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.config.ActionableItems;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.widgets.XAssigneesHyperlinkWidget;
import org.eclipse.osee.ats.util.widgets.XOriginatorHyperlinkWidget;
import org.eclipse.osee.ats.util.widgets.XWorkPackageHyperlinkWidget;
import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.DoubleKeyHashMap;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
import org.eclipse.osee.framework.ui.skynet.widgets.XComboViewer;
import org.eclipse.osee.framework.ui.skynet.widgets.XFloat;
-import org.eclipse.osee.framework.ui.skynet.widgets.XInteger;
import org.eclipse.osee.framework.ui.skynet.widgets.XLabel;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
@@ -141,10 +144,13 @@ public abstract class AbstractWizardItem implements IAtsWizardItem, IDynamicWidg
pointsComp.setLayout(layout);
pointsComp.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
- XInteger points = new XInteger(WizardFields.Points.getDisplayName());
- points.setFillHorizontally(false);
- points.createWidgets(pointsComp, 1);
- teamDefFieldToWidget.put(teamDef, WizardFields.Points, points);
+ XComboViewer pointsCombo = new XComboViewer("Points", SWT.NONE);
+ Collection<Object> objects = new LinkedList<>();
+ objects.addAll(AttributeTypeManager.getEnumerationValues(AtsAttributeTypes.Points));
+ pointsCombo.setInput(objects);
+ pointsCombo.setFillHorizontally(false);
+ pointsCombo.createWidgets(pointsComp, 2);
+ teamDefFieldToWidget.put(teamDef, WizardFields.Points, pointsCombo);
}
private void createAssigneeWidget(IAtsTeamDefinition teamDef, Composite teamComp) {
@@ -381,11 +387,29 @@ public abstract class AbstractWizardItem implements IAtsWizardItem, IDynamicWidg
}
private void wizardCompletedPoints(IAtsTeamWorkflow teamWf, IAtsTeamDefinition teamDef, IAtsChangeSet changes) {
- XFloat xFloat = (XFloat) teamDefFieldToWidget.get(teamDef, WizardFields.Points);
- if (xFloat != null) {
- String points = xFloat.get();
- if (Strings.isValid(points)) {
- changes.setSoleAttributeFromString(teamWf, AtsAttributeTypes.Points, points);
+ ArtifactToken agileTeamArt = AtsClientService.get().getRelationResolver().getRelatedOrNull(teamDef,
+ AtsRelationTypes.AgileTeamToAtsTeam_AgileTeam);
+ if (agileTeamArt != null) {
+ IAgileTeam agileTeam = AtsClientService.get().getConfigItemFactory().getAgileTeam(agileTeamArt);
+ AttributeTypeId agileTeamPointsAttributeType =
+ AtsClientService.get().getAgileService().getAgileTeamPointsAttributeType(agileTeam);
+ XWidget widget = (XWidget) teamDefFieldToWidget.get(teamDef, agileTeamPointsAttributeType.equals(
+ AtsAttributeTypes.Points) ? WizardFields.Points : WizardFields.PointsNumeric);
+ if (widget != null) {
+ if (widget instanceof XFloat) {
+ XFloat xFloat = (XFloat) widget;
+ String pointsStr = xFloat.get();
+ if (Strings.isNumeric(pointsStr)) {
+ Double points = Double.valueOf(pointsStr);
+ changes.setSoleAttributeValue(teamWf, agileTeamPointsAttributeType, points);
+ }
+ } else if (widget instanceof XComboViewer) {
+ XComboViewer pointsCombo = (XComboViewer) widget;
+ String pointsStr = (String) pointsCombo.getSelected();
+ if (Strings.isValid(pointsStr)) {
+ changes.setSoleAttributeValue(teamWf, agileTeamPointsAttributeType, pointsStr);
+ }
+ }
}
}
}

Back to the top