return;
}
// remove the first file from the list
final FileSystemItem sourceFile = filesQueue.remove(0);
// determine the default name and default selection
final String COPY_PREFIX = "CopyOf";
String defaultName = COPY_PREFIX + sourceFile.getName();
int defaultSelectionLength = COPY_PREFIX.length()
+ sourceFile.getStem().length();
// show prompt for new filename
final String objectName = sourceFile.isDirectory() ? "Folder" : "File";
globalDisplay_.promptForText(
"Copy " + objectName,
"Enter a name for the copy of '" + sourceFile.getName() + "':",
defaultName,
0,
defaultSelectionLength,
null,
new ProgressOperationWithInput<String>() {
public void execute(String input, ProgressIndicator progress)
{
progress.onProgress("Copying " + objectName.toLowerCase() + "...");
String targetFilePath = targetDirectory.completePath(input);
final FileSystemItem targetFile = FileSystemItem.createFile(
targetFilePath);
server_.copyFile(sourceFile,
targetFile,
false,