Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 163601 - [Import/Export] Can't import and overwrite existing projects into workspace
Summary: [Import/Export] Can't import and overwrite existing projects into workspace
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 173994 194648 202255 344771 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-06 16:52 EST by Eric Kaufman CLA
Modified: 2019-11-27 07:10 EST (History)
12 users (show)

See Also:


Attachments
Patch attachement (31.33 KB, patch)
2007-02-21 10:26 EST, Jakub Jurkiewicz CLA
no flags Details | Diff
Patch attachement (19.72 KB, patch)
2007-03-20 08:12 EDT, Jakub Jurkiewicz CLA
no flags Details | Diff
This patch grays out the project name if a directory with the same name exists in the workspace location (4.47 KB, patch)
2010-11-10 08:30 EST, Hadar Hotam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Kaufman CLA 2006-11-06 16:52:22 EST
1. File > Import > General > Existing Projects into Workspace > Next
2. Select archive and browse to a zip file that contains a zipped project, then click Finish. 
3. Repeat process: File > Import > General > Existing Projects into Workspace > Next
4. Select archive Browse to the same exact zip file


Result:

File gets selected, but Finish button is disabled so you can't import and overwrite.


Expect:

Ability to import and overwrite.
Comment 1 Jakub Jurkiewicz CLA 2007-02-06 08:35:43 EST
Indeed this behavior should be improved. 
I think that when project with the same name exists already in the workspace there should be an appropriate message shown. Also there should be a checkbox "Overwrite existing project in the workspace" which would be enabled only in this situation This checkbox would indicate that the project from the workspace should be overwritten by the project from the archive file.
Comment 2 Jakub Jurkiewicz CLA 2007-02-21 10:26:14 EST
Created attachment 59481 [details]
Patch attachement

I have created a patch for this. I have added a checkbox, which indicates if the project should be overwritten. 
This works both with importing from archive and from normal directory.
I'm waiting for any review.
Comment 3 Boris Bokowski CLA 2007-03-15 23:45:10 EDT
I haven't reviewed all of this, but here are two things that need to be addressed:

1. Using COLOR_GRAY and COLOR_BLACK only works when normal system colors are used, but would screw users that use high contrast mode (inverted colors, big fonts).  You should instead use something like this:

RGB dimmedRGB = blend(treeControl.getForeground().getRGB(), treeControl.getBackground().getRGB(), 60);

2. When deleting projects that the user chose to overwrite, you don't report progress properly. Make sure that regardless of the control flow, the total amount of worked() matches the number of units passed to beginTask.  Instead of using SubProgressMonitor, consider using SubMonitor, which is a newer class.
Comment 4 Jakub Jurkiewicz CLA 2007-03-20 08:12:00 EDT
Created attachment 61373 [details]
Patch attachement

I tried to change the patch according to Boris comments. I'm waiting for any remarks.
Comment 5 Boris Bokowski CLA 2007-04-23 14:40:22 EDT
Not sure if I will have time for this in the M7 cycle.
Comment 6 Boris Bokowski CLA 2007-05-09 14:24:18 EDT
Sorry, I'm completely swamped.
Comment 7 Tod Creasey CLA 2007-06-27 09:11:04 EDT
I'll try and have a look early in 3.4.
Comment 8 Tod Creasey CLA 2007-06-27 15:59:15 EDT
*** Bug 194648 has been marked as a duplicate of this bug. ***
Comment 9 Robert Konigsberg CLA 2007-06-27 17:52:04 EDT
I was just listed as an interested party of this bug. What I'm more interested in is not to overwrite the existing project, but rather, a wholesale "Why this project can't be imported into the workspace." dialog.

Here's my original comment:

When using the "Import Existing Projects into Workspace" dialog box, after
entering a directory where projects exist, the list of projects does not show
any projects whose names already match projects in the workspace. I can
understand that you don't want to projects with the same name; is it possible,
however, to at least display the found entry as unimportable? Making that
dialog a little easier to understand would be helpful.

One possible solution:

Add to the Projects dialog those projects that are found but can't be imported,
and when selecting one of those, give information why it's not importable in a
status label.
Comment 10 Jakub Jurkiewicz CLA 2007-07-11 05:51:14 EDT
 (In reply to comment #9)
> 
> One possible solution:
> 
> Add to the Projects dialog those projects that are found but can't be imported,
> and when selecting one of those, give information why it's not importable in a
> status label.
This is exactly what my patch does - already existing projects are grayed out. Moreover there is a checkbox which enables user to overwrite chosen already existing projects.
Comment 11 Robert Konigsberg CLA 2007-07-11 06:31:53 EDT
That's great. Thank you for clarifying my confusion.
Comment 12 Tod Creasey CLA 2007-09-06 12:48:17 EDT
*** Bug 202255 has been marked as a duplicate of this bug. ***
Comment 13 Tod Creasey CLA 2007-10-12 09:02:52 EDT
Jakub this patch is out of date - could you attach a fresh one please?
Comment 14 Tod Creasey CLA 2008-03-11 09:27:06 EDT
*** Bug 173994 has been marked as a duplicate of this bug. ***
Comment 15 Susan McCourt CLA 2009-07-15 12:14:24 EDT
"As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009"
Comment 16 Alex Freidin CLA 2010-11-03 10:45:49 EDT
I think the state of this bug has changed. Graying out of projects that cannot be imported is already available in Eclipse 3.5. There is a warning that some projects cannot be imported. Basically, projects open in the workspace cannot be imported by current implementation. The overwriting is not yet supported.
What remains open and malfunctioning is when a project is in the workspace directory physically, but not open in Eclipse workspace. Trying to import a project with the same name from archive is not blocked. Such project should be grayed out as with projects open in the workspace. 
Similar case when importing a project from other location and with copy checkbox set. If such project is physically in the workspace folder, the operation should be blocked.
This behavior aligns with the current implementation. My colleague will prepare a patch for this shortly. Based on the bug title, this fix is more related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=173994, but it is marked duplicate, so I post here. Perhaps, we should reopen it and here handle only the overwrite checkbox feature, if we still want to add it...
Comment 17 Hadar Hotam CLA 2010-11-10 08:30:40 EST
Created attachment 182808 [details]
This patch grays out the project name if a directory with the same name exists in the workspace location

When importing a project into a workspace,the workspace location is being checked for a directory with the name same as the project name. If the "copy projects into workspace" checkbox is checked on, the project name is grayed out, so that there won't be any conflict between the imported project and the directory that already exists there.
Comment 18 Prakash Rangaraj CLA 2010-11-18 06:28:06 EST
(In reply to comment #17)
> Created an attachment (id=182808) [details]
> This patch grays out the project name if a directory with the same name exists
> in the workspace location

    This patch doesn't address the original problem - the ability to overwrite the proejcts. But the patch does solves a different problem - Bug#330553
Comment 19 Dani Megert CLA 2011-05-05 08:19:02 EDT
*** Bug 344771 has been marked as a duplicate of this bug. ***
Comment 20 David CLA 2013-01-22 13:04:10 EST
see Bug 398819 the juno implementation now breaks, if the user selects the "root directory" radio button and unchecks "Copy projects into workspace" and then goes back to importing the project.
Comment 21 Lars Vogel CLA 2019-11-27 07:10:55 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.