threads / patch / 18712

patchSelect and show a newly created branch in the checkout dialog

Subject: [EGIT PATCH] Select and show a newly created branch in the checkout dialog

## tl;dr

One message between Apr 4, 2009 and Apr 4, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Robin Rosenberg· Apr 4, 2009, 11:55 UTC · lore
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../ui/internal/dialogs/BranchSelectionDialog.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Show changes to org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java +7 −1
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java
index cbbc384..1866086 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -150,6 +150,7 @@ private void fillTreeWithBranches(String select) throws IOException {
 		TreeItem curSubItem = null;
 		String curPrefix = null;
 		String curSubPrefix = null;
+		TreeItem itemToSelect = null;
 
 		for (String ref : branches) {
 			String shortName = ref;
@@ -217,7 +218,12 @@ public void widgetDisposed(DisposeEvent e) {
 			}
 			else item.setText(shortName);
 			if (ref.equals(select))
-				branchTree.select(item);
+				itemToSelect = item;
+			branchTree.setLinesVisible(true);
+		}
+		if (itemToSelect != null) {
+			branchTree.select(itemToSelect);
+			branchTree.showItem(itemToSelect);
 		}
 	}
 
-- 
1.6.2.1.345.g89fb

← back to recent threads