Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2021-01-05 22:34:15 +0000
committerRyan Brooks2021-01-06 19:25:18 +0000
commitaa177d75f2c2c9f5a6ad9b6b5700854fbb0d0197 (patch)
treeda5c21e6c5fcfd96a71b981a27dd0f60b1c70d1d
parent9121506bf4b03deb345403fc74989f8925e71b75 (diff)
downloadorg.eclipse.osee-aa177d75f2c2c9f5a6ad9b6b5700854fbb0d0197.tar.gz
org.eclipse.osee-aa177d75f2c2c9f5a6ad9b6b5700854fbb0d0197.tar.xz
org.eclipse.osee-aa177d75f2c2c9f5a6ad9b6b5700854fbb0d0197.zip
bug[TW18558]: Fix artifact edtior minimum attribute error
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java35
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextFlatDam.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java1
6 files changed, 14 insertions, 49 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java
index f825f88b984..9a8296685a2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java
@@ -78,15 +78,14 @@ public abstract class XFlatWidget<T> extends XLabel {
protected void setPageRange(int minPage, int maxPage) {
if (minPage < 0) {
- throw new OseeArgumentException("Min Number of Pages must be greater than 0");
+ throw new OseeArgumentException("Min number of pages must be at least 0");
}
- if (maxPage < 1) {
- throw new OseeArgumentException("Max Number of Pages must be at least 1");
+ if (maxPage < 0) {
+ throw new OseeArgumentException("Max number of pages must be at least 0");
}
if (maxPage < minPage) {
- throw new OseeArgumentException(
- String.format("Invalid required number of pages [%s] < [%s]", maxPage, minPage));
+ throw new OseeArgumentException("Invalid required number of pages [%s] < [%s]", maxPage, minPage);
}
this.minPage = minPage;
this.maxPage = maxPage;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java
index a062fff1315..dc587920110 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java
@@ -19,7 +19,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -45,7 +44,6 @@ public abstract class XSelectFromDialog<T> extends XText {
private final List<T> selected = new ArrayList<>();
private final List<T> input = new ArrayList<>();
- private int minSelectionRequired, maxSelectionRequired = 1;
private Button selectionButton;
public XSelectFromDialog(String displayLabel) {
@@ -53,22 +51,6 @@ public abstract class XSelectFromDialog<T> extends XText {
setToolTip("Click the button on the left to change the current selection.");
}
- public void setRequiredSelection(int minSelectionRequired, int maxSelectionRequired) {
- if (minSelectionRequired < 0) {
- throw new OseeArgumentException("Min Number of Selection must be greater than or equal to 0");
- }
- if (maxSelectionRequired < 1) {
- throw new OseeArgumentException("Max Number of Selection must be at least 1");
- }
-
- if (maxSelectionRequired < minSelectionRequired) {
- throw new OseeArgumentException("Invalid required number of selections [%s] < [%s]", maxSelectionRequired,
- minSelectionRequired);
- }
- this.minSelectionRequired = minSelectionRequired;
- this.maxSelectionRequired = maxSelectionRequired;
- }
-
@Override
protected int getTextStyle() {
return SWT.READ_ONLY | SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL;
@@ -193,19 +175,4 @@ public abstract class XSelectFromDialog<T> extends XText {
}
return selectedChanged;
}
-
- /**
- * @return the minSelectionRequired
- */
- public int getMinSelectionRequired() {
- return minSelectionRequired;
- }
-
- /**
- * @return the maxSelectionRequired
- */
- public int getMaxSelectionRequired() {
- return maxSelectionRequired;
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java
index 3661491844c..709bae71648 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java
@@ -59,10 +59,7 @@ public class XSelectFromMultiChoiceDam extends XSelectFromDialog<String> impleme
public void setAttributeType(Artifact artifact, AttributeTypeToken attributeType) {
this.artifact = artifact;
this.attributeType = attributeType;
- int minOccurrence = artifact.getArtifactType().getMin(attributeType);
- int maxOccurrence = artifact.getArtifactType().getMax(attributeType);
- setRequiredSelection(minOccurrence, maxOccurrence);
setSelected(getStored());
setRequiredEntry(true);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
index 4ffb318ec15..acd17bb1fd9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
@@ -76,15 +76,14 @@ public abstract class XStackedWidget<T> extends XLabel {
protected void setPageRange(int minPage, int maxPage) {
if (minPage < 0) {
- throw new OseeArgumentException("Min Number of Pages must be at lesat 0");
+ throw new OseeArgumentException("Min number of pages must be at least 0");
}
if (maxPage < 0) {
- throw new OseeArgumentException("Max Number of Pages must be at least 0");
+ throw new OseeArgumentException("Max number of pages must be at least 0");
}
if (maxPage < minPage) {
- throw new OseeArgumentException(
- String.format("Invalid required number of pages [%s] < [%s]", maxPage, minPage));
+ throw new OseeArgumentException("Invalid required number of pages [%s] < [%s]", maxPage, minPage);
}
this.minPage = minPage;
this.maxPage = maxPage;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextFlatDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextFlatDam.java
index a8e7c856c97..1b3453089fb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextFlatDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextFlatDam.java
@@ -89,9 +89,13 @@ public class XTextFlatDam extends XFlatWidget<String> implements IAttributeWidge
int minOccurrence = artifact.getArtifactType().getMin(attributeType);
int maxOccurrence = artifact.getArtifactType().getMax(attributeType);
- if (minOccurrence == 0) {
- minOccurrence = 1;
+ if (minOccurrence < 0) {
+ minOccurrence = 0;
}
+ if (maxOccurrence < 0) {
+ maxOccurrence = 0;
+ }
+
setPageRange(minOccurrence, maxOccurrence);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java
index 74e2aad9579..d405efee879 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java
@@ -169,7 +169,6 @@ public final class FrameworkXWidgetProvider {
Collections.sort(branches);
multiBranchSelect.setSelectableItems(branches);
- multiBranchSelect.setRequiredSelection(1, maxSelectionRequired);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}

Back to the top