Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 400399 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java (+6 lines)
Lines 115-120 public interface IDEInternalPreferences { Link Here
115
    // Always show this import window
115
    // Always show this import window
116
    public static final String IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG = "IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG"; //$NON-NLS-1$
116
    public static final String IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG = "IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG"; //$NON-NLS-1$
117
117
118
    // (string) The previously browsed directory
119
    public static final String IMPORT_FILES_AND_FOLDERS_BROWSED_DIRECTORY = "IMPORT_FILES_AND_FOLDERS_BROWSED_DIRECTORY"; //$NON-NLS-1$
120
121
    // (string) The previously browsed archive
122
    public static final String IMPORT_FILES_AND_FOLDERS_BROWSED_ARCHIVE = "IMPORT_FILES_AND_FOLDERS_BROWSED_ARCHIVE"; //$NON-NLS-1$
123
118
    /**
124
    /**
119
     * Workspace name, will be displayed in the window title.
125
     * Workspace name, will be displayed in the window title.
120
     */
126
     */
(-)a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java (-17 / +16 lines)
Lines 56-61 import org.eclipse.jface.dialogs.IDialogSettings; Link Here
56
import org.eclipse.jface.dialogs.MessageDialog;
56
import org.eclipse.jface.dialogs.MessageDialog;
57
import org.eclipse.jface.layout.PixelConverter;
57
import org.eclipse.jface.layout.PixelConverter;
58
import org.eclipse.jface.operation.IRunnableWithProgress;
58
import org.eclipse.jface.operation.IRunnableWithProgress;
59
import org.eclipse.jface.preference.IPreferenceStore;
59
import org.eclipse.jface.viewers.CheckStateChangedEvent;
60
import org.eclipse.jface.viewers.CheckStateChangedEvent;
60
import org.eclipse.jface.viewers.CheckboxTreeViewer;
61
import org.eclipse.jface.viewers.CheckboxTreeViewer;
61
import org.eclipse.jface.viewers.ICheckStateListener;
62
import org.eclipse.jface.viewers.ICheckStateListener;
Lines 88-93 import org.eclipse.ui.PlatformUI; Link Here
88
import org.eclipse.ui.actions.WorkspaceModifyOperation;
89
import org.eclipse.ui.actions.WorkspaceModifyOperation;
89
import org.eclipse.ui.dialogs.IOverwriteQuery;
90
import org.eclipse.ui.dialogs.IOverwriteQuery;
90
import org.eclipse.ui.dialogs.WorkingSetGroup;
91
import org.eclipse.ui.dialogs.WorkingSetGroup;
92
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
91
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
93
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
92
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
94
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
93
import org.eclipse.ui.internal.ide.StatusUtil;
95
import org.eclipse.ui.internal.ide.StatusUtil;
Lines 311-324 public class WizardProjectsImportPage extends WizardPage implements Link Here
311
313
312
	private ProjectRecord[] selectedProjects = new ProjectRecord[0];
314
	private ProjectRecord[] selectedProjects = new ProjectRecord[0];
313
315
314
	// Keep track of the directory that we browsed to last time
315
	// the wizard was invoked.
316
	private static String previouslyBrowsedDirectory = ""; //$NON-NLS-1$
317
318
	// Keep track of the archive that we browsed to last time
319
	// the wizard was invoked.
320
	private static String previouslyBrowsedArchive = ""; //$NON-NLS-1$
321
322
	private Button projectFromDirectoryRadio;
316
	private Button projectFromDirectoryRadio;
323
317
324
	private Button projectFromArchiveRadio;
318
	private Button projectFromArchiveRadio;
Lines 1202-1207 public class WizardProjectsImportPage extends WizardPage implements Link Here
1202
	 */
1196
	 */
1203
	protected void handleLocationDirectoryButtonPressed() {
1197
	protected void handleLocationDirectoryButtonPressed() {
1204
1198
1199
		IPreferenceStore prefStore = IDEWorkbenchPlugin.getDefault().getPreferenceStore();
1205
		DirectoryDialog dialog = new DirectoryDialog(directoryPathField
1200
		DirectoryDialog dialog = new DirectoryDialog(directoryPathField
1206
				.getShell(), SWT.SHEET);
1201
				.getShell(), SWT.SHEET);
1207
		dialog
1202
		dialog
Lines 1209-1218 public class WizardProjectsImportPage extends WizardPage implements Link Here
1209
1204
1210
		String dirName = directoryPathField.getText().trim();
1205
		String dirName = directoryPathField.getText().trim();
1211
		if (dirName.length() == 0) {
1206
		if (dirName.length() == 0) {
1212
			dirName = previouslyBrowsedDirectory;
1207
			dirName = prefStore.getString(
1208
					IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_BROWSED_DIRECTORY);
1213
		}
1209
		}
1214
1210
1215
		if (dirName.length() == 0) {
1211
		if (dirName == null || dirName.length() == 0) {
1216
			dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace()
1212
			dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace()
1217
					.getRoot().getLocation().toOSString());
1213
					.getRoot().getLocation().toOSString());
1218
		} else {
1214
		} else {
Lines 1224-1231 public class WizardProjectsImportPage extends WizardPage implements Link Here
1224
1220
1225
		String selectedDirectory = dialog.open();
1221
		String selectedDirectory = dialog.open();
1226
		if (selectedDirectory != null) {
1222
		if (selectedDirectory != null) {
1227
			previouslyBrowsedDirectory = selectedDirectory;
1223
			prefStore.setValue(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_BROWSED_DIRECTORY, 
1228
			directoryPathField.setText(previouslyBrowsedDirectory);
1224
					selectedDirectory);
1225
			directoryPathField.setText(selectedDirectory);
1229
			updateProjectsList(selectedDirectory);
1226
			updateProjectsList(selectedDirectory);
1230
		}
1227
		}
1231
1228
Lines 1236-1241 public class WizardProjectsImportPage extends WizardPage implements Link Here
1236
	 */
1233
	 */
1237
	protected void handleLocationArchiveButtonPressed() {
1234
	protected void handleLocationArchiveButtonPressed() {
1238
1235
1236
		IPreferenceStore prefStore = IDEWorkbenchPlugin.getDefault().getPreferenceStore();
1239
		FileDialog dialog = new FileDialog(archivePathField.getShell(), SWT.SHEET);
1237
		FileDialog dialog = new FileDialog(archivePathField.getShell(), SWT.SHEET);
1240
		dialog.setFilterExtensions(FILE_IMPORT_MASK);
1238
		dialog.setFilterExtensions(FILE_IMPORT_MASK);
1241
		dialog
1239
		dialog
Lines 1243-1252 public class WizardProjectsImportPage extends WizardPage implements Link Here
1243
1241
1244
		String fileName = archivePathField.getText().trim();
1242
		String fileName = archivePathField.getText().trim();
1245
		if (fileName.length() == 0) {
1243
		if (fileName.length() == 0) {
1246
			fileName = previouslyBrowsedArchive;
1244
			fileName = prefStore.getString(
1245
					IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_BROWSED_ARCHIVE);
1247
		}
1246
		}
1248
1247
1249
		if (fileName.length() == 0) {
1248
		if (fileName == null || fileName.length() == 0) {
1250
			dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace()
1249
			dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace()
1251
					.getRoot().getLocation().toOSString());
1250
					.getRoot().getLocation().toOSString());
1252
		} else {
1251
		} else {
Lines 1258-1265 public class WizardProjectsImportPage extends WizardPage implements Link Here
1258
1257
1259
		String selectedArchive = dialog.open();
1258
		String selectedArchive = dialog.open();
1260
		if (selectedArchive != null) {
1259
		if (selectedArchive != null) {
1261
			previouslyBrowsedArchive = selectedArchive;
1260
			prefStore.setValue(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_BROWSED_ARCHIVE, 
1262
			archivePathField.setText(previouslyBrowsedArchive);
1261
					selectedArchive);
1262
			archivePathField.setText(selectedArchive);
1263
			updateProjectsList(selectedArchive);
1263
			updateProjectsList(selectedArchive);
1264
		}
1264
		}
1265
1265
1266
- 

Return to bug 400399