Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2011-03-08 22:00:47 -0500
committerRyan D. Brooks2011-03-08 22:00:47 -0500
commit04f0803b14e6d19a601fd97c7e3115484fd6f9c6 (patch)
tree7eb63e11dcf5c7023733a4f896500d774b4b6b69 /plugins/org.eclipse.osee.coverage
parent5c076ee04956482cabec2b8ba231a91a21b205b0 (diff)
downloadorg.eclipse.osee-04f0803b14e6d19a601fd97c7e3115484fd6f9c6.tar.gz
org.eclipse.osee-04f0803b14e6d19a601fd97c7e3115484fd6f9c6.tar.xz
org.eclipse.osee-04f0803b14e6d19a601fd97c7e3115484fd6f9c6.zip
feature: Coverage - Search Coverage Method hyperlink doesn't have Test_Unit in selection
Diffstat (limited to 'plugins/org.eclipse.osee.coverage')
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/EditCoverageMethodAction.java3
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageOptionManager.java17
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/widget/XHyperlabelCoverageMethodSelection.java4
3 files changed, 20 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/EditCoverageMethodAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/EditCoverageMethodAction.java
index 951335cb8b..e95ba06ac5 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/EditCoverageMethodAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/EditCoverageMethodAction.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.coverage.editor.xcover.CoverageXViewer;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoverageItem;
import org.eclipse.osee.coverage.model.CoverageOption;
+import org.eclipse.osee.coverage.model.CoverageOptionManager.EnabledOption;
import org.eclipse.osee.coverage.model.ICoverage;
import org.eclipse.osee.coverage.util.ISaveable;
import org.eclipse.osee.coverage.util.dialog.CoverageMethodListDialog;
@@ -78,7 +79,7 @@ public class EditCoverageMethodAction extends Action {
}
CoverageMethodListDialog dialog =
- new CoverageMethodListDialog(coverageXViewer.getCoverageOptionManager().getEnabled());
+ new CoverageMethodListDialog(coverageXViewer.getCoverageOptionManager().getEnabled(EnabledOption.Write));
if (dialog.open() == 0) {
Set<ICoverage> coveragesToSave = new HashSet<ICoverage>();
for (ICoverage coverageItem : selectedCoverageEditorItem.getSelectedCoverageEditorItems()) {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageOptionManager.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageOptionManager.java
index 22de4301d4..f4662ea93e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageOptionManager.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageOptionManager.java
@@ -37,6 +37,10 @@ public class CoverageOptionManager {
public static CoverageOption Exception_Handling = new CoverageOption("Exception_Handling");
public static CoverageOption Test_Unit = new CoverageOption("Test_Unit");
public static CoverageOption Not_Covered = new CoverageOption("Not_Covered");
+ public static enum EnabledOption {
+ Write,
+ Read
+ }
public CoverageOptionManager(List<CoverageOption> options) {
this.options = options;
@@ -50,10 +54,19 @@ public class CoverageOptionManager {
fromXml(xml);
}
- public Collection<CoverageOption> getEnabled() {
+ /**
+ * Return valid options. If Read, all values returned. This handles the search use case where wouldn't want to set
+ * values, but would want to search them. If Write, only enabled values are returned.
+ *
+ * @param enabledOption
+ * @return
+ */
+ public Collection<CoverageOption> getEnabled(EnabledOption enabledOption) {
List<CoverageOption> enabled = new ArrayList<CoverageOption>();
for (CoverageOption option : options) {
- if (option.isEnabled()) {
+ if (enabledOption == EnabledOption.Read) {
+ enabled.add(option);
+ } else if (enabledOption == EnabledOption.Write && option.isEnabled()) {
enabled.add(option);
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/widget/XHyperlabelCoverageMethodSelection.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/widget/XHyperlabelCoverageMethodSelection.java
index 1d0af83aa1..4a4d77b62d 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/widget/XHyperlabelCoverageMethodSelection.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/widget/XHyperlabelCoverageMethodSelection.java
@@ -14,6 +14,7 @@ import java.util.Collection;
import java.util.HashSet;
import org.eclipse.osee.coverage.model.CoverageOption;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
+import org.eclipse.osee.coverage.model.CoverageOptionManager.EnabledOption;
import org.eclipse.osee.coverage.util.dialog.CoverageMethodListDialog;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -65,7 +66,8 @@ public class XHyperlabelCoverageMethodSelection extends XHyperlinkLabelCmdValueS
@Override
public boolean handleSelection() {
try {
- dialog = new CoverageMethodListDialog(coverageOptionManager.getEnabled(), selectedCoverageMethods);
+ dialog =
+ new CoverageMethodListDialog(coverageOptionManager.getEnabled(EnabledOption.Read), selectedCoverageMethods);
int result = dialog.open();
if (result == 0) {
selectedCoverageMethods.clear();

Back to the top