diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/FileSystemStructureProvider.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/FileSystemStructureProvider.java index e9c1b14e7a8..1b83475d14a 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/FileSystemStructureProvider.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/FileSystemStructureProvider.java @@ -1,7 +1,7 @@ package org.eclipse.rse.internal.importexport.files; /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2013 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 @@ -9,6 +9,7 @@ package org.eclipse.rse.internal.importexport.files; * * Contributors: * IBM Corporation - initial API and implementation + * David McKnight (IBM) - [417033] [import/export] RSE import wizard won't let user to select new source *******************************************************************************/ import java.io.File; import java.io.FileInputStream; @@ -47,13 +48,15 @@ public class FileSystemStructureProvider implements IImportStructureProvider { String[] children = ((File) element).list(); int childrenLength = children == null ? 0 : children.length; result = new ArrayList(childrenLength); - long start = System.currentTimeMillis(); + //long start = System.currentTimeMillis(); // String p=((UniFilePlus)element).getAbsolutePath()+"/"; //$NON-NLS-1$ // IHost sysC=((UniFilePlus) element).remoteFile.getSystemConnection(); IRemoteFile[] childIRemoteFiles = ((UniFilePlus) element).listIRemoteFiles(); - for (int i = 0; i < childrenLength; i++) - result.add(new UniFilePlus(childIRemoteFiles[i])); - Debug.out("Expanding [" + ((File) element).getPath() + "] took in (ms): " + (System.currentTimeMillis() - start)); //$NON-NLS-1$ //$NON-NLS-2$ + if (childIRemoteFiles != null){ + for (int i = 0; i < childrenLength; i++) + result.add(new UniFilePlus(childIRemoteFiles[i])); + } + //Debug.out("Expanding [" + ((File) element).getPath() + "] took in (ms): " + (System.currentTimeMillis() - start)); //$NON-NLS-1$ //$NON-NLS-2$ } catch (Exception e) { // Probably caused by IFS authority problem // ignore for now diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java index 62ca80cc938..1a2c537175d 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizardPage1.java @@ -19,6 +19,7 @@ * David McKnight (IBM) - [276535] File Conflict when Importing Remote Folder with Case-Differentiated-Only Filenames into Project * David McKnight (IBM) - [191558] [importexport][efs] Import to Project doesn't work with remote EFS projects * David McKnight (IBM) - [368465] Import Files -RSE - Cyclic Symbolic Reference problem + * David McKnight (IBM) - [417033] [import/export] RSE import wizard won't let user to select new source *******************************************************************************/ package org.eclipse.rse.internal.importexport.files; @@ -105,6 +106,7 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.dialogs.SaveAsDialog; import org.eclipse.ui.dialogs.WizardResourceImportPage; import org.eclipse.ui.internal.ide.dialogs.IElementFilter; +import org.eclipse.ui.model.AdaptableList; import org.eclipse.ui.model.WorkbenchContentProvider; /** @@ -165,6 +167,12 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen query(_fileSystemObject, _element, monitor); _isActive = false; + // make sure to update enablement after query + Display.getDefault().syncExec(new Runnable(){ + public void run(){ + updateWidgetEnablements(); + } + }); return Status.OK_STATUS; } @@ -768,6 +776,22 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen if (_fileSystemTree == null){ _fileSystemTree = selectFiles(sourceDirectory, FileSystemStructureProvider.INSTANCE); } + else { + // update _fileSystemTree + Object root = _fileSystemTree.getFileSystemObject(); + if (root == null){ + AdaptableList flds = _fileSystemTree.getFolders(); + if (flds != null){ + Object child = flds.getChildren()[0]; + if (child instanceof MinimizedFileSystemElement){ + Object fsObj = ((MinimizedFileSystemElement)child).getFileSystemObject(); + if (fsObj != sourceDirectory){ + _fileSystemTree = selectFiles(sourceDirectory, FileSystemStructureProvider.INSTANCE); + } + } + } + } + } return _fileSystemTree; } @@ -996,6 +1020,7 @@ class RemoteImportWizardPage1 extends WizardResourceImportPage implements Listen * Repopulate the view based on the currently entered directory. */ protected void resetSelection() { + _queryAllJob = null; // a new one will be created MinimizedFileSystemElement currentRoot = getFileSystemTree(); this.selectionGroup.setRoot(currentRoot); }