ca.sqlpower.architect
Enum UserPrompter.UserPromptResponse

java.lang.Object
  extended by java.lang.Enum<UserPrompter.UserPromptResponse>
      extended by ca.sqlpower.architect.UserPrompter.UserPromptResponse
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<UserPrompter.UserPromptResponse>
Enclosing interface:
UserPrompter

public static enum UserPrompter.UserPromptResponse
extends java.lang.Enum<UserPrompter.UserPromptResponse>

An enumeration of all the possible responses from the user.


Enum Constant Summary
CANCEL
          Denotes that the user wants to cancel the entire operation.
NOT_OK
          Denotes a negative response from the user, meaning that the current part of the operation should not proceed.
OK
          Denotes an affirmative response from the user, meaning the current part of the operation should proceed.
 
Method Summary
static UserPrompter.UserPromptResponse valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static UserPrompter.UserPromptResponse[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OK

public static final UserPrompter.UserPromptResponse OK
Denotes an affirmative response from the user, meaning the current part of the operation should proceed.


NOT_OK

public static final UserPrompter.UserPromptResponse NOT_OK
Denotes a negative response from the user, meaning that the current part of the operation should not proceed.


CANCEL

public static final UserPrompter.UserPromptResponse CANCEL
Denotes that the user wants to cancel the entire operation.

The difference between NOT_OK and this response is that, for instance, if the entire operation consists of writing a series of 7 files, and the 3rd file already exists, if the user response is NOT_OK, the process will skip the 3rd file and continue to the 4th (possibly prompting again for that file if necessary) whereas if the user response is CANCEL, the process will stop completely and there will be no additional prompts.

Another example is the typical sequence of events when the user tries to quit the program when their work is not saved: A response of NOT_OK would mean to not save the project but quit the program anyway (thus losing work); a response of CANCEL would mean to not save the work, but also not quit the program.

Method Detail

values

public static final UserPrompter.UserPromptResponse[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(UserPrompter.UserPromptResponse c : UserPrompter.UserPromptResponse.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static UserPrompter.UserPromptResponse valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca