Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2008-04-11 19:03:54 +0000
committerddunne2008-04-11 19:03:54 +0000
commit6accf1b27195b05d673652021dc8e9c2c4474577 (patch)
tree6f923a0d8d62057e6271d46705bea8a798dbf641
parent98824bfeddc13dc9c6911f99b796b7b4988d2581 (diff)
downloadorg.eclipse.osee-6accf1b27195b05d673652021dc8e9c2c4474577.tar.gz
org.eclipse.osee-6accf1b27195b05d673652021dc8e9c2c4474577.tar.xz
org.eclipse.osee-6accf1b27195b05d673652021dc8e9c2c4474577.zip
Fixed resolution showing null in dialog
-rw-r--r--org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java8
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java13
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java34
3 files changed, 38 insertions, 17 deletions
diff --git a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
index 7ab168b9cfc..834bafe4b21 100644
--- a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
+++ b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
@@ -353,6 +353,14 @@ public class TaskArtifact extends StateMachineArtifact implements IWorldViewArti
return 0;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isWorldViewAnnualCostAvoidanceValid()
+ */
+ @Override
+ public Result isWorldViewAnnualCostAvoidanceValid() {
+ return Result.TrueResult;
+ }
+
/*
* (non-Javadoc)
*
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
index 5fb7c246e46..265e7324f10 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
@@ -573,6 +573,19 @@ public class Artifact implements PersistenceObject, IAdaptable, Comparable<Artif
}
/**
+ * Get sole double attribute value if it exists, else return 0.0
+ *
+ * @param attributeName
+ * @return
+ * @throws IllegalStateException
+ */
+ public double getSoleDoubleAttributeValue(String attributeTypeName) throws IllegalStateException {
+ Double value = getSoleXAttributeValueHideException(attributeTypeName);
+ if (value == null) return 0.0;
+ return value;
+ }
+
+ /**
* @param attributeName
* @return true if attribute exists AND set to "yes"; else return false
* @throws IllegalStateException
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java
index 32dde98d749..b996280b54b 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java
@@ -87,27 +87,27 @@ public class ArtifactPromptChange {
}
public static boolean promptChangeFloatAttribute(String attributeName, String displayName, final Artifact artifact, boolean persist) throws SQLException {
- return promptChangeFloatAttribute(attributeName, displayName,Arrays.asList(new Artifact[] {artifact}), persist);
+ return promptChangeFloatAttribute(attributeName, displayName, Arrays.asList(new Artifact[] {artifact}), persist);
}
public static boolean promptChangeFloatAttribute(String attributeName, String displayName, final Collection<? extends Artifact> smas, boolean persist) throws SQLException {
- EntryDialog ed =
- new EntryDialog(Display.getCurrent().getActiveShell(), "Enter " + displayName, null,
- "Enter " + displayName, MessageDialog.QUESTION, new String[] {"OK", "Clear", "Cancel"}, 0);
- if (smas.size() == 1) ed.setEntry("" + smas.iterator().next().getSoleXAttributeValue(attributeName));
- if (VALID_FLOAT_REG_EX != null) ed.setValidationRegularExpression(VALID_FLOAT_REG_EX);
- int result = ed.open();
- if (result == 0 || result == 1) {
- for (Artifact sma : smas) {
- if (result == 0)
- sma.setSoleXAttributeValue(attributeName, new Double(ed.getEntry()));
- else
- sma.setSoleXAttributeValue(attributeName, new Double(0));
- if (persist) sma.persistAttributes();
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Enter " + displayName, null,
+ "Enter " + displayName, MessageDialog.QUESTION, new String[] {"OK", "Clear", "Cancel"}, 0);
+ if (smas.size() == 1) ed.setEntry("" + smas.iterator().next().getSoleDoubleAttributeValue(attributeName));
+ if (VALID_FLOAT_REG_EX != null) ed.setValidationRegularExpression(VALID_FLOAT_REG_EX);
+ int result = ed.open();
+ if (result == 0 || result == 1) {
+ for (Artifact sma : smas) {
+ if (result == 0)
+ sma.setSoleXAttributeValue(attributeName, new Double(ed.getEntry()));
+ else
+ sma.setSoleXAttributeValue(attributeName, new Double(0));
+ if (persist) sma.persistAttributes();
+ }
+ return true;
}
- return true;
- }
- return false;
+ return false;
}
public static boolean promptChangeStringAttribute(String attributeName, String displayName, final Artifact artifact, boolean persist) throws SQLException {

Back to the top