Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Aniszczyk2010-05-24 16:09:15 +0000
committerChris Aniszczyk2010-05-24 16:09:15 +0000
commitf8c5aa5fb0f5fbd6d256025ca796df28307eb72f (patch)
tree0ffb0471ffc2b0cce143fa053c6fa0323c5b6341
parentee7102ae080ab23043392ddeee8c307e12e52708 (diff)
downloadegit-f8c5aa5fb0f5fbd6d256025ca796df28307eb72f.tar.gz
egit-f8c5aa5fb0f5fbd6d256025ca796df28307eb72f.tar.xz
egit-f8c5aa5fb0f5fbd6d256025ca796df28307eb72f.zip
Use a FilteredTree in BranchSelectionDialog
To improve the usability of the branch selection dialog, we will add a filtered tree to help users navigate things. Bug: 314132 Change-Id: If1b9e2ab3a69c1d47d212eb089b644b4af269715 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
index 032cc3b707..9a1f8eb067 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>
- * Copyright (C) 2007, Robin Rosenberg <me@lathund.dewire.com.dewire.com>
* Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
+ * Copyright (C) 2010, Chris Aniszczyk <caniszczyk@gmail.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -41,8 +41,8 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefRename;
import org.eclipse.jgit.lib.RefUpdate;
-import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RefUpdate.Result;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -52,10 +52,11 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
/**
* The branch and reset selection dialog
- *
*/
public class BranchSelectionDialog extends Dialog {
@@ -102,12 +103,14 @@ public class BranchSelectionDialog extends Dialog {
parent.setLayout(GridLayoutFactory.swtDefaults().create());
new Label(parent, SWT.NONE).setText(getRefsLabel());
- branchTree = new TreeViewer(parent, SWT.SINGLE | SWT.BORDER);
+ // TODO deprecated constructor for now
+ FilteredTree tree = new FilteredTree(parent, SWT.SINGLE | SWT.BORDER, new PatternFilter());
+ branchTree = tree.getViewer();
new RepositoriesViewLabelProvider(branchTree);
branchTree.setContentProvider(new RepositoriesViewContentProvider());
GridDataFactory.fillDefaults().grab(true, true).hint(500, 300).applyTo(
- branchTree.getTree());
+ tree);
branchTree.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {

Back to the top