1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 06:15: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() * @see #run()
*/ */
protected Dialog createDialog(Shell shell) protected Dialog createDialog(Shell shell)
{
Object firstSelection = getFirstSelection();
if (firstSelection != null)
{ {
SystemDeleteDialog dlg = new SystemDeleteDialog(shell); SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
if (promptLabel != null) if (promptLabel != null)
dlg.setPromptLabel(promptLabel); dlg.setPromptLabel(promptLabel);
Object firstSelection = getFirstSelection();
if (getRemoteAdapter(firstSelection) != null) if (getRemoteAdapter(firstSelection) != null)
{ {
String warningMsg = null; String warningMsg = null;
@ -248,6 +251,11 @@ public class SystemCommonDeleteAction
} }
return dlg; return dlg;
} }
else
{
return null;
}
}
/** /**

View file

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