Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-10-25 13:50:07 -0400
committerRyan D. Brooks2010-10-25 13:50:07 -0400
commitbeff782c1b14f460833b8dd4ebeb33c14c00ce48 (patch)
treeac889dcdacb61dfe3aa28f568e9299b222568663 /plugins/org.eclipse.osee.coverage
parentc5041137bdf7468f89528972d9b454d282b368d1 (diff)
downloadorg.eclipse.osee-beff782c1b14f460833b8dd4ebeb33c14c00ce48.tar.gz
org.eclipse.osee-beff782c1b14f460833b8dd4ebeb33c14c00ce48.tar.xz
org.eclipse.osee-beff782c1b14f460833b8dd4ebeb33c14c00ce48.zip
feature[ats_R54KZ]: Add search for coverage work product tasks
Diffstat (limited to 'plugins/org.eclipse.osee.coverage')
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java4
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java41
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParametersComposite.java26
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/internal/CoveragePerspectiveFactory.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java9
6 files changed, 70 insertions, 14 deletions
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
index 3cc8cad60b..0e2fbad86d 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
@@ -92,9 +92,7 @@ public class CreateWorkProductTaskAction extends Action {
}
WorkProductAction action = (WorkProductAction) dialog.getResult()[0];
- WorkProductTaskFilteredTreeEntryDialog taskDialog =
- new WorkProductTaskFilteredTreeEntryDialog(getText(), "Select existing task or enter new task name",
- "New Task Name");
+ WorkProductTaskFilteredTreeEntryDialog taskDialog = new WorkProductTaskFilteredTreeEntryDialog(getText());
taskDialog.setInput(action.getTasks());
if (taskDialog.open() != 0) {
return;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java
index debc6b1f8f..d45827531a 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.coverage.model.CoverageOption;
import org.eclipse.osee.coverage.model.CoveragePackageBase;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.IWorkProductRelatable;
import org.eclipse.osee.coverage.store.OseeCoverageUnitStore;
import org.eclipse.osee.coverage.util.CoverageUtil;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
@@ -41,6 +42,7 @@ public class CoverageParameters {
private String namespace;
private String rationale;
private String notes;
+ private String workProductTasks;
private User assignee;
private boolean showAll = true;
@@ -80,8 +82,8 @@ public class CoverageParameters {
}
}
} else if (coverage instanceof CoverageUnit) {
- if (Strings.isValid(name) || Strings.isValid(namespace) || Strings.isValid(notes) || assignee != null) {
- if (!((CoverageUnit) coverage).isFolder() && isNameMatch(coverage) && isNamespaceMatch(coverage) && isNotesMatch(coverage) && isAssigneeMatch(coverage)) {
+ if (Strings.isValid(name) || Strings.isValid(namespace) || Strings.isValid(notes) || Strings.isValid(workProductTasks) || assignee != null) {
+ if (!((CoverageUnit) coverage).isFolder() && isNameMatch(coverage) && isNamespaceMatch(coverage) && isNotesMatch(coverage) && isWorkProductTasksMatch(coverage) && isAssigneeMatch(coverage)) {
matchItems.add(coverage);
// If CoverageUnit matches, include all coverage items in match
for (CoverageItem coverageItem : ((CoverageUnit) coverage).getCoverageItems(true)) {
@@ -91,7 +93,9 @@ public class CoverageParameters {
//
isRationaleMatch(coverageItem) &&
//
- isNamespaceMatch(coverageItem)) {
+ isNamespaceMatch(coverageItem) &&
+ //
+ isWorkProductTasksMatch(coverageItem)) {
matchItems.add(coverageItem);
}
}
@@ -107,7 +111,7 @@ public class CoverageParameters {
* Recurse up parent tree to ensure all parents match criteria
*/
private boolean doesParentMatchCriteria(ICoverage coverage) throws OseeCoreException {
- if ((isNameMatch(coverage) || isNamespaceMatch(coverage)) && isNotesMatch(coverage) && isAssigneeMatch(coverage)) {
+ if ((isNameMatch(coverage) || isNamespaceMatch(coverage)) && isNotesMatch(coverage) && isWorkProductTasksMatch(coverage) && isAssigneeMatch(coverage)) {
return true;
} else if (coverage.getParent() instanceof CoverageUnit) {
return doesParentMatchCriteria(coverage.getParent());
@@ -149,6 +153,23 @@ public class CoverageParameters {
}
/**
+ * Match if no workProductTasks specified OR<br>
+ * ICoverage workProductTasks name contains search string
+ */
+ public boolean isWorkProductTasksMatch(ICoverage coverage) {
+ if (!Strings.isValid(workProductTasks) || !(coverage instanceof IWorkProductRelatable)) {
+ return true;
+ }
+ if (!Strings.isValid(((IWorkProductRelatable) coverage).getWorkProductTaskGuid())) {
+ return false;
+ }
+ if (((IWorkProductRelatable) coverage).getWorkProductTask().getName().contains(workProductTasks)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Match if no name specified OR<br>
* item name contains search string
*/
@@ -289,6 +310,7 @@ public class CoverageParameters {
public void clearAll() {
setAssignee(null);
setNotes(null);
+ setWorkProductTasks(null);
setNamespace(null);
setRationale(null);
setName(null);
@@ -297,7 +319,7 @@ public class CoverageParameters {
private void updateShowAll() {
this.showAll =
- getSelectedCoverageMethods().isEmpty() && getAssignee() == null && !Strings.isValid(getNotesStr()) && !Strings.isValid(getNamespace()) && !Strings.isValid(getRationale()) && !Strings.isValid(getName());
+ getSelectedCoverageMethods().isEmpty() && getAssignee() == null && !Strings.isValid(getNotesStr()) && !Strings.isValid(getNamespace()) && !Strings.isValid(getWorkProductTasks()) && !Strings.isValid(getRationale()) && !Strings.isValid(getName());
}
public boolean isShowAll() {
@@ -336,4 +358,13 @@ public class CoverageParameters {
updateShowAll();
}
+ public String getWorkProductTasks() {
+ return workProductTasks;
+ }
+
+ public void setWorkProductTasks(String workProductTasks) {
+ this.workProductTasks = workProductTasks;
+ updateShowAll();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParametersComposite.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParametersComposite.java
index aa9914b3dd..80340aca13 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParametersComposite.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParametersComposite.java
@@ -80,6 +80,7 @@ public class CoverageParametersComposite extends Composite {
getAssigeeCombo().clear();
getNotesXText().set("");
getNameXText().set("");
+ getWorkProductTasksXText().set("");
getNamespaceXText().set("");
getRationaleXText().set("");
getCoverageMethodHyperlinkSelection().clear();
@@ -121,6 +122,17 @@ public class CoverageParametersComposite extends Composite {
}
}
});
+ getWorkProductTasksXText().addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ try {
+ coverageParameters.setWorkProductTasks(getWorkProductTasksStr());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
getNameXText().addXModifiedListener(new XModifiedListener() {
@Override
@@ -186,6 +198,13 @@ public class CoverageParametersComposite extends Composite {
return "";
}
+ public String getWorkProductTasksStr() throws OseeCoreException {
+ if (getWorkProductTasksXText() != null) {
+ return getWorkProductTasksXText().get();
+ }
+ return "";
+ }
+
public String getNameStr() throws OseeCoreException {
if (getNameXText() != null) {
return getNameXText().get();
@@ -215,6 +234,10 @@ public class CoverageParametersComposite extends Composite {
return (XText) getXWidget("Coverage Unit Notes");
}
+ public XText getWorkProductTasksXText() throws OseeCoreException {
+ return (XText) getXWidget("Work Product Tasks");
+ }
+
public XText getNameXText() throws OseeCoreException {
return (XText) getXWidget("Name");
}
@@ -270,8 +293,9 @@ public class CoverageParametersComposite extends Composite {
sb.append("<XWidget xwidgetType=\"XText\" displayName=\"Rationale\" horizontalLabel=\"true\"/>");
//
//
+ sb.append("<XWidget xwidgetType=\"XText\" displayName=\"Work Product Tasks\" beginComposite=\"6\" horizontalLabel=\"true\"/>");
if (coverageParameters.getCoveragePackageBase().isAssignable()) {
- sb.append("<XWidget xwidgetType=\"XMembersCombo\" beginComposite=\"6\" displayName=\"Coverage Unit Assignee\" horizontalLabel=\"true\"/>");
+ sb.append("<XWidget xwidgetType=\"XMembersCombo\" displayName=\"Coverage Unit Assignee\" horizontalLabel=\"true\"/>");
}
//
sb.append("<XWidget xwidgetType=\"XText\" displayName=\"Coverage Unit Notes\" horizontalLabel=\"true\"/>");
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/internal/CoveragePerspectiveFactory.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/internal/CoveragePerspectiveFactory.java
index 81d33f4681..b69ef0ba6e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/internal/CoveragePerspectiveFactory.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/internal/CoveragePerspectiveFactory.java
@@ -40,9 +40,11 @@ public class CoveragePerspectiveFactory implements IPerspectiveFactory {
layout.addShowViewShortcut(BranchView.VIEW_ID);
layout.addShowViewShortcut(CoverageNavigateView.VIEW_ID);
layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView");
+ layout.addShowViewShortcut("org.eclipse.osee.ats.navigate.NavigateView");
left.addView(CoverageNavigateView.VIEW_ID);
left.addView(ArtifactExplorer.VIEW_ID + ":*");
+ left.addView("org.eclipse.osee.ats.navigate.NavigateView");
if (CoverageUtil.isAdmin()) {
bottom.addView("org.eclipse.pde.runtime.LogView");
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
index 8a133d8d23..c53dc4b9f4 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
@@ -54,7 +54,7 @@ public class CoverageUtil {
if (force || CoverageUtil.getBranch() == null) {
Collection<Branch> branches = BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING);
if (isAdmin()) {
- branches.add(BranchManager.getCommonBranch());
+ branches.add(BranchManager.getBranch("SAW_Bld_1"));
}
BranchSelectionDialog dialog = new BranchSelectionDialog("Select Branch", branches);
if (dialog.open() != 0) {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java
index 883f0e6373..32b69e0679 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java
@@ -26,14 +26,13 @@ public class WorkProductTaskFilteredTreeEntryDialog extends WorkProductTaskFilte
private final String entryName;
private XText xText = null;
- public WorkProductTaskFilteredTreeEntryDialog(String title, String message, String entryName) {
- super(title, message);
- this.entryName = entryName;
+ public WorkProductTaskFilteredTreeEntryDialog(String title) {
+ super(title, "Enter a NEW task name OR select an existing task using filter.");
+ this.entryName = "New Task Name";
}
@Override
protected void createPostCustomArea(Composite parent) {
- super.createPreCustomArea(parent);
xText = new XText(entryName);
if (entryValue != null) {
xText.setText(entryValue);
@@ -46,6 +45,8 @@ public class WorkProductTaskFilteredTreeEntryDialog extends WorkProductTaskFilte
}
});
xText.createWidgets(parent, 2);
+
+ super.createPreCustomArea(parent);
}
public String getEntryValue() {

Back to the top