1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 13:25:45 +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

@ -233,20 +233,28 @@ public class SystemCommonDeleteAction
*/ */
protected Dialog createDialog(Shell shell) protected Dialog createDialog(Shell shell)
{ {
SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
if (promptLabel != null)
dlg.setPromptLabel(promptLabel);
Object firstSelection = getFirstSelection(); Object firstSelection = getFirstSelection();
if (getRemoteAdapter(firstSelection) != null) if (firstSelection != null)
{ {
String warningMsg = null; SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
String warningTip = null; if (promptLabel != null)
dlg.setPromptLabel(promptLabel);
warningMsg = SystemResources.RESID_DELETE_WARNING_LABEL; if (getRemoteAdapter(firstSelection) != null)
warningTip = SystemResources.RESID_DELETE_WARNING_TOOLTIP; {
dlg.setWarningMessage(warningMsg,warningTip); String warningMsg = null;
String warningTip = null;
warningMsg = SystemResources.RESID_DELETE_WARNING_LABEL;
warningTip = SystemResources.RESID_DELETE_WARNING_TOOLTIP;
dlg.setWarningMessage(warningMsg,warningTip);
}
return dlg;
}
else
{
return null;
} }
return dlg;
} }

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;
}
} }
/** /**