Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323688

Summary: pasting a project or folder from another workspace does not work
Product: z_Archived Reporter: Bozier jerome <jerome.bozier>
Component: TPTPAssignee: Bozier jerome <jerome.bozier>
Status: CLOSED FIXED QA Contact: Kathy Chan <kathy>
Severity: normal    
Priority: P3 CC: paulslau
Version: unspecifiedFlags: paulslau: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
none
patch V2 none

Description Bozier jerome CLA 2010-08-26 05:21:05 EDT
========== project paste =================
. launch 2 eclipse on 2 different workspace
. select a project on first eclipse workspace. right click and copy
. select the second eclipse, right click and paste

raised exception : 
java.lang.Throwable: File does not exist
	at org.eclipse.hyades.test.ui.UiPlugin.logError(UiPlugin.java:343)
	at org.eclipse.hyades.test.ui.internal.navigator.refactoring.PasteFileChange.perform(PasteFileChange.java:162)
	at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
	at org.eclipse.hyades.test.ui.internal.navigator.refactoring.CompositeListenerChange.perform(CompositeListenerChange.java:39)
	at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
....
========== folder paste =================
. launch 2 eclipse on 2 different workspace
. select a folder on first eclipse workspace. right click and copy
. select a project in the second eclipse workspace, right click and paste

operation is cancelled because no resource change is detected

=================================================

it seems that pasting external item is always seen as a file pasting, that could explain theses error.
Comment 1 Bozier jerome CLA 2010-08-27 05:49:42 EDT
after some testing, pasting a folder seems to works well (i made a mistake on my first testing, folder was already existing in target workspace)

some problems still exists for projects, investigating
Comment 2 Bozier jerome CLA 2010-08-27 10:12:00 EDT
update :
in case of a paste of external resource, the change created is performed there :
org.eclipse.hyades.test.ui.internal.navigator.refactoring.PasteFileChange

in this configuration, file is null and externalFileName contains in fact a folder/project name
the call to :
InputStream source = new FileInputStream(externalFileName);
raise an exception (it is supposed to be used on a real file name, not on a container)

todo : 
. find a way to check that name contained inside the clipboard is a container and not a file
. create a constructor for "PasteProjectChange" that can use clipboard entry instead of a classic IFolder

updating estimated time, some few work to make this
Comment 3 Bozier jerome CLA 2010-08-27 11:30:18 EDT
Created attachment 177623 [details]
patch

this patch add a new kind of change to be able to make an external paste of folder (external mean copy from outside current workspace, as from another eclipse or file explorer)
Comment 4 Bozier jerome CLA 2010-08-27 11:32:05 EDT
Paul, could you review this patch please ?

no hurry, i will not push it today (lots of testing remaining) and it is not urgent enough to pass PMC

many thanks in advance
Comment 5 Paul Slauenwhite CLA 2010-08-27 11:53:19 EDT
Reviewed.  I would suggest not using a translated string, if at all possible since the target release will not be translated.
Comment 6 Bozier jerome CLA 2010-08-31 10:56:48 EDT
Created attachment 177847 [details]
patch V2

this patch replace previous one, fixed following Paul comments

manual test added under CVS
will push this patch and update "allTest" + wiki when we'll no longer under PMC approval, this fix is not vital enough to be pushed at the moment
Comment 7 Bozier jerome CLA 2010-10-26 05:22:42 EDT
alltest updated and pushed under CVS
wiki updated
patch delivered under CVS
Comment 8 Kathy Chan CLA 2011-02-11 13:45:54 EST
This defect had been resolved as FIXED for more than 1 month.  Please verify with the latest TPTP 4.7.2 driver.  If this defect is still left unverified by February 25, we'll close it on the originator's behalf.

TPTP 4.7.2 driver can be downloaded from:

http://www.eclipse.org/tptp/home/downloads/?ver=4.7.2
Comment 9 Bozier jerome CLA 2011-04-04 09:33:24 EDT
closing