}
public boolean inplaceValueSet(TableCell cell, String value, boolean finalEdit) {
if (value.equalsIgnoreCase(cell.getText()) || "".equals(value) || "".equals(cell.getText()))
return true;
final DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
final File target;
try
{
target = new File(fileInfo.getFile(true).getParentFile(), value).getCanonicalFile();
} catch (IOException e)
{
return false;
}
if(!finalEdit)
return !target.exists();
if(target.exists())
return false;
// code stolen from FilesView
final boolean[] result = { false };
boolean paused = fileInfo.getDownloadManager().pause();
FileUtil.runAsTask(new AzureusCoreOperationTask()
{
public void run(AzureusCoreOperation operation) {
result[0] = fileInfo.setLink(target);
}
});
if(paused)
fileInfo.getDownloadManager().resume();
if (!result[0])
{
new MessageBoxShell(SWT.ICON_ERROR | SWT.OK,
MessageText.getString("FilesView.rename.failed.title"),