Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-08-05 20:53:47 +0000
committerRoberto E. Escobar2014-09-29 22:55:04 +0000
commitdcb326ebb42d136dfcf2e550f2323dcfad7979ca (patch)
tree47f10b6ef5c6b0976cec7797a230724f00c22611
parentd60edc86162c2dc9cbc122ef239f475f6a736b7d (diff)
downloadorg.eclipse.osee-dcb326ebb42d136dfcf2e550f2323dcfad7979ca.tar.gz
org.eclipse.osee-dcb326ebb42d136dfcf2e550f2323dcfad7979ca.tar.xz
org.eclipse.osee-dcb326ebb42d136dfcf2e550f2323dcfad7979ca.zip
feature[ats_ATS97572]: Provide ATS multiple line Search by Id
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java22
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java26
3 files changed, 57 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
index b4a28a2271a..cff967133aa 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
@@ -171,6 +171,9 @@ public final class AtsNavigateViewItems implements XNavigateViewItems, IXNavigat
new MultipleIdSearchOperationFactory("Open Change Report(s) by ID(s)", AtsEditor.ChangeReport)));
items.add(new XNavigateItemOperation(item, AtsImage.OPEN_BY_ID, "Search by ID(s) - Open World Editor",
new MultipleIdSearchOperationFactory("Search by ID(s) - Open World Editor", AtsEditor.WorldEditor)));
+ items.add(new XNavigateItemOperation(item, AtsImage.OPEN_BY_ID,
+ "Search by ID(s) - Multi-Line - Open World Editor", new MultipleIdMultiLineSearchOperationFactory(
+ "Search by ID(s) - Open World Editor", AtsEditor.WorldEditor)));
items.add(new XNavigateItemOperation(item, AtsImage.WORKFLOW_CONFIG, "Search by ID(s) - Open Workflow Editor",
new MultipleIdSearchOperationFactory("Search by ID(s) - Open Workflow Editor", AtsEditor.WorkflowEditor)));
items.add(new XNavigateItemOperation(item, AtsImage.GLOBE, "Quick Search",
@@ -359,6 +362,25 @@ public final class AtsNavigateViewItems implements XNavigateViewItems, IXNavigat
}
}
+ private static final class MultipleIdMultiLineSearchOperationFactory implements IOperationFactory {
+
+ private final AtsEditor atsEditor;
+ private final String operationName;
+
+ public MultipleIdMultiLineSearchOperationFactory(String operationName, AtsEditor atsEditor) {
+ this.operationName = operationName;
+ this.atsEditor = atsEditor;
+ }
+
+ @Override
+ public IOperation createOperation() {
+ MultipleIdSearchOperation op =
+ new MultipleIdSearchOperation(new MultipleIdSearchData(operationName, atsEditor));
+ op.setMultiLine(true);
+ return op;
+ }
+ }
+
@Override
public void createCommonSection(List<XNavigateItem> items, List<String> excludeSectionIds) {
XNavigateItem reviewItem = new XNavigateItem(null, "OSEE ATS", AtsImage.ACTION);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
index 567829dcbd8..c2421746d4a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
@@ -36,7 +36,7 @@ import org.eclipse.osee.ats.util.LegacyPCRActions;
import org.eclipse.osee.ats.util.widgets.dialog.AtsObjectNameSorter;
import org.eclipse.osee.ats.world.IWorldEditorConsumer;
import org.eclipse.osee.ats.world.WorldEditor;
-import org.eclipse.osee.ats.world.WorldEditorOperationProvider;
+import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
@@ -64,6 +64,7 @@ public class MultipleIdSearchOperation extends AbstractOperation implements IWor
private final Set<Artifact> resultNonAtsArts = new HashSet<Artifact>();
private final Set<Artifact> artifacts = new HashSet<Artifact>();
private final MultipleIdSearchData data;
+ private boolean multiLine;
public MultipleIdSearchOperation(MultipleIdSearchData data) {
super(data.getName(), Activator.PLUGIN_ID);
@@ -74,6 +75,7 @@ public class MultipleIdSearchOperation extends AbstractOperation implements IWor
protected void doWork(IProgressMonitor monitor) throws Exception {
if (!data.hasValidInput()) {
MultipleIdSearchUi ui = new MultipleIdSearchUi(data);
+ ui.setMultiLine(multiLine);
if (!ui.getInput()) {
return;
}
@@ -101,7 +103,7 @@ public class MultipleIdSearchOperation extends AbstractOperation implements IWor
} else if (data.getAtsEditor() == AtsEditor.ChangeReport) {
openChangeReport(resultAtsArts, data.getEnteredIds());
} else {
- WorldEditor.open(new WorldEditorOperationProvider(this));
+ WorldEditor.open(new WorldEditorSimpleProvider(getName(), resultAtsArts));
}
}
}
@@ -244,9 +246,14 @@ public class MultipleIdSearchOperation extends AbstractOperation implements IWor
@Override
public String getName() {
if (Strings.isValid(data.getEnteredIds())) {
- return String.format("%s - [%s]", super.getName(), data.getEnteredIds());
+ return String.format("%s - [%s]", super.getName(),
+ Strings.truncate(data.getEnteredIds(), WorldEditor.TITLE_MAX_LENGTH));
}
return super.getName();
}
+ public void setMultiLine(boolean multiLine) {
+ this.multiLine = multiLine;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java
index 4077c3448f9..cc9457c535b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.ats.world.search;
+import java.util.HashSet;
+import java.util.Set;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
@@ -28,6 +30,7 @@ import org.eclipse.osee.framework.ui.swt.Displays;
public class MultipleIdSearchUi {
private final MultipleIdSearchData data;
+ private boolean multiLine;
public MultipleIdSearchUi(MultipleIdSearchData data) {
this.data = data;
@@ -58,9 +61,13 @@ public class MultipleIdSearchUi {
"Enter Legacy ID, Guid or ID (comma separated)", MessageDialog.QUESTION,
new String[] {"OK", "Cancel"}, 0);
}
+ if (multiLine) {
+ ed.setFillVertically(true);
+ }
int response = ed.open();
if (response == 0) {
- data.setEnteredIds(ed.getEntry());
+ String entry = processEntry(ed.getEntry());
+ data.setEnteredIds(entry);
if (ed instanceof EntryCheckDialog) {
data.setIncludeArtIds(((EntryCheckDialog) ed).isChecked());
if (data.isIncludeArtIds()) {
@@ -85,4 +92,21 @@ public class MultipleIdSearchUi {
}
+ public void setMultiLine(boolean multiLine) {
+ this.multiLine = multiLine;
+ }
+
+ public String processEntry(String entry) {
+ String result = entry;
+ if (multiLine) {
+ Set<String> entries = new HashSet<String>(50);
+ for (String line : entry.split(System.getProperty("line.separator"))) {
+ line = line.replaceFirst("^ +", "");
+ line = line.replaceFirst(" +$", "");
+ entries.add(line);
+ }
+ result = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",", entries);
+ }
+ return result;
+ }
}

Back to the top