Package de.richtercloud.message.handler
Class DialogConfirmMessageHandler
- java.lang.Object
-
- de.richtercloud.message.handler.DialogConfirmMessageHandler
-
- All Implemented Interfaces:
ConfirmMessageHandler
public class DialogConfirmMessageHandler extends Object implements ConfirmMessageHandler
- Author:
- richter
-
-
Constructor Summary
Constructors Constructor Description DialogConfirmMessageHandler(Frame parent)DialogConfirmMessageHandler(Frame parent, int textWidth, String titlePrefix, String titleSuffix)DialogConfirmMessageHandler(Frame parent, String titlePrefix, String titleSuffix)
-
Method Summary
All Methods Instance Methods Concrete 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 likeConfirmMessageHandler.confirm(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
public String confirm(Message message, String... options)
Description copied from interface:ConfirmMessageHandlerImplementations need to request input from the user and return one ofoptionsvalues.- Specified by:
confirmin interfaceConfirmMessageHandler- Parameters:
message- the message to confirmoptions- options to choose from- Returns:
- one of the specified
optionsornullif the dialog has been canceled
-
confirm
public <C extends ConfirmOption> C confirm(Message message, C... options)
Description copied from interface:ConfirmMessageHandlerWorks likeConfirmMessageHandler.confirm(de.richtercloud.message.handler.Message, java.lang.String...), but allows to work with enums which have to implementConfirmOptioninstead of plain strings.- Specified by:
confirmin interfaceConfirmMessageHandler- 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
-
confirm
public int confirm(Message message)
Description copied from interface:ConfirmMessageHandlerImplementations 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.- Specified by:
confirmin interfaceConfirmMessageHandler- Parameters:
message- the message to confirm- Returns:
JOptionPane.YES_OPTIONorJOptionPane.NO_OPTION
-
-