Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-06-06 14:40:44 -0400
committerdonald.g.dunne2017-06-06 14:42:37 -0400
commite9c00800bcd8009c84d3d80c3db87caa35debccc (patch)
tree0c13eb53361b3a58568f2ac84f6827cfb9177184
parent5d264fd056b90286e0ea0dc912f516c34c7a7548 (diff)
downloadorg.eclipse.osee-word_test.tar.gz
org.eclipse.osee-word_test.tar.xz
org.eclipse.osee-word_test.zip
feature[ats_ATS377299]: HLR - Changes in support of actionword_test
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/model/StateDefinition.java29
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java5
2 files changed, 16 insertions, 18 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/model/StateDefinition.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/model/StateDefinition.java
index 8d5485c696..447525ac18 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/model/StateDefinition.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/model/StateDefinition.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.StateColor;
import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Donald G. Dunne
@@ -107,32 +108,24 @@ public class StateDefinition extends AbstractWorkDefItem implements IAtsStateDef
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + (getFullName() == null ? 0 : getFullName().hashCode());
+ result = prime * result + (getName() == null ? 0 : getName().hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
+ boolean equals = false;
if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- IAtsStateDefinition other = (IAtsStateDefinition) obj;
- if (getFullName() == null) {
- if (other.getFullName() != null) {
- return false;
- } else {
- return false;
+ equals = true;
+ } else if (obj != null) {
+ if (getClass() == obj.getClass()) {
+ IAtsStateDefinition other = (IAtsStateDefinition) obj;
+ if (Strings.isValid(getName()) && Strings.isValid(other.getName()) && getName().equals(other.getName())) {
+ equals = true;
+ }
}
- } else if (!getFullName().equals(other.getFullName())) {
- return false;
}
- return true;
+ return equals;
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java
index 69a3256051..bdd04a5c46 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java
@@ -240,6 +240,11 @@ public class XComboViewer extends GenericXWidget {
public void setSelected(List<Object> selected) {
comboViewer.setSelection(new StructuredSelection(selected.toArray(new Object[selected.size()])));
+ if (selected.isEmpty()) {
+ selected = null;
+ } else {
+ this.selected = selected.iterator().next();
+ }
updateListWidget();
}

Back to the top