Lines 50-59
Link Here
|
50 |
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI |
50 |
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI |
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 |
* Rupen Mardirossian (IBM) - [227213] Copy and pasting to the parent folder will create a "Copy of" that resource |
53 |
*******************************************************************************/ |
54 |
*******************************************************************************/ |
54 |
|
55 |
|
55 |
package org.eclipse.rse.internal.files.ui.view; |
56 |
package org.eclipse.rse.internal.files.ui.view; |
56 |
import java.io.File; |
57 |
import java.io.File; |
|
|
58 |
import java.text.MessageFormat; |
57 |
import java.util.ArrayList; |
59 |
import java.util.ArrayList; |
58 |
import java.util.Date; |
60 |
import java.util.Date; |
59 |
import java.util.Iterator; |
61 |
import java.util.Iterator; |
Lines 154-159
Link Here
|
154 |
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; |
156 |
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; |
155 |
import org.eclipse.rse.ui.ISystemContextMenuConstants; |
157 |
import org.eclipse.rse.ui.ISystemContextMenuConstants; |
156 |
import org.eclipse.rse.ui.ISystemIconConstants; |
158 |
import org.eclipse.rse.ui.ISystemIconConstants; |
|
|
159 |
import org.eclipse.rse.ui.ISystemMessages; |
157 |
import org.eclipse.rse.ui.RSEUIPlugin; |
160 |
import org.eclipse.rse.ui.RSEUIPlugin; |
158 |
import org.eclipse.rse.ui.SystemBasePlugin; |
161 |
import org.eclipse.rse.ui.SystemBasePlugin; |
159 |
import org.eclipse.rse.ui.SystemMenuManager; |
162 |
import org.eclipse.rse.ui.SystemMenuManager; |
Lines 2103-2111
Link Here
|
2103 |
} |
2106 |
} |
2104 |
else if (first instanceof IRemoteFile) |
2107 |
else if (first instanceof IRemoteFile) |
2105 |
{ |
2108 |
{ |
2106 |
//List toCopy = new ArrayList(); |
2109 |
List toCopy = new ArrayList(); |
2107 |
//List toCopyNames = new ArrayList(); |
2110 |
List toCopyNames = new ArrayList(); |
2108 |
List toCopyBatch = new ArrayList(); |
2111 |
//List toCopyBatch = new ArrayList(); |
2109 |
List existing = new ArrayList(); |
2112 |
List existing = new ArrayList(); |
2110 |
boolean overwrite=false; |
2113 |
boolean overwrite=false; |
2111 |
|
2114 |
|
Lines 2136-2171
Link Here
|
2136 |
|
2139 |
|
2137 |
|
2140 |
|
2138 |
String name = srcFileOrFolder.getName(); |
2141 |
String name = srcFileOrFolder.getName(); |
2139 |
|
2142 |
String originalName = srcFileOrFolder.getName(); |
|
|
2143 |
String pattern = "Copy{0,choice,1#|1< ({0,number,integer})} of {1}"; //$NON-NLS-1$ |
2144 |
int count = 1; |
2145 |
boolean go = true; |
2146 |
|
2140 |
// same systemfor |
2147 |
// same systemfor |
2141 |
if (sameSystem) |
2148 |
if (sameSystem) |
2142 |
{ |
2149 |
{ |
2143 |
try |
2150 |
try |
2144 |
{ |
2151 |
{ |
2145 |
if (!targetFolder.getAbsolutePath().equals(srcFileOrFolder.getAbsolutePath()) && !targetFolder.getAbsolutePath().equals(srcFileOrFolder.getParentRemoteFile().getAbsolutePath())) |
2152 |
if (!targetFolder.getAbsolutePath().equals(srcFileOrFolder.getAbsolutePath())) |
2146 |
{ |
2153 |
{ |
2147 |
|
2154 |
//Handle resources being copied to their parent folder. Name = "Copy of " + name |
2148 |
// should be better doing a query for all in the set |
2155 |
if(targetFolder.getAbsolutePath().equals(srcFileOrFolder.getParentRemoteFile().getAbsolutePath())) |
2149 |
IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor); |
|
|
2150 |
if (existingFileOrFolder.exists()) |
2151 |
{ |
2156 |
{ |
2152 |
/*RenameRunnable rr = new RenameRunnable(existingFileOrFolder, toCopyNames); |
2157 |
name = MessageFormat.format(pattern, new Object[] { |
2153 |
Display.getDefault().syncExec(rr); |
2158 |
new Integer(count), originalName }); |
2154 |
name = rr.getNewName(); |
2159 |
while(go) |
2155 |
*/ |
2160 |
{ |
2156 |
existing.add(existingFileOrFolder); |
2161 |
IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor); |
|
|
2162 |
if (existingFileOrFolder.exists()) |
2163 |
{ |
2164 |
count++; |
2165 |
name = MessageFormat.format(pattern, new Object[] { |
2166 |
new Integer(count), originalName }); |
2167 |
} |
2168 |
else |
2169 |
{ |
2170 |
toCopy.add(srcFileOrFolder); |
2171 |
toCopyNames.add(name); |
2172 |
go = false; |
2173 |
} |
2174 |
} |
2157 |
} |
2175 |
} |
2158 |
|
2176 |
else |
2159 |
if (name != null) |
|
|
2160 |
{ |
2177 |
{ |
2161 |
//toCopy.add(srcFileOrFolder); |
2178 |
// should be better doing a query for all in the set |
2162 |
//toCopyNames.add(name); |
2179 |
IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor); |
2163 |
toCopyBatch.add(srcFileOrFolder); |
2180 |
if (existingFileOrFolder.exists()) |
|
|
2181 |
{ |
2182 |
/*RenameRunnable rr = new RenameRunnable(existingFileOrFolder, toCopyNames); |
2183 |
Display.getDefault().syncExec(rr); |
2184 |
name = rr.getNewName(); |
2185 |
*/ |
2186 |
existing.add(existingFileOrFolder); |
2187 |
} |
2188 |
|
2189 |
if (name != null) |
2190 |
{ |
2191 |
toCopy.add(srcFileOrFolder); |
2192 |
toCopyNames.add(name); |
2193 |
//toCopyBatch.add(srcFileOrFolder); |
2194 |
} |
2195 |
/*else if (name != null) |
2196 |
{ |
2197 |
toCopyBatch.add(srcFileOrFolder); |
2198 |
}*/ |
2164 |
} |
2199 |
} |
2165 |
/*else if (name != null) |
|
|
2166 |
{ |
2167 |
toCopyBatch.add(srcFileOrFolder); |
2168 |
}*/ |
2169 |
} |
2200 |
} |
2170 |
} |
2201 |
} |
2171 |
catch (Exception e) |
2202 |
catch (Exception e) |
Lines 2186-2194
Link Here
|
2186 |
Display.getDefault().syncExec(rr); |
2217 |
Display.getDefault().syncExec(rr); |
2187 |
overwrite = rr.getOk(); |
2218 |
overwrite = rr.getOk(); |
2188 |
} |
2219 |
} |
2189 |
|
2220 |
|
2190 |
//Following code for renaming dialog copying procedures is not required |
2221 |
|
2191 |
/*if(existing.size()==0 || overwrite) |
2222 |
|
|
|
2223 |
//Following code used originally with the rename dialog which no longer exists |
2224 |
//Resources will be copied with same names if an overwrite is desired from the user |
2225 |
//Resources that are copied to their parent will be renamed to "Copy of " + name of source |
2226 |
if(existing.size()==0 || overwrite) |
2192 |
{ |
2227 |
{ |
2193 |
for (int x = 0; x < toCopy.size(); x++) |
2228 |
for (int x = 0; x < toCopy.size(); x++) |
2194 |
{ |
2229 |
{ |
Lines 2269-2277
Link Here
|
2269 |
e.printStackTrace(); |
2304 |
e.printStackTrace(); |
2270 |
} |
2305 |
} |
2271 |
} |
2306 |
} |
2272 |
}*/ |
2307 |
} |
2273 |
// deal with batch copies now |
2308 |
// deal with batch copies now |
2274 |
if(existing.size()==0 || overwrite) |
2309 |
/*if(existing.size()==0 || overwrite) |
2275 |
{ |
2310 |
{ |
2276 |
IRemoteFile[] srcFileOrFolders = new IRemoteFile[toCopyBatch.size()]; |
2311 |
IRemoteFile[] srcFileOrFolders = new IRemoteFile[toCopyBatch.size()]; |
2277 |
for (int x = 0; x < toCopyBatch.size(); x++) |
2312 |
for (int x = 0; x < toCopyBatch.size(); x++) |
Lines 2348-2354
Link Here
|
2348 |
e.printStackTrace(); |
2383 |
e.printStackTrace(); |
2349 |
} |
2384 |
} |
2350 |
} |
2385 |
} |
2351 |
} |
2386 |
}*/ |
2352 |
} |
2387 |
} |
2353 |
} |
2388 |
} |
2354 |
} |
2389 |
} |