Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-09-27 14:11:43 -0400
committerRyan D. Brooks2010-09-27 14:11:43 -0400
commit5c1ccc5db17dd32a6bd062fb28e53eaee69a9181 (patch)
tree0236ea17dc96a1222dc873cb236556433a168c07 /plugins
parent58f9753be106d5ec7948ce33dd53a842081ea90a (diff)
downloadorg.eclipse.osee-5c1ccc5db17dd32a6bd062fb28e53eaee69a9181.tar.gz
org.eclipse.osee-5c1ccc5db17dd32a6bd062fb28e53eaee69a9181.tar.xz
org.eclipse.osee-5c1ccc5db17dd32a6bd062fb28e53eaee69a9181.zip
feature: Support sorting of OSEE change objects and use in change report export
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java38
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java14
2 files changed, 35 insertions, 17 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
index 62522a6719..4c157cd2c6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
@@ -141,21 +141,8 @@ public class ExportChangeReportsAction extends Action {
RenderingUtil.setPopupsAllowed(false);
for (Artifact workflow : workflows) {
- AtsBranchManager atsBranchMgr = ((TeamWorkFlowArtifact) workflow).getBranchMgr();
- Collection<Change> changes = new ArrayList<Change>();
- IOperation operation = null;
- if (atsBranchMgr.isCommittedBranchExists()) {
- operation = ChangeManager.comparedToPreviousTx(pickTransaction(workflow), changes);
- } else {
- Branch workingBranch = atsBranchMgr.getWorkingBranch();
- if (workingBranch != null && !workingBranch.getBranchType().isBaselineBranch()) {
- operation = ChangeManager.comparedToParent(workingBranch, changes);
- }
- }
- if (operation != null) {
- doSubWork(operation, monitor, 0.50);
- }
+ Collection<Change> changes = computeChanges(workflow, monitor);
if (!changes.isEmpty() && changes.size() < 4000) {
String folderName = workflow.getSoleAttributeValueAsString(AtsAttributeTypes.LegacyPcrId, null);
IOperation subOp = new WordChangeReportOperation(changes, folderName);
@@ -166,5 +153,26 @@ public class ExportChangeReportsAction extends Action {
}
RenderingUtil.setPopupsAllowed(true);
}
+
+ private Collection<Change> computeChanges(Artifact workflow, IProgressMonitor monitor) throws OseeCoreException {
+ AtsBranchManager atsBranchMgr = ((TeamWorkFlowArtifact) workflow).getBranchMgr();
+
+ List<Change> changes = new ArrayList<Change>();
+ IOperation operation = null;
+ if (atsBranchMgr.isCommittedBranchExists()) {
+ operation = ChangeManager.comparedToPreviousTx(pickTransaction(workflow), changes);
+ } else {
+ Branch workingBranch = atsBranchMgr.getWorkingBranch();
+ if (workingBranch != null && !workingBranch.getBranchType().isBaselineBranch()) {
+ operation = ChangeManager.comparedToParent(workingBranch, changes);
+ }
+ }
+ if (operation != null) {
+ doSubWork(operation, monitor, 0.50);
+
+ Collections.sort(changes);
+ }
+ return changes;
+ }
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
index eb86a85a99..c4b1d6940f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
@@ -22,7 +22,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
* @author Jeff C. Phillips
*/
-public abstract class Change implements IAdaptable {
+public abstract class Change implements IAdaptable, Comparable<Change> {
private final long sourceGamma;
private final int artId;
private final TransactionDelta txDelta;
@@ -149,4 +149,14 @@ public abstract class Change implements IAdaptable {
}
return null;
}
-}
+
+ @Override
+ public String toString() {
+ return getName();
+ }
+
+ @Override
+ public int compareTo(Change o) {
+ return getName().compareTo(o.getName());
+ }
+} \ No newline at end of file

Back to the top