1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| MessageDialog dialog = new MessageDialog(parent, title, null,
message, QUESTION, new String[] { IDialogConstants.YES_TO_ALL_LABEL,
IDialogConstants.YES_LABEL, IDialogConstants.NO_TO_ALL_LABEL,
IDialogConstants.NO_LABEL }, 1); // yes par defaut
int userChoice = dialog.open();
switch(userChoice) {
case IDialogConstants.YES_TO_ALL_ID:
// traitement pour yes to all
break;
case IDialogConstants.YES_ID:
// traitement pour yes
break;
case IDialogConstants.NO_ID:
// traitement pour no
break;
case IDialogConstants.NO_TO_ALL_ID:
// traitement pour no to all
break;
default:
break;
} |