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);
}
else if (obj instanceof ScannedMap) {
final ScannedMap m = (ScannedMap) obj;
getBL().rename(m, newName);
}
_viewer.refresh();
}
}
};
_renameAction.setToolTipText(Messages.ScannedMapsView_RenameTooltip);
_renameAction.setImageDescriptor(Activator.getImageDescriptor("/icons/pencil.png")); //$NON-NLS-1$
_deleteAction = new Action(Messages.ScannedMapsView_Delete) {
@Override
public void run() {
if (getViewer().getSelection() != null
&& getViewer().getSelection() instanceof IStructuredSelection) {
final Object obj = ((IStructuredSelection) getViewer().getSelection())
.getFirstElement();
if (obj instanceof Folder) {
final Folder f = (Folder) obj;
if (showConfirm(getViewer().getControl().getShell(),
Messages.ScannedMapsView_Delete, NLS.bind(
Messages.ScannedMapsView_DeleteFolderConfirm, f.getName()),
"/icons/folder_delete.png")) //$NON-NLS-1$
CalibratorPlugin.getDA().delete(f);
}
else if (obj instanceof ScannedMap) {
final ScannedMap m = (ScannedMap) obj;