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:
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)
|
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;
|
|
||||||
warningTip = SystemResources.RESID_DELETE_WARNING_TOOLTIP;
|
if (getRemoteAdapter(firstSelection) != null)
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue