Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-03-16 23:06:13 +0000
committerddunne2010-03-16 23:06:13 +0000
commitf5cef1095123101ea5a69bb8f31deebeed1b80ce (patch)
treed81c0a89e3807d9ba5aa145a38d1d2f964d6b9ac
parent397457c96ff760576b7e812bee6b26d10d311376 (diff)
downloadorg.eclipse.osee-f5cef1095123101ea5a69bb8f31deebeed1b80ce.tar.gz
org.eclipse.osee-f5cef1095123101ea5a69bb8f31deebeed1b80ce.tar.xz
org.eclipse.osee-f5cef1095123101ea5a69bb8f31deebeed1b80ce.zip
optimize getNormalBranches
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/XWidgetFactory.java2
4 files changed, 8 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
index 1378836c7a7..f1a2d885080 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
@@ -108,8 +108,11 @@ public class BranchManager {
* @throws OseeCoreException
*/
public static List<Branch> getNormalBranches() throws OseeCoreException {
- List<Branch> branches =
- getBranches(BranchArchivedState.UNARCHIVED, BranchControlled.ALL, BranchType.WORKING, BranchType.BASELINE);
+ return getBranches(BranchArchivedState.UNARCHIVED, BranchControlled.ALL, BranchType.WORKING, BranchType.BASELINE);
+ }
+
+ public static List<Branch> getNormalBranchesSorted() throws OseeCoreException {
+ List<Branch> branches = getNormalBranches();
Collections.sort(branches);
return branches;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java
index 66f37885214..4bc34e55473 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java
@@ -55,7 +55,7 @@ public class BranchCheckTreeDialog extends MinMaxOSEECheckedFilteredTreeDialog {
protected Control createDialogArea(Composite container) {
Control comp = super.createDialogArea(container);
try {
- getTreeViewer().getViewer().setInput(BranchManager.getNormalBranches());
+ getTreeViewer().getViewer().setInput(BranchManager.getNormalBranchesSorted());
if (getInitialBranches() != null) getTreeViewer().setInitalChecked(getInitialBranches());
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java
index 3f9b46c913a..289a142cc0e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java
@@ -46,7 +46,7 @@ public class CommitIntoHandler extends CommitHandler {
Branch sourceBranch = Handlers.getBranchesFromStructuredSelection(selection).iterator().next();
try {
- List<Branch> branches = BranchManager.getNormalBranches();
+ List<Branch> branches = BranchManager.getNormalBranchesSorted();
branches.remove(sourceBranch);
BranchSelectionDialog branchSelection =
new BranchSelectionDialog(
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/XWidgetFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/XWidgetFactory.java
index f1e65639bf2..7d062eff45d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/XWidgetFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/XWidgetFactory.java
@@ -105,7 +105,7 @@ public class XWidgetFactory {
maxSelectionRequired = Integer.MAX_VALUE;
}
try {
- multiBranchSelect.setSelectableItems(BranchManager.getNormalAllBranches());
+ multiBranchSelect.setSelectableItems(BranchManager.getNormalAllBranchesSorted());
multiBranchSelect.setRequiredSelection(1, maxSelectionRequired);
} catch (OseeCoreException ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);

Back to the top