Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 163387 Details for
Bug 301168
Create a Git Browser and Git Explorer Perspective
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Search dialog additions
0001-Fixed-not-fully-recursive-local-repository-scan.patch (text/plain), 9.28 KB, created by
Wim Jongman
on 2010-03-30 05:29:03 EDT
(
hide
)
Description:
Search dialog additions
Filename:
MIME Type:
Creator:
Wim Jongman
Created:
2010-03-30 05:29:03 EDT
Size:
9.28 KB
patch
obsolete
>From a332286512749ee7e8a86cf233a673d39f8634d5 Mon Sep 17 00:00:00 2001 >From: Wim Jongman <wim.jongman@gmail.com> >Date: Tue, 30 Mar 2010 09:19:19 +0200 >Subject: [PATCH] Fixed not fully recursive local repository scan. > >The current implementation will return from the repos search >if one repos was found in a child directory of the current >directory under investigation. > >Made progress indication more meaningful >Made searchdialog nicer to look at. >Added tableitem selection toggle >Added deepscan for nested repositories toggle > >Signed-off-by: Wim Jongman <wim.jongman@gmail.com> >--- > .../ui/internal/repository/RepositoriesView.java | 17 ++-- > .../repository/RepositorySearchDialog.java | 103 +++++++++++++++----- > 2 files changed, 87 insertions(+), 33 deletions(-) > >diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java >index 25a9b94..d7d06d9 100644 >--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java >+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java >@@ -1424,7 +1424,7 @@ private void updateDirStrings(IProgressMonitor monitor) { > IPath path = ResourcesPlugin.getWorkspace().getRoot().getLocation(); > File root = path.toFile(); > TreeSet<String> dirStrings = new TreeSet<String>(); >- recurseDir(root, dirStrings, monitor); >+ recurseDir(root, dirStrings, monitor, true); > saveDirStrings(dirStrings); > scheduleRefresh(); > >@@ -1454,9 +1454,10 @@ private void saveDirStrings(Set<String> gitDirStrings) { > * @param root > * @param strings > * @param monitor >+ * @param lookForNestedRepositories > */ > public static void recurseDir(File root, TreeSet<String> strings, >- IProgressMonitor monitor) { >+ IProgressMonitor monitor, boolean lookForNestedRepositories) { > > if (!root.exists() || !root.isDirectory()) { > return; >@@ -1470,11 +1471,13 @@ public static void recurseDir(File root, TreeSet<String> strings, > if (child.exists() && child.isDirectory() > && RepositoryCache.FileKey.isGitRepository(child)) { > strings.add(child.getAbsolutePath()); >- return; >- } >- if (child.isDirectory()) { >- monitor.setTaskName(child.getPath()); >- recurseDir(child, strings, monitor); >+ monitor.setTaskName(strings.size() >+ + " GIT repositories found..."); >+ if (!lookForNestedRepositories) >+ return; >+ } else if (child.isDirectory()) { >+ monitor.subTask(child.getPath()); >+ recurseDir(child, strings, monitor, lookForNestedRepositories); > } > } > >diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java >index 2b18e53..6f18bbf 100644 >--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java >+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java >@@ -22,7 +22,6 @@ > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.dialogs.ProgressMonitorDialog; >-import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.operation.IRunnableWithProgress; > import org.eclipse.jface.viewers.BaseLabelProvider; > import org.eclipse.jface.viewers.CheckStateChangedEvent; >@@ -37,6 +36,7 @@ > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.graphics.Image; >+import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; >@@ -61,6 +61,10 @@ > > CheckboxTableViewer tv; > >+ private Button btnToggleSelect; >+ >+ private Table tab; >+ > private final class ContentProvider implements IStructuredContentProvider { > > @SuppressWarnings("unchecked") >@@ -143,21 +147,29 @@ protected void okPressed() { > @Override > protected Control createDialogArea(Composite parent) { > >+ parent.setLayout(new GridLayout()); >+ > Composite main = new Composite(parent, SWT.NONE); >- main.setLayout(new GridLayout(3, false)); >+ main.setLayout(new GridLayout(4, false)); >+ main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > >- GridDataFactory.fillDefaults().grab(true, true).applyTo(main); >+ // GridDataFactory.fillDefaults().grab(true, true).applyTo(main); > > Label dirLabel = new Label(main, SWT.NONE); > dirLabel.setText("Directory"); >- final Text dir = new Text(main, SWT.NONE); >+ final Text dir = new Text(main, SWT.BORDER); >+ dir >+ .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, >+ 2, 1)); > if (myInitialPath != null) > dir.setText(myInitialPath); > >- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, >- false).applyTo(dir); >+ // GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, >+ // false).applyTo(dir); > > Button browse = new Button(main, SWT.PUSH); >+ browse.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, >+ 1, 1)); > browse.setText("Browse..."); > browse.addSelectionListener(new SelectionAdapter() { > >@@ -172,28 +184,18 @@ public void widgetSelected(SelectionEvent e) { > } > > }); >+ new Label(main, SWT.NONE); >+ >+ final Button btnLookForNested = new Button(main, SWT.CHECK); >+ btnLookForNested.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); >+ btnLookForNested.setText("Look for Nested Repositories."); > > Button search = new Button(main, SWT.PUSH); >+ search.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, >+ 1, 1)); > search.setText("Search"); >- GridDataFactory.fillDefaults().align(SWT.LEAD, SWT.CENTER).span(3, 1) >- .applyTo(search); >- >- tv = CheckboxTableViewer.newCheckList(main, SWT.NONE); >- Table tab = tv.getTable(); >- GridDataFactory.fillDefaults().grab(true, true).span(3, 1).applyTo(tab); >- >- tv.addCheckStateListener(new ICheckStateListener() { >- >- public void checkStateChanged(CheckStateChangedEvent event) { >- if (existingRepositoryDirs.contains(event.getElement())) >- event.getCheckable().setChecked(event.getElement(), false); >- getButton(IDialogConstants.OK_ID).setEnabled( >- tv.getCheckedElements().length > 0); >- } >- }); >- >- tv.setContentProvider(new ContentProvider()); >- tv.setLabelProvider(new LabelProvider()); >+ // GridDataFactory.fillDefaults().align(SWT.LEAD, SWT.CENTER).span(1, 1) >+ // .applyTo(search); > > search.addSelectionListener(new SelectionAdapter() { > >@@ -201,6 +203,7 @@ public void checkStateChanged(CheckStateChangedEvent event) { > public void widgetSelected(SelectionEvent e) { > final TreeSet<String> directories = new TreeSet<String>(); > final File file = new File(dir.getText()); >+ final boolean lookForNested = btnLookForNested.getSelection(); > if (file.exists()) { > IRunnableWithProgress action = new IRunnableWithProgress() { > >@@ -208,12 +211,14 @@ public void run(IProgressMonitor monitor) > throws InvocationTargetException, > InterruptedException { > RepositoriesView.recurseDir(file, directories, >- monitor); >+ monitor, lookForNested); > } > }; > try { > ProgressMonitorDialog pd = new ProgressMonitorDialog( > getShell()); >+ pd.getProgressMonitor().setTaskName( >+ "Scanning for GIT repositories..."); > pd.run(true, true, action); > > } catch (InvocationTargetException e1) { >@@ -223,12 +228,58 @@ public void run(IProgressMonitor monitor) > // ignore > } > >+ btnToggleSelect.setEnabled(directories.size() > 0); >+ tab.setEnabled(directories.size() > 0); > tv.setInput(directories); > } > } > > }); > >+ tv = CheckboxTableViewer.newCheckList(main, SWT.BORDER); >+ tab = tv.getTable(); >+ tab.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); >+ tab.setEnabled(false); >+ // GridDataFactory.fillDefaults().grab(true, true).span(3, >+ // 1).applyTo(tab); >+ >+ btnToggleSelect = new Button(main, SWT.NONE); >+ btnToggleSelect.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, >+ false, 1, 1)); >+ btnToggleSelect.setText("Toggle Select"); >+ btnToggleSelect.setEnabled(false); >+ btnToggleSelect.addSelectionListener(new SelectionAdapter() { >+ >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ boolean checkedState = tv.getCheckedElements().length == 0; >+ if (checkedState == false) { >+ tv.setAllChecked(checkedState); >+ } else >+ for (int i = 0; i < tab.getItemCount(); i++) { >+ if (!existingRepositoryDirs >+ .contains(tv.getElementAt(i))) >+ tv.setChecked(tv.getElementAt(i), checkedState); >+ } >+ getButton(IDialogConstants.OK_ID).setEnabled(checkedState); >+ } >+ }); >+ // GridDataFactory.fillDefaults().align(SWT.LEAD, SWT.CENTER).span(2, 1) >+ // .applyTo(btnToggleSelect); >+ >+ tv.addCheckStateListener(new ICheckStateListener() { >+ >+ public void checkStateChanged(CheckStateChangedEvent event) { >+ if (existingRepositoryDirs.contains(event.getElement())) >+ event.getCheckable().setChecked(event.getElement(), false); >+ getButton(IDialogConstants.OK_ID).setEnabled( >+ tv.getCheckedElements().length > 0); >+ } >+ }); >+ >+ tv.setContentProvider(new ContentProvider()); >+ tv.setLabelProvider(new LabelProvider()); >+ > return main; > } > >-- >1.6.5.1.msysgit.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 301168
:
157562
|
157563
|
163047
|
163116
|
163298
| 163387