summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMatt Hurne2012-05-15 15:23:31 (EDT)
committer John Arthorne2012-07-04 15:55:54 (EDT)
commit2e5c525b33b6b9514af5b4c198b663b0c65724a1 (patch)
tree2423356dcd963210f76f5037442cc52d2cd48cf9
parentf8aca91a06f4b5b74a26254413b475a4b314e022 (diff)
downloadeclipse.platform.ui-2e5c525b33b6b9514af5b4c198b663b0c65724a1.zip
eclipse.platform.ui-2e5c525b33b6b9514af5b4c198b663b0c65724a1.tar.gz
eclipse.platform.ui-2e5c525b33b6b9514af5b4c198b663b0c65724a1.tar.bz2
Bug 144610 - [Import/Export] Import existing projects does not search subdirectories of found projects
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/DataTransferMessages.java3
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java56
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/messages.properties1
3 files changed, 53 insertions, 7 deletions
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/DataTransferMessages.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/DataTransferMessages.java
index aa05a19..c2aa5e4 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/DataTransferMessages.java
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/DataTransferMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2010, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -97,6 +97,7 @@ public class DataTransferMessages extends NLS {
public static String WizardProjectsImportPage_ArchiveSelectTitle;
public static String WizardProjectsImportPage_SelectArchiveDialogTitle;
public static String WizardProjectsImportPage_CreateProjectsTask;
+ public static String WizardProjectsImportPage_SearchForNestedProjects;
public static String WizardProjectsImportPage_CopyProjectsIntoWorkspace;
public static String WizardProjectsImportPage_projectsInWorkspace;
public static String WizardProjectsImportPage_noProjectsToImport;
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java
index 77f861e..f493c01 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2009, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,8 @@
* - Bug 187318[Wizards] "Import Existing Project" loops forever with cyclic symbolic links
* Remy Chi Jian Suen (remy.suen@gmail.com)
* - Bug 210568 [Import/Export] [Import/Export] - Refresh button does not update list of projects
+ * Matt Hurne (matt@thehurnes.com)
+ * - Bug 144610 [Import/Export] Import existing projects does not search subdirectories of found projects
*******************************************************************************/
package org.eclipse.ui.internal.wizards.datatransfer;
@@ -285,6 +287,8 @@ public class WizardProjectsImportPage extends WizardPage implements
}
// dialog store id constants
+ private final static String STORE_NESTED_PROJECTS = "WizardProjectsImportPage.STORE_NESTED_PROJECTS"; //$NON-NLS-1$
+
private final static String STORE_COPY_PROJECT_ID = "WizardProjectsImportPage.STORE_COPY_PROJECT_ID"; //$NON-NLS-1$
private final static String STORE_ARCHIVE_SELECTED = "WizardProjectsImportPage.STORE_ARCHIVE_SELECTED"; //$NON-NLS-1$
@@ -293,6 +297,12 @@ public class WizardProjectsImportPage extends WizardPage implements
private CheckboxTreeViewer projectsList;
+ private Button nestedProjectsCheckbox;
+
+ private boolean nestedProjects = false;
+
+ private boolean lastNestedProjects = false;
+
private Button copyCheckbox;
private boolean copyFiles = false;
@@ -419,6 +429,21 @@ public class WizardProjectsImportPage extends WizardPage implements
optionsGroup.setLayout(new GridLayout());
optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ nestedProjectsCheckbox = new Button(optionsGroup, SWT.CHECK);
+ nestedProjectsCheckbox
+ .setText(DataTransferMessages.WizardProjectsImportPage_SearchForNestedProjects);
+ nestedProjectsCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ nestedProjectsCheckbox.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ nestedProjects = nestedProjectsCheckbox.getSelection();
+ if (projectFromDirectoryRadio.getSelection()) {
+ updateProjectsList(directoryPathField.getText().trim());
+ } else {
+ updateProjectsList(archivePathField.getText().trim());
+ }
+ }
+ });
+
copyCheckbox = new Button(optionsGroup, SWT.CHECK);
copyCheckbox
.setText(DataTransferMessages.WizardProjectsImportPage_CopyProjectsIntoWorkspace);
@@ -800,6 +825,8 @@ public class WizardProjectsImportPage extends WizardPage implements
browseArchivesButton.setEnabled(true);
updateProjectsList(archivePathField.getText());
archivePathField.setFocus();
+ nestedProjectsCheckbox.setSelection(true);
+ nestedProjectsCheckbox.setEnabled(false);
copyCheckbox.setSelection(true);
copyCheckbox.setEnabled(false);
}
@@ -813,6 +840,8 @@ public class WizardProjectsImportPage extends WizardPage implements
browseArchivesButton.setEnabled(false);
updateProjectsList(directoryPathField.getText());
directoryPathField.setFocus();
+ nestedProjectsCheckbox.setEnabled(true);
+ nestedProjectsCheckbox.setSelection(nestedProjects);
copyCheckbox.setEnabled(true);
copyCheckbox.setSelection(copyFiles);
}
@@ -852,7 +881,11 @@ public class WizardProjectsImportPage extends WizardPage implements
final File directory = new File(path);
long modified = directory.lastModified();
- if (path.equals(lastPath) && lastModified == modified && lastCopyFiles == copyFiles) {
+ if (path.equals(lastPath)
+ && lastModified == modified
+ && lastNestedProjects == nestedProjects
+ && lastCopyFiles == copyFiles)
+ {
// since the file/folder was not modified and the path did not
// change, no refreshing is required
return;
@@ -860,6 +893,7 @@ public class WizardProjectsImportPage extends WizardPage implements
lastPath = path;
lastModified = modified;
+ lastNestedProjects = nestedProjects;
lastCopyFiles = copyFiles;
// We can't access the radio button from the inner class so get the
@@ -1095,12 +1129,15 @@ public class WizardProjectsImportPage extends WizardPage implements
File file = contents[i];
if (file.isFile() && file.getName().equals(dotProject)) {
files.add(file);
- // don't search sub-directories since we can't have nested
- // projects
- return true;
+ if (!nestedProjects) {
+ // don't search sub-directories since we can't have nested
+ // projects
+ return true;
+ }
}
}
- // no project description found, so recurse into sub-directories
+ // no project description found or search for nested projects enabled,
+ // so recurse into sub-directories
for (int i = 0; i < contents.length; i++) {
if (contents[i].isDirectory()) {
if (!contents[i].getName().equals(METADATA_FOLDER)) {
@@ -1564,6 +1601,11 @@ public class WizardProjectsImportPage extends WizardPage implements
IDialogSettings settings = getDialogSettings();
if (settings != null) {
// checkbox
+ nestedProjects = settings.getBoolean(STORE_NESTED_PROJECTS);
+ nestedProjectsCheckbox.setSelection(nestedProjects);
+ lastNestedProjects = nestedProjects;
+
+ // checkbox
copyFiles = settings.getBoolean(STORE_COPY_PROJECT_ID);
copyCheckbox.setSelection(copyFiles);
lastCopyFiles = copyFiles;
@@ -1617,6 +1659,8 @@ public class WizardProjectsImportPage extends WizardPage implements
public void saveWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
+ settings.put(STORE_NESTED_PROJECTS, nestedProjectsCheckbox.getSelection());
+
settings.put(STORE_COPY_PROJECT_ID, copyCheckbox.getSelection());
settings.put(STORE_ARCHIVE_SELECTED, projectFromArchiveRadio
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/messages.properties b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/messages.properties
index db0ad31..fc21c93 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/messages.properties
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/messages.properties
@@ -99,6 +99,7 @@ WizardProjectsImportPage_noProjectsToImport=No projects are found to import
WizardProjectsImportPage_CreateProjectsTask=Creating Projects
WizardProjectsImportPage_ImportProjectsDescription=Select a directory to search for existing Eclipse projects.
WizardProjectsImportPage_CheckingMessage= Checking: {0}
+WizardProjectsImportPage_SearchForNestedProjects=Search for nested projects
WizardProjectsImportPage_CopyProjectsIntoWorkspace=&Copy projects into workspace
# The first parameter is the project folder name and the second is the name from the project description
WizardProjectsImportPage_projectLabel={0} ({1})