Package de.richtercloud.message.handler
Interface ConfirmMessageHandler
-
- All Known Implementing Classes:
DialogConfirmMessageHandler
public interface ConfirmMessageHandler- Author:
- richter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intconfirm(Message message)Implementations need to request input from the user and returnJOptionPane.YES_OPTIONorJOptionPane.NO_OPTIONwhich can be used by callers.<C extends ConfirmOption>
Cconfirm(Message message, C... options)Works likeconfirm(de.richtercloud.message.handler.Message, java.lang.String...), but allows to work with enums which have to implementConfirmOptioninstead of plain strings.Stringconfirm(Message message, String... options)Implementations need to request input from the user and return one ofoptionsvalues.
-
-
-
Method Detail
-
confirm
int confirm(Message message)
Implementations need to request input from the user and returnJOptionPane.YES_OPTIONorJOptionPane.NO_OPTIONwhich can be used by callers. The choice ofJOptionPane.YES_OPTIONandJOptionPane.NO_OPTIONis for code reusage only and doesn't mean that aJOptionPaneneeds to be used in the implementation.- Parameters:
message- the message to confirm- Returns:
JOptionPane.YES_OPTIONorJOptionPane.NO_OPTION
-
confirm
String confirm(Message message, String... options)
Implementations need to request input from the user and return one ofoptionsvalues.- Parameters:
message- the message to confirmoptions- options to choose from- Returns:
- one of the specified
optionsornullif the dialog has been canceled - Throws:
IllegalArgumentException- ifoptionsis empty
-
confirm
<C extends ConfirmOption> C confirm(Message message, C... options)
Works likeconfirm(de.richtercloud.message.handler.Message, java.lang.String...), but allows to work with enums which have to implementConfirmOptioninstead of plain strings.- Type Parameters:
C- the type of confirm options- Parameters:
message- the message to confirmoptions- the options to choose from- Returns:
- one of the specified
optionsornullif the dialog has been canceled
-
-