From f5cef1095123101ea5a69bb8f31deebeed1b80ce Mon Sep 17 00:00:00 2001 From: ddunne Date: Tue, 16 Mar 2010 23:06:13 +0000 Subject: optimize getNormalBranches --- .../eclipse/osee/framework/skynet/core/artifact/BranchManager.java | 7 +++++-- .../osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java | 2 +- .../ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java | 2 +- .../osee/framework/ui/skynet/widgets/workflow/XWidgetFactory.java | 2 +- 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 getNormalBranches() throws OseeCoreException { - List branches = - getBranches(BranchArchivedState.UNARCHIVED, BranchControlled.ALL, BranchType.WORKING, BranchType.BASELINE); + return getBranches(BranchArchivedState.UNARCHIVED, BranchControlled.ALL, BranchType.WORKING, BranchType.BASELINE); + } + + public static List getNormalBranchesSorted() throws OseeCoreException { + List 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 branches = BranchManager.getNormalBranches(); + List 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); -- cgit v1.2.3