Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2011-07-28 14:55:17 +0000
committerRyan D. Brooks2011-07-28 14:55:17 +0000
commit68d8d47c606b85517bb7cf02fdd06f113982e893 (patch)
treee10e6746354b5407738c78a29e3da25c9b3e2789
parent44e0191fee32d7a33e009526ae760d551b62662a (diff)
downloadorg.eclipse.osee-68d8d47c606b85517bb7cf02fdd06f113982e893.tar.gz
org.eclipse.osee-68d8d47c606b85517bb7cf02fdd06f113982e893.tar.xz
org.eclipse.osee-68d8d47c606b85517bb7cf02fdd06f113982e893.zip
feature: WorkDef - Remove un-necessary ATSAttributes class
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/type/ATSAttributes.java76
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/StateDefinition.java18
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/StateXWidgetPage.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java9
7 files changed, 34 insertions, 93 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/type/ATSAttributes.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/type/ATSAttributes.java
deleted file mode 100644
index c292f2666ed..00000000000
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/type/ATSAttributes.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ats.core.type;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Donald G. Dunne
- */
-public class ATSAttributes {
- private static final Map<String, ATSAttributes> WORK_ITEM_ID_TO_ATS_ATTRIBUTE_MAP =
- new HashMap<String, ATSAttributes>();
-
- // @formatter:off
- public static final ATSAttributes WORKING_BRANCH_WIDGET = new ATSAttributes("Working Branch");
- public static final ATSAttributes VALIDATE_REQ_CHANGES_WIDGET = new ATSAttributes("Validate Requirement Changes");
- public static final ATSAttributes CREATE_CODE_TEST_TASKS_OFF_REQUIREMENTS = new ATSAttributes("Create Code/Test Tasks");
- public static final ATSAttributes CHECK_SIGNALS_VIA_CDB_WIDGET = new ATSAttributes("Check Signals Via CDB");
- public static final ATSAttributes SHOW_CDB_DIFF_REPORT_WIDGET = new ATSAttributes("Show CDB Differences Report");
- public static final ATSAttributes COMMIT_MANAGER_WIDGET = new ATSAttributes("Commit Manager", "Commit branches to parent and parallel branches.");
- // @formatter:on
-
- private final String displayName;
- private final String description;
- private final String workItemId;
-
- protected ATSAttributes(String displayName, String workItemId, String description) {
- this.displayName = displayName;
- this.workItemId = workItemId;
- this.description = description;
- WORK_ITEM_ID_TO_ATS_ATTRIBUTE_MAP.put(workItemId, this);
- }
-
- private ATSAttributes(String displayName) {
- this(displayName, "");
- }
-
- private ATSAttributes(String displayName, String description) {
- this(displayName, "ats." + displayName, description);
- }
-
- public static ATSAttributes getAtsAttributeByStoreName(String workItemId) {
- return WORK_ITEM_ID_TO_ATS_ATTRIBUTE_MAP.get(workItemId);
- }
-
- @Override
- public final boolean equals(Object obj) {
- return super.equals(obj);
- }
-
- @Override
- public final int hashCode() {
- return super.hashCode();
- }
-
- public String getDisplayName() {
- return displayName;
- }
-
- public String getWorkItemId() {
- return workItemId;
- }
-
- public String getDescription() {
- return description;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/StateDefinition.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/StateDefinition.java
index 2d66a99dc58..6a20d5e69f6 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/StateDefinition.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/StateDefinition.java
@@ -248,4 +248,22 @@ public class StateDefinition extends AbstractWorkDefItem implements IWorkPage {
return color;
}
+ public boolean hasWidgetNamed(String name) {
+ for (WidgetDefinition widgetDef : getWidgetsFromStateItems()) {
+ if (widgetDef.getName().equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean hasWidgetWithXWidgetName(String xWidgetName) {
+ for (WidgetDefinition widgetDef : getWidgetsFromStateItems()) {
+ if (widgetDef.getXWidgetName().equals(xWidgetName)) {
+ return true;
+ }
+ }
+ return false;
+
+ }
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
index 257660662da..477ca35293c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
@@ -55,9 +55,9 @@ public class AtsWidgetProvider implements IXWidgetProvider {
toReturn = new XStateCombo();
} else if (widgetName.equals(XStateSearchCombo.WIDGET_ID)) {
toReturn = new XStateSearchCombo();
- } else if (widgetName.equals("XCommitManager")) {
+ } else if (widgetName.equals(XCommitManager.WIDGET_NAME)) {
toReturn = new XCommitManager();
- } else if (widgetName.equals("XWorkingBranch")) {
+ } else if (widgetName.equals(XWorkingBranch.WIDGET_NAME)) {
toReturn = new XWorkingBranch();
} else if (widgetName.equals(AtsOperationalImpactValidator.WIDGET_NAME)) {
toReturn = new OperationalImpactXWidget();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
index 674e23c6454..a683601f603 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
@@ -20,7 +20,6 @@ import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.core.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.team.TeamWorkFlowManager;
-import org.eclipse.osee.ats.core.type.ATSAttributes;
import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.osee.ats.util.AtsBranchManager;
@@ -81,6 +80,8 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
private Button favoriteBranchButton;
private Button lockBranchButton;
private XWorkingBranchEnablement enablement;
+ public static String NAME = "Working Branch";
+ public static String WIDGET_NAME = "XWorkingBranch";
private Composite buttonComp;
@@ -107,10 +108,9 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
return changesPermitted;
}
}
- public final static String WIDGET_ID = ATSAttributes.WORKING_BRANCH_WIDGET.getWorkItemId();
public XWorkingBranch() {
- super("Working Branch");
+ super(NAME);
OseeEventManager.addListener(this);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index 6285e03de09..8f80cd0377b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.ats.core.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.commit.ICommitConfigArtifact;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.team.TeamWorkFlowManager;
-import org.eclipse.osee.ats.core.type.ATSAttributes;
import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.editor.SMAEditor;
@@ -77,13 +76,15 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
private TeamWorkFlowArtifact teamArt;
private static final int paddedTableHeightHint = 2;
private Label extraInfoLabel;
- public final static String WIDGET_ID = ATSAttributes.COMMIT_MANAGER_WIDGET.getWorkItemId();
+ public static final String WIDGET_NAME = "XCommitManager";
+ public static final String NAME = "Commit Manager";
+ public static final String DESCRIPTION = "Commit branches to parent and parallel branches.";
private int lastDefectListSize = 0;
private Composite mainComp;
private Composite parentComp;
public XCommitManager() {
- super("Commit Manager");
+ super(NAME);
OseeEventManager.addListener(this);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/StateXWidgetPage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/StateXWidgetPage.java
index b1e5870da04..beb0d05a04c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/StateXWidgetPage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/StateXWidgetPage.java
@@ -27,7 +27,6 @@ import java.util.logging.Level;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.ats.core.task.TaskResolutionOptionRule;
-import org.eclipse.osee.ats.core.type.ATSAttributes;
import org.eclipse.osee.ats.core.type.AtsAttributeTypes;
import org.eclipse.osee.ats.core.workdef.CompositeStateItem;
import org.eclipse.osee.ats.core.workdef.StateDefinition;
@@ -39,6 +38,7 @@ import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.editor.stateItem.AtsStateItemManager;
import org.eclipse.osee.ats.editor.stateItem.IAtsStateItem;
import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.ats.util.widgets.commit.XCommitManager;
import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
@@ -354,9 +354,8 @@ public class StateXWidgetPage implements IDynamicWidgetLayoutListener, IWorkPage
// If no tool tip, add global tool tip
if (!Strings.isValid(xWidget.getToolTip())) {
String description = "";
- ATSAttributes atsAttribute = ATSAttributes.getAtsAttributeByStoreName(layoutData.getId());
- if (atsAttribute != null && Strings.isValid(atsAttribute.getDescription())) {
- description = atsAttribute.getDescription();
+ if (layoutData.getXWidgetName().equals(XCommitManager.WIDGET_NAME)) {
+ description = XCommitManager.DESCRIPTION;
}
IAttributeType type = AtsAttributeTypes.getTypeByName(layoutData.getStoreName());
if (type != null && Strings.isValid(type.getDescription())) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java
index 469675fc1d5..e4dade6f7de 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.ats.core.task.TaskArtifact;
import org.eclipse.osee.ats.core.task.TaskManager;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.team.TeamWorkflowProviders;
-import org.eclipse.osee.ats.core.type.ATSAttributes;
import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
import org.eclipse.osee.ats.core.type.AtsAttributeTypes;
import org.eclipse.osee.ats.core.workdef.RuleDefinitionOption;
@@ -86,8 +85,8 @@ public final class AtsWorkDefinitions implements IWorkDefinitionProvider {
}
public static void relatePageToBranchCommitRules(String pageId) throws OseeCoreException {
- WorkItemDefinitionFactory.relateWorkItemDefinitions(pageId, XWorkingBranch.WIDGET_ID);
- WorkItemDefinitionFactory.relateWorkItemDefinitions(pageId, XCommitManager.WIDGET_ID);
+ WorkItemDefinitionFactory.relateWorkItemDefinitions(pageId, "ats.Working Branch");
+ WorkItemDefinitionFactory.relateWorkItemDefinitions(pageId, "ats.Commit Manager");
}
@Override
@@ -244,11 +243,11 @@ public final class AtsWorkDefinitions implements IWorkDefinitionProvider {
}
public static boolean isAllowCreateBranch(StateDefinition stateDefinition) {
- return stateDefinition.hasRule(ATSAttributes.WORKING_BRANCH_WIDGET.getWorkItemId());
+ return stateDefinition.hasWidgetWithXWidgetName(XWorkingBranch.WIDGET_NAME);
}
public static boolean isAllowCommitBranch(StateDefinition stateDefinition) {
- return stateDefinition.hasRule(ATSAttributes.COMMIT_MANAGER_WIDGET.getWorkItemId());
+ return stateDefinition.hasWidgetWithXWidgetName(XCommitManager.WIDGET_NAME);
}
public static Result validateWorkItemDefinition(WorkItemDefinition workItemDefinition) {

Back to the top