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 330553
Collapse All | Expand All

(-)src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java (-2 / +21 lines)
Lines 296-301 Link Here
296
	private Button copyCheckbox;
296
	private Button copyCheckbox;
297
297
298
	private boolean copyFiles = false;
298
	private boolean copyFiles = false;
299
	
300
	private boolean lastCopyFiles = false;
299
301
300
	private ProjectRecord[] selectedProjects = new ProjectRecord[0];
302
	private ProjectRecord[] selectedProjects = new ProjectRecord[0];
301
303
Lines 424-429 Link Here
424
		copyCheckbox.addSelectionListener(new SelectionAdapter() {
426
		copyCheckbox.addSelectionListener(new SelectionAdapter() {
425
			public void widgetSelected(SelectionEvent e) {
427
			public void widgetSelected(SelectionEvent e) {
426
				copyFiles = copyCheckbox.getSelection();
428
				copyFiles = copyCheckbox.getSelection();
429
				updateProjectsList(directoryPathField.getText().trim());
427
			}
430
			}
428
		});
431
		});
429
	}
432
	}
Lines 850-856 Link Here
850
853
851
		final File directory = new File(path);
854
		final File directory = new File(path);
852
		long modified = directory.lastModified();
855
		long modified = directory.lastModified();
853
		if (path.equals(lastPath) && lastModified == modified) {
856
		if (path.equals(lastPath) && lastModified == modified && lastCopyFiles == copyFiles) {
854
			// since the file/folder was not modified and the path did not
857
			// since the file/folder was not modified and the path did not
855
			// change, no refreshing is required
858
			// change, no refreshing is required
856
			return;
859
			return;
Lines 858-863 Link Here
858
861
859
		lastPath = path;
862
		lastPath = path;
860
		lastModified = modified;
863
		lastModified = modified;
864
		lastCopyFiles = copyFiles;
861
865
862
		// We can't access the radio button from the inner class so get the
866
		// We can't access the radio button from the inner class so get the
863
		// status beforehand
867
		// status beforehand
Lines 1503-1509 Link Here
1503
	public ProjectRecord[] getProjectRecords() {
1507
	public ProjectRecord[] getProjectRecords() {
1504
		List projectRecords = new ArrayList();
1508
		List projectRecords = new ArrayList();
1505
		for (int i = 0; i < selectedProjects.length; i++) {
1509
		for (int i = 0; i < selectedProjects.length; i++) {
1506
			if (isProjectInWorkspace(selectedProjects[i].getProjectName())) {
1510
			if ( (isProjectInWorkspacePath(selectedProjects[i].getProjectName()) && copyFiles)||
1511
					isProjectInWorkspace(selectedProjects[i].getProjectName())) {
1507
				selectedProjects[i].hasConflicts = true;
1512
				selectedProjects[i].hasConflicts = true;
1508
			}
1513
			}
1509
			projectRecords.add(selectedProjects[i]);
1514
			projectRecords.add(selectedProjects[i]);
Lines 1513-1518 Link Here
1513
	}
1518
	}
1514
1519
1515
	/**
1520
	/**
1521
	 * Determine if there is a directory with the project name in the workspace path.
1522
	 * 
1523
	 * @param projectName the name of the project
1524
	 * @return true if there is a directory with the same name of the imported project
1525
	 */
1526
	private boolean isProjectInWorkspacePath(String projectName){
1527
		final IWorkspace workspace = ResourcesPlugin.getWorkspace();
1528
		IPath wsPath = workspace.getRoot().getLocation();
1529
		IPath localProjectPath = wsPath.append(projectName);
1530
		return localProjectPath.toFile().exists();
1531
	}
1532
1533
	/**
1516
	 * Determine if the project with the given name is in the current workspace.
1534
	 * Determine if the project with the given name is in the current workspace.
1517
	 * 
1535
	 * 
1518
	 * @param projectName
1536
	 * @param projectName
Lines 1549-1554 Link Here
1549
			// checkbox
1567
			// checkbox
1550
			copyFiles = settings.getBoolean(STORE_COPY_PROJECT_ID);
1568
			copyFiles = settings.getBoolean(STORE_COPY_PROJECT_ID);
1551
			copyCheckbox.setSelection(copyFiles);
1569
			copyCheckbox.setSelection(copyFiles);
1570
			lastCopyFiles = copyFiles;
1552
		}
1571
		}
1553
				
1572
				
1554
		// Second, check to see if we don't have an initial path, 
1573
		// Second, check to see if we don't have an initial path, 

Return to bug 330553