Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java239
1 files changed, 119 insertions, 120 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
index 3f708d1ecd9..f4a52ea6e4e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
@@ -47,134 +47,133 @@ import org.eclipse.osee.framework.ui.swt.Displays;
*/
public class ArtifactImpactToActionSearchItem extends XNavigateItemAction {
- private static String TITLE = "Search Artifact Impact to Action";
+ private static String TITLE = "Search Artifact Impact to Action";
- /**
- * @param parent
- */
- public ArtifactImpactToActionSearchItem(XNavigateItem parent) {
- super(parent, TITLE, FrameworkImage.FLASHLIGHT);
- }
+ /**
+ * @param parent
+ */
+ public ArtifactImpactToActionSearchItem(XNavigateItem parent) {
+ super(parent, TITLE, FrameworkImage.FLASHLIGHT);
+ }
- @Override
- public void run(TableLoadOption... tableLoadOptions) {
- EntryDialogWithBranchSelect ed =
- new EntryDialogWithBranchSelect(getName(), "Enter Artifact Name (or string) to search (no wildcards)");
- if (ed.open() == 0) {
- ActionToArtifactImpactJob job = new ActionToArtifactImpactJob(ed.getEntry(), ed.getBranch());
- job.setUser(true);
- job.setPriority(Job.LONG);
- job.schedule();
- }
- }
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ EntryDialogWithBranchSelect ed =
+ new EntryDialogWithBranchSelect(getName(), "Enter Artifact Name (or string) to search (no wildcards)");
+ if (ed.open() == 0) {
+ ActionToArtifactImpactJob job = new ActionToArtifactImpactJob(ed.getEntry(), ed.getBranch());
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ }
- public static class ActionToArtifactImpactJob extends Job {
- private IProgressMonitor monitor;
- private final String artifactName;
- private final XResultData rd = new XResultData();
- private final Branch branch;
+ public static class ActionToArtifactImpactJob extends Job {
+ private IProgressMonitor monitor;
+ private final String artifactName;
+ private final XResultData rd = new XResultData();
+ private final Branch branch;
- public ActionToArtifactImpactJob(String artifactName, Branch branch) {
- super("Searching \"" + artifactName + "\"...");
- this.artifactName = artifactName;
- this.branch = branch;
- }
+ public ActionToArtifactImpactJob(String artifactName, Branch branch) {
+ super("Searching \"" + artifactName + "\"...");
+ this.artifactName = artifactName;
+ this.branch = branch;
+ }
- @Override
- public IStatus run(IProgressMonitor monitor) {
- this.monitor = monitor;
- try {
- getMatrixItems();
- rd.report(TITLE + " - \"" + artifactName + "\"");
- return Status.OK_STATUS;
- } catch (Exception ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
- }
- }
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ this.monitor = monitor;
+ try {
+ getMatrixItems();
+ rd.report(TITLE + " - \"" + artifactName + "\"");
+ return Status.OK_STATUS;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(IStatus.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ }
- private void getMatrixItems() throws OseeCoreException {
- final Collection<Artifact> srchArts =
- ArtifactQuery.getArtifactListFromName("%" + artifactName + "%", branch, INCLUDE_DELETED);
- final Set<Artifact> processArts = new HashSet<Artifact>();
- if (srchArts.isEmpty()) {
- return;
- }
- if (srchArts.size() > 1) {
- Displays.pendInDisplayThread(new Runnable() {
- @Override
- public void run() {
- ArtifactCheckTreeDialog dialog = new ArtifactCheckTreeDialog(srchArts);
- dialog.setTitle(TITLE);
- dialog.setMessage("Select Artifacts to Search");
- if (dialog.open() == 0) {
- processArts.addAll(dialog.getSelection());
- }
- }
- });
+ private void getMatrixItems() throws OseeCoreException {
+ final Collection<Artifact> srchArts =
+ ArtifactQuery.getArtifactListFromName("%" + artifactName + "%", branch, INCLUDE_DELETED);
+ final Set<Artifact> processArts = new HashSet<Artifact>();
+ if (srchArts.isEmpty()) {
+ return;
+ }
+ if (srchArts.size() > 1) {
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ ArtifactCheckTreeDialog dialog = new ArtifactCheckTreeDialog(srchArts);
+ dialog.setTitle(TITLE);
+ dialog.setMessage("Select Artifacts to Search");
+ if (dialog.open() == 0) {
+ processArts.addAll(dialog.getSelection());
+ }
+ }
+ });
- } else {
- processArts.addAll(srchArts);
- }
- int x = 1;
- rd.log("Artifact Impact to Action for artifact(s) on branch \"" + branch.getShortName() + "\"");
+ } else {
+ processArts.addAll(srchArts);
+ }
+ int x = 1;
+ rd.log("Artifact Impact to Action for artifact(s) on branch \"" + branch.getShortName() + "\"");
- HashCollection<Artifact, TransactionRecord> transactionMap =
- ChangeManager.getModifingTransactions(processArts);
- HashCollection<Artifact, Branch> branchMap = ChangeManager.getModifingBranches(processArts);
- for (Artifact srchArt : processArts) {
- String str = String.format("Processing %d/%d - %s ", x++, processArts.size(), srchArt.getName());
- System.out.println(str);
- rd.log("\n" + AHTML.bold(srchArt.getName()));
- monitor.subTask(str);
- int y = 1;
- rd.addRaw(AHTML.beginMultiColumnTable(95, 1));
- rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Status", "HRID", "Title"}));
+ HashCollection<Artifact, TransactionRecord> transactionMap =
+ ChangeManager.getModifingTransactions(processArts);
+ HashCollection<Artifact, Branch> branchMap = ChangeManager.getModifingBranches(processArts);
+ for (Artifact srchArt : processArts) {
+ String str = String.format("Processing %d/%d - %s ", x++, processArts.size(), srchArt.getName());
+ System.out.println(str);
+ rd.log("\n" + AHTML.bold(srchArt.getName()));
+ monitor.subTask(str);
+ int y = 1;
+ rd.addRaw(AHTML.beginMultiColumnTable(95, 1));
+ rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Status", "HRID", "Title"}));
- // Check for changes on working branches
- boolean workingBranchesFound = false;
+ // Check for changes on working branches
+ boolean workingBranchesFound = false;
- Collection<Branch> branches = branchMap.getValues(srchArt);
- if (branches != null) {
- for (Branch branch : branches) {
- Artifact assocArt = BranchManager.getAssociatedArtifact(branch);
- if (assocArt != null && !assocArt.equals(UserManager.getUser(SystemUser.OseeSystem))) {
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(), "Working",
- XResultData.getHyperlink(assocArt), assocArt.getName()}));
- } else {
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Branch", "", branch.getName()}));
- }
- workingBranchesFound = true;
- }
- }
- if (!workingBranchesFound) {
- rd.addRaw(AHTML.addRowSpanMultiColumnTable("No Impacting Working Branches Found", 3));
- }
- // Add committed changes
- boolean committedChanges = false;
- Collection<TransactionRecord> transactions = transactionMap.getValues(srchArt);
- if (transactions != null) {
- for (TransactionRecord transactionId : transactions) {
- String transStr = String.format("Tranaction %d/%d", y++, transactions.size());
- System.out.println(transStr);
- monitor.subTask(transStr);
- if (transactionId.getCommit() > 0) {
- Artifact assocArt =
- ArtifactQuery.getArtifactFromId(transactionId.getCommit(),
- BranchManager.getCommonBranch());
- if (assocArt instanceof TeamWorkFlowArtifact) {
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(),
- "Committed", assocArt.getHumanReadableId(), assocArt.getName()}));
- committedChanges = true;
- }
- }
- }
- }
- if (!committedChanges) {
- rd.addRaw(AHTML.addRowSpanMultiColumnTable("No Impacting Actions Found", 3));
- }
- rd.addRaw(AHTML.endMultiColumnTable());
- }
- }
- }
+ Collection<Branch> branches = branchMap.getValues(srchArt);
+ if (branches != null) {
+ for (Branch branch : branches) {
+ Artifact assocArt = BranchManager.getAssociatedArtifact(branch);
+ if (assocArt != null && !assocArt.equals(UserManager.getUser(SystemUser.OseeSystem))) {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(), "Working",
+ XResultData.getHyperlink(assocArt), assocArt.getName()}));
+ } else {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Branch", "", branch.getName()}));
+ }
+ workingBranchesFound = true;
+ }
+ }
+ if (!workingBranchesFound) {
+ rd.addRaw(AHTML.addRowSpanMultiColumnTable("No Impacting Working Branches Found", 3));
+ }
+ // Add committed changes
+ boolean committedChanges = false;
+ Collection<TransactionRecord> transactions = transactionMap.getValues(srchArt);
+ if (transactions != null) {
+ for (TransactionRecord transactionId : transactions) {
+ String transStr = String.format("Tranaction %d/%d", y++, transactions.size());
+ System.out.println(transStr);
+ monitor.subTask(transStr);
+ if (transactionId.getCommit() > 0) {
+ Artifact assocArt =
+ ArtifactQuery.getArtifactFromId(transactionId.getCommit(), BranchManager.getCommonBranch());
+ if (assocArt instanceof TeamWorkFlowArtifact) {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(),
+ "Committed", assocArt.getHumanReadableId(), assocArt.getName()}));
+ committedChanges = true;
+ }
+ }
+ }
+ }
+ if (!committedChanges) {
+ rd.addRaw(AHTML.addRowSpanMultiColumnTable("No Impacting Actions Found", 3));
+ }
+ rd.addRaw(AHTML.endMultiColumnTable());
+ }
+ }
+ }
}

Back to the top