final Shell shell = new Shell(window.getShell().getDisplay());
final Object obj = ((IStructuredSelection) getViewer().getSelection())
.getFirstElement();
final String oldName = obj instanceof Folder ? ((Folder) obj).getName()
: obj instanceof ScannedMap ? ((ScannedMap) obj).getName() : ""; //$NON-NLS-1$
final RenameDialog renameDialog = new RenameDialog(shell, oldName);
renameDialog.setBlockOnOpen(true);
renameDialog.open();
final String newName = renameDialog.getNewName();
if (newName != null) {
if (obj instanceof Folder) {
final Folder f = (Folder) obj;
getBL().rename(f, newName);
}