|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UserPrompter
The UserPrompter interface is a UI-neutral way for core business objects to solicit a response from the user. When operating in a GUI environment, the UserPrompter implementation could use a modal dialog to prompt the user. When operating in a command line environment, a textual prompt could be used. In a headless environment where prompting is not possible, the responses can be hardwired to a reasonable default. For example, the AlwaysOKUserPrompter always responds as if the user said OK.
An example use case is when a file to be created but already exists. The business logic can be implemented to ask the user how to handle the problem, such as overwriting, not overwriting, or canceling the operation completely. The advantage of using this interface is that the business logic remains uncommitted to any particular user interface library.
| Nested Class Summary | |
|---|---|
static class |
UserPrompter.UserPromptResponse
An enumeration of all the possible responses from the user. |
| Method Summary | |
|---|---|
UserPrompter.UserPromptResponse |
promptUser(java.lang.Object... formatArgs)
Obtains the decision for how a given operation should proceed. |
| Method Detail |
|---|
UserPrompter.UserPromptResponse promptUser(java.lang.Object... formatArgs)
formatArgs - The arguments to the insert into the format string in the
question. See MessageFormat for details.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||