mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +02:00
[188425] check selection before attempting to open dialog
This commit is contained in:
parent
8ccaf101ec
commit
dd6163b462
2 changed files with 24 additions and 12 deletions
|
@ -233,20 +233,28 @@ public class SystemCommonDeleteAction
|
|||
*/
|
||||
protected Dialog createDialog(Shell shell)
|
||||
{
|
||||
SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
|
||||
if (promptLabel != null)
|
||||
dlg.setPromptLabel(promptLabel);
|
||||
Object firstSelection = getFirstSelection();
|
||||
if (getRemoteAdapter(firstSelection) != null)
|
||||
if (firstSelection != null)
|
||||
{
|
||||
String warningMsg = null;
|
||||
String warningTip = null;
|
||||
|
||||
warningMsg = SystemResources.RESID_DELETE_WARNING_LABEL;
|
||||
warningTip = SystemResources.RESID_DELETE_WARNING_TOOLTIP;
|
||||
dlg.setWarningMessage(warningMsg,warningTip);
|
||||
SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
|
||||
if (promptLabel != null)
|
||||
dlg.setPromptLabel(promptLabel);
|
||||
|
||||
if (getRemoteAdapter(firstSelection) != null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue