| 1 | package com.googlecode.lanterna.gui2.dialogs; |
| 2 | |
| 3 | import com.googlecode.lanterna.gui2.LocalizedString; |
| 4 | |
| 5 | /** |
| 6 | * This enum has the available selection of buttons that you can add to a {@code MessageDialog}. They are used both for |
| 7 | * specifying which buttons the dialog will have but is also returned when the user makes a selection |
| 8 | * |
| 9 | * @author Martin |
| 10 | */ |
| 11 | public enum MessageDialogButton { |
| 12 | /** |
| 13 | * "OK" |
| 14 | */ |
| 15 | OK(LocalizedString.OK), |
| 16 | /** |
| 17 | * "Cancel" |
| 18 | */ |
| 19 | Cancel(LocalizedString.Cancel), |
| 20 | /** |
| 21 | * "Yes" |
| 22 | */ |
| 23 | Yes(LocalizedString.Yes), |
| 24 | /** |
| 25 | * "No" |
| 26 | */ |
| 27 | No(LocalizedString.No), |
| 28 | /** |
| 29 | * "Close" |
| 30 | */ |
| 31 | Close(LocalizedString.Close), |
| 32 | /** |
| 33 | * "Abort" |
| 34 | */ |
| 35 | Abort(LocalizedString.Abort), |
| 36 | /** |
| 37 | * "Ignore" |
| 38 | */ |
| 39 | Ignore(LocalizedString.Ignore), |
| 40 | /** |
| 41 | * "Retry" |
| 42 | */ |
| 43 | Retry(LocalizedString.Retry), |
| 44 | |
| 45 | /** |
| 46 | * "Continue" |
| 47 | */ |
| 48 | Continue(LocalizedString.Continue); |
| 49 | |
| 50 | private final LocalizedString label; |
| 51 | |
| 52 | MessageDialogButton(final LocalizedString label) { |
| 53 | this.label = label; |
| 54 | } |
| 55 | |
| 56 | @Override |
| 57 | public String toString() { |
| 58 | return label.toString(); |
| 59 | } |
| 60 | } |