Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2008-05-09 18:16:08 +0000
committerddunne2008-05-09 18:16:08 +0000
commit8ee3def117bde029b01a653bd130c6f437449668 (patch)
tree4e3ac22ef65601fa0d84e9e9b7ee69a0cb751f0f
parentc8fa2067f73f8cd5840f4242a83e9e436959bde0 (diff)
downloadorg.eclipse.osee-8ee3def117bde029b01a653bd130c6f437449668.tar.gz
org.eclipse.osee-8ee3def117bde029b01a653bd130c6f437449668.tar.xz
org.eclipse.osee-8ee3def117bde029b01a653bd130c6f437449668.zip
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java33
1 files changed, 17 insertions, 16 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java
index b7e65febbf8..5a8e1a16cdb 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.skynet.core.attribute.BinaryAttribute;
import org.eclipse.osee.framework.skynet.core.attribute.BooleanAttribute;
import org.eclipse.osee.framework.skynet.core.attribute.DateAttribute;
import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
+import org.eclipse.osee.framework.skynet.core.attribute.FloatingPointAttribute;
import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.DateValue;
import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.EnumeratedValue;
import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.StringValue;
@@ -71,24 +72,22 @@ public class AttributeCellModifier implements ICellModifier {
if (attribute instanceof EnumeratedAttribute) {
enumeratedValue.setValue(attribute.getDisplayableString());
enumeratedValue.setChocies(((EnumeratedAttribute) attribute).getChoices());
+ return enumeratedValue;
+ } else if (object instanceof Boolean) {
+ enumeratedValue.setValue(attribute.getDisplayableString());
+ enumeratedValue.setChocies(BooleanAttribute.booleanChoices);
+ return enumeratedValue;
+ } else if (object instanceof Date) {
+ dateValue.setValue((Date) object);
+ return dateValue;
+ } else if (object instanceof String || object instanceof Integer || object instanceof Double) {
+ stringValue.setValue(attribute.getDisplayableString());
+ return stringValue;
} else {
- if (object instanceof Boolean) {
- enumeratedValue.setValue(attribute.getDisplayableString());
- enumeratedValue.setChocies(BooleanAttribute.booleanChoices);
- return enumeratedValue;
- } else if (object instanceof Date) {
- dateValue.setValue((Date) object);
- return dateValue;
- } else if (object instanceof String || object instanceof Integer || object instanceof Double) {
- stringValue.setValue(attribute.getDisplayableString());
- return stringValue;
- } else {
- StringValue val = new StringValue();
- val.setValue(attribute.getDisplayableString());
- return val;
- }
+ StringValue val = new StringValue();
+ val.setValue(attribute.getDisplayableString());
+ return val;
}
- throw new IllegalArgumentException("unexpected element type: " + element.getClass().getName());
}
/*
@@ -114,6 +113,8 @@ public class AttributeCellModifier implements ICellModifier {
}
} else if (attribute instanceof BooleanAttribute) {
((BooleanAttribute) attribute).setValue(value.equals("yes"));
+ } else if (attribute instanceof FloatingPointAttribute) {
+ ((FloatingPointAttribute) attribute).setValue(new Double((String) value).doubleValue());
} else if (!(attribute instanceof BinaryAttribute)) {
//binary attributes should not be changed.
attribute.setValue(value);

Back to the top