View | Details | Raw Unified | Return to bug 227213 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java (-31 / +65 lines)
Lines 51-61 Link Here
51
 * Rupen Mardirossian (IBM)      - [210682] Copy collisions will use SystemCopyDialog now instead of renameDialog when there is a copy collision within the same connection
51
 * Rupen Mardirossian (IBM)      - [210682] Copy collisions will use SystemCopyDialog now instead of renameDialog when there is a copy collision within the same connection
52
 * David McKnight   (IBM)        - [224377] "open with" menu does not have "other" option
52
 * David McKnight   (IBM)        - [224377] "open with" menu does not have "other" option
53
 * David McKnight (IBM) 		 - [225747] [dstore] Trying to connect to an "Offline" system throws an NPE
53
 * David McKnight (IBM) 		 - [225747] [dstore] Trying to connect to an "Offline" system throws an NPE
54
 * Rupen Mardirossian (IBM)      - [198728] Folder being copied across systems is added to original set of files in order to extract empty (sub)folders in doDrop method			
54
 * Rupen Mardirossian (IBM)      - [198728] Folder being copied across systems is added to original set of files in order to extract empty (sub)folders in doDrop method
55
 * Rupen Mardirossian (IBM)      - [227213] Copy and pasting to the parent folder will create a "Copy of" that resource			
55
 *******************************************************************************/
56
 *******************************************************************************/
56
57
57
package org.eclipse.rse.internal.files.ui.view;
58
package org.eclipse.rse.internal.files.ui.view;
58
import java.io.File;
59
import java.io.File;
60
import java.text.MessageFormat;
59
import java.util.ArrayList;
61
import java.util.ArrayList;
60
import java.util.Date;
62
import java.util.Date;
61
import java.util.Iterator;
63
import java.util.Iterator;
Lines 156-161 Link Here
156
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
158
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
157
import org.eclipse.rse.ui.ISystemContextMenuConstants;
159
import org.eclipse.rse.ui.ISystemContextMenuConstants;
158
import org.eclipse.rse.ui.ISystemIconConstants;
160
import org.eclipse.rse.ui.ISystemIconConstants;
161
import org.eclipse.rse.ui.ISystemMessages;
159
import org.eclipse.rse.ui.RSEUIPlugin;
162
import org.eclipse.rse.ui.RSEUIPlugin;
160
import org.eclipse.rse.ui.SystemBasePlugin;
163
import org.eclipse.rse.ui.SystemBasePlugin;
161
import org.eclipse.rse.ui.SystemMenuManager;
164
import org.eclipse.rse.ui.SystemMenuManager;
Lines 2117-2125 Link Here
2117
					}
2120
					}
2118
					else if (first instanceof IRemoteFile)
2121
					else if (first instanceof IRemoteFile)
2119
					{
2122
					{
2120
						//List toCopy = new ArrayList();
2123
						List toCopy = new ArrayList();
2121
						//List toCopyNames = new ArrayList();
2124
						List toCopyNames = new ArrayList();
2122
						List toCopyBatch = new ArrayList();
2125
						//List toCopyBatch = new ArrayList();
2123
						List existing = new ArrayList();
2126
						List existing = new ArrayList();
2124
						boolean overwrite=false;
2127
						boolean overwrite=false;
2125
2128
Lines 2150-2185 Link Here
2150
2153
2151
2154
2152
							String name = srcFileOrFolder.getName();
2155
							String name = srcFileOrFolder.getName();
2153
2156
							String originalName = srcFileOrFolder.getName();
2157
							int count = 1;
2158
							boolean go = true;
2159
							
2154
							// same systemfor
2160
							// same systemfor
2155
							if (sameSystem)
2161
							if (sameSystem) 
2156
							{
2162
							{
2157
								try
2163
								try
2158
								{
2164
								{
2159
									if (!targetFolder.getAbsolutePath().equals(srcFileOrFolder.getAbsolutePath()) && !targetFolder.getAbsolutePath().equals(srcFileOrFolder.getParentRemoteFile().getAbsolutePath()))
2165
									if (!targetFolder.getAbsolutePath().equals(srcFileOrFolder.getAbsolutePath()))
2160
									{
2166
									{
2161
2167
										//Handle resources being copied to their parent folder.  Name = "Copy of " + name
2162
										// should be better doing a query for all in the set
2168
										if(targetFolder.getAbsolutePath().equals(srcFileOrFolder.getParentRemoteFile().getAbsolutePath()))
2163
										IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor);
2164
										if (existingFileOrFolder.exists())
2165
										{
2169
										{
2166
											/*RenameRunnable rr = new RenameRunnable(existingFileOrFolder, toCopyNames);
2170
											name = MessageFormat.format(FileResources.RESID_CONFLICT_COPY_PATTERN, new Object[] { 
2167
											Display.getDefault().syncExec(rr);
2171
												    new Integer(count), originalName });
2168
											name = rr.getNewName();
2172
											while(go)
2169
											*/
2173
											{
2170
											existing.add(existingFileOrFolder);
2174
												IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor);
2175
												if (existingFileOrFolder.exists())
2176
												{
2177
													count++;
2178
													name = MessageFormat.format(FileResources.RESID_CONFLICT_COPY_PATTERN, new Object[] { 
2179
														    new Integer(count), originalName });
2180
												}
2181
												else
2182
												{
2183
													toCopy.add(srcFileOrFolder);
2184
													toCopyNames.add(name);
2185
													go = false;
2186
												}
2187
											}
2171
										}
2188
										}
2172
2189
										else
2173
										if (name != null)
2174
										{
2190
										{
2175
											//toCopy.add(srcFileOrFolder);
2191
											// should be better doing a query for all in the set
2176
											//toCopyNames.add(name);
2192
											IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor);
2177
											toCopyBatch.add(srcFileOrFolder);
2193
											if (existingFileOrFolder.exists())
2194
											{
2195
												/*RenameRunnable rr = new RenameRunnable(existingFileOrFolder, toCopyNames);
2196
												Display.getDefault().syncExec(rr);
2197
												name = rr.getNewName();
2198
												*/
2199
												existing.add(existingFileOrFolder);
2200
											}
2201
	
2202
											if (name != null)
2203
											{
2204
												toCopy.add(srcFileOrFolder);
2205
												toCopyNames.add(name);
2206
												//toCopyBatch.add(srcFileOrFolder);
2207
											}
2208
											/*else if (name != null)
2209
											{
2210
												toCopyBatch.add(srcFileOrFolder);
2211
											}*/
2178
										}
2212
										}
2179
										/*else if (name != null)
2180
										{
2181
											toCopyBatch.add(srcFileOrFolder);
2182
										}*/
2183
									}
2213
									}
2184
								}
2214
								}
2185
								catch (Exception e)
2215
								catch (Exception e)
Lines 2200-2208 Link Here
2200
							Display.getDefault().syncExec(rr);
2230
							Display.getDefault().syncExec(rr);
2201
							overwrite = rr.getOk();
2231
							overwrite = rr.getOk();
2202
						}
2232
						}
2203
2233
						
2204
						//Following code for renaming dialog copying procedures is not required
2234
						
2205
						/*if(existing.size()==0 || overwrite)
2235
						
2236
						//Following code used originally with the rename dialog which no longer exists
2237
						//Resources will be copied with same names if an overwrite is desired from the user
2238
						//Resources that are copied to their parent will be renamed to "Copy of " + name of source 
2239
						if(existing.size()==0 || overwrite)
2206
						{
2240
						{
2207
							for (int x = 0; x < toCopy.size(); x++)
2241
							for (int x = 0; x < toCopy.size(); x++)
2208
							{
2242
							{
Lines 2283-2291 Link Here
2283
									e.printStackTrace();
2317
									e.printStackTrace();
2284
								}
2318
								}
2285
							}
2319
							}
2286
						}*/
2320
						}
2287
						// deal with batch copies now
2321
						// deal with batch copies now
2288
						if(existing.size()==0 || overwrite)
2322
						/*if(existing.size()==0 || overwrite)
2289
						{
2323
						{
2290
							IRemoteFile[] srcFileOrFolders = new IRemoteFile[toCopyBatch.size()];
2324
							IRemoteFile[] srcFileOrFolders = new IRemoteFile[toCopyBatch.size()];
2291
							for (int x = 0; x < toCopyBatch.size(); x++)
2325
							for (int x = 0; x < toCopyBatch.size(); x++)
Lines 2362-2368 Link Here
2362
									e.printStackTrace();
2396
									e.printStackTrace();
2363
								}
2397
								}
2364
							}
2398
							}
2365
						}
2399
						}*/
2366
					}
2400
					}
2367
				}
2401
				}
2368
			}
2402
			}
(-)src/org/eclipse/rse/internal/files/ui/FileResources.java (+4 lines)
Lines 20-25 Link Here
20
 * David McKnight   (IBM)        - [223103] [cleanup] fix broken externalized strings
20
 * David McKnight   (IBM)        - [223103] [cleanup] fix broken externalized strings
21
 * David McKnight   (IBM)        - [223204] [cleanup] fix broken nls strings in files.ui and others
21
 * David McKnight   (IBM)        - [223204] [cleanup] fix broken nls strings in files.ui and others
22
 * David McKnight   (IBM)        - [224377] "open with" menu does not have "other" option
22
 * David McKnight   (IBM)        - [224377] "open with" menu does not have "other" option
23
 * Rupen Mardirossian (IBM)		 - [227213] Added RESID_CONFLICT_COPY_PATTERN to be used for copying resources to parent folder.
23
 *******************************************************************************/
24
 *******************************************************************************/
24
25
25
package org.eclipse.rse.internal.files.ui;
26
package org.eclipse.rse.internal.files.ui;
Lines 171-176 Link Here
171
	public static String RESID_CONFLICT_DOWNLOAD_MESSAGE_REMOTECHANGED;
172
	public static String RESID_CONFLICT_DOWNLOAD_MESSAGE_REMOTECHANGED;
172
	public static String RESID_CONFLICT_DOWNLOAD_REPLACELOCAL;
173
	public static String RESID_CONFLICT_DOWNLOAD_REPLACELOCAL;
173
	public static String RESID_CONFLICT_DOWNLOAD_OPENWITHLOCAL;
174
	public static String RESID_CONFLICT_DOWNLOAD_OPENWITHLOCAL;
175
	
176
	// Resource conflict constants
177
	public static String RESID_CONFLICT_COPY_PATTERN;
174
178
175
	// RSE Cache Preferences
179
	// RSE Cache Preferences
176
	public static String RESID_PREF_CACHE_CLEAR;
180
	public static String RESID_PREF_CACHE_CLEAR;
(-)src/org/eclipse/rse/internal/files/ui/FileResources.properties (+8 lines)
Lines 21-26 Link Here
21
# David McKnight   (IBM)        - [223204] [cleanup] fix broken nls strings in files.ui and others
21
# David McKnight   (IBM)        - [223204] [cleanup] fix broken nls strings in files.ui and others
22
# David McKnight   (IBM)        - [224377] "open with" menu does not have "other" option
22
# David McKnight   (IBM)        - [224377] "open with" menu does not have "other" option
23
# Martin Oberhuber (Wind River) - [226784] [nls] Standardize on Cancelled in PII
23
# Martin Oberhuber (Wind River) - [226784] [nls] Standardize on Cancelled in PII
24
# Rupen Mardirossian (IBM)		- [227213] Added RESID_CONFLICT_COPY_PATTERN to be used for copying resources to parent folder.
24
###############################################################################
25
###############################################################################
25
26
26
# NLS_MESSAGEFORMAT_VAR
27
# NLS_MESSAGEFORMAT_VAR
Lines 153-158 Link Here
153
RESID_CONFLICT_DOWNLOAD_REPLACELOCAL= Replace pending changes with remote file
154
RESID_CONFLICT_DOWNLOAD_REPLACELOCAL= Replace pending changes with remote file
154
RESID_CONFLICT_DOWNLOAD_OPENWITHLOCAL= Open editor with pending changes
155
RESID_CONFLICT_DOWNLOAD_OPENWITHLOCAL= Open editor with pending changes
155
156
157
##################################################################################
158
############################Resource Conflict Constants #########################
159
##################################################################################
160
161
RESID_CONFLICT_COPY_PATTERN =Copy{0,choice,1#|1< ({0,number,integer})} of {1}
162
163
156
#==============================================================
164
#==============================================================
157
# REMOTE FILE SYSTEM CACHE PREFERENCE PAGE
165
# REMOTE FILE SYSTEM CACHE PREFERENCE PAGE
158
#=============================================================
166
#=============================================================

Return to bug 227213