1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +02:00

[188425] check selection before attempting to open dialog

This commit is contained in:
David McKnight 2007-05-22 21:12:29 +00:00
parent 8ccaf101ec
commit dd6163b462
2 changed files with 24 additions and 12 deletions

View file

@ -232,11 +232,14 @@ public class SystemCommonDeleteAction
* @see #run()
*/
protected Dialog createDialog(Shell shell)
{
Object firstSelection = getFirstSelection();
if (firstSelection != null)
{
SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
if (promptLabel != null)
dlg.setPromptLabel(promptLabel);
Object firstSelection = getFirstSelection();
if (getRemoteAdapter(firstSelection) != null)
{
String warningMsg = null;
@ -248,6 +251,11 @@ public class SystemCommonDeleteAction
}
return dlg;
}
else
{
return null;
}
}
/**

View file

@ -177,7 +177,7 @@ public class SystemCommonRenameAction extends SystemBaseDialogAction
return dlg;
}
// single-select
else
else if (getSelection().size() == 1)
{
SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(parent);
if (copyCollisionMode)
@ -190,6 +190,10 @@ public class SystemCommonRenameAction extends SystemBaseDialogAction
dlg.setPromptLabel(promptLabel, promptTip);
return dlg;
}
else
{
return null;
}
}
/**