|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsymplik.flower.Question
public abstract class Question
This is the abstract class for any screen which requires user interaction or displays textual information. The sequence of method to be executed when a Question is instantiated:
classAliasXXX = com.blah.questionXXXYou can use this alias to get the answer:
Answer.getInstance().getA("classAlias")
public String nextAction() {
return "classAliasXXX";
}
Field Summary | |
---|---|
static java.lang.String |
RCS_ID
|
Constructor Summary | |
---|---|
Question()
|
Method Summary | |
---|---|
java.util.ArrayList<Choice> |
choices()
override this method to construct an sorted Arraylist of Choice object Arraylist can be sorted by the sortChoicesBy method. |
boolean |
enterQuestion()
override this method to tell whether this question will be shown |
Message |
enterQuestionMsg(boolean flag)
override this method to return a message after enterQuestion is processed. |
java.lang.String |
fileExtension()
override this method to restrict the file with extension specified. |
java.lang.String |
getExplanation()
override this method if you want to show explanation of this question. |
java.lang.String |
getQuestion()
override this method to return the question content. |
java.lang.String |
getTitle()
override this method to set the GUI title. |
boolean |
isDirectoryInput()
override this method if you want end-user to select a directory. |
boolean |
isFileInput()
override this method if you want end-user to select a file. |
boolean |
isMultipleChoices()
override this method to tell whether the response is a free-text or a multiple choice. |
boolean |
isNewScreen()
return true if you want to display the question as a new screen (i.e. |
boolean |
isPasswordInput()
override this method if the input field is a password. |
java.lang.String |
lastAction()
Override to tell which Question/Action to go back if it is allowed for a Question. |
boolean |
leaveQuestion()
implement this method if you need some kind of validation on the answer or run some code after the answer is present. |
Message |
leaveQuestionMsg(boolean flag)
implement this method if you need to return a message after leaveMessage method is done. |
boolean |
lineWrap()
Override this method to set linewarp on or off for this question. |
boolean |
needAnswer()
sometimes the question is optional; no answer is needed. |
java.lang.String |
nextAction()
override this method to tell which Question or Action class to be the next one. |
boolean |
showExit()
This method is for multiple choice question only. |
java.lang.String |
sortChoicesBy()
override this method to specify how the multiple choices are sorted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RCS_ID
Constructor Detail |
---|
public Question()
Method Detail |
---|
public boolean enterQuestion()
public Message enterQuestionMsg(boolean flag)
flag
- return value of enterQuestion.
public java.util.ArrayList<Choice> choices()
ArrayListal = new ArrayList (); al.add(new Choice("A", "Option A"); al.add(new Choice("B", "Option B"); al.add(new Choice("C", "Option C");
public java.lang.String getQuestion()
public boolean showExit()
public java.lang.String getExplanation()
public boolean isPasswordInput()
public boolean isDirectoryInput()
public boolean isFileInput()
public java.lang.String fileExtension()
public boolean isMultipleChoices()
public java.lang.String sortChoicesBy()
public boolean needAnswer()
public boolean leaveQuestion()
public Message leaveQuestionMsg(boolean flag)
value
- from leaveQuestion
public java.lang.String lastAction()
public java.lang.String nextAction()
public boolean isNewScreen()
public java.lang.String getTitle()
public boolean lineWrap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |