|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.formbuilder.SimpleQuestionnaire
A simple questionnaire is a list of questions and a submit button. Every question is a label-widget pair (a Bebop Label and a Bebop Widget). The SimpleQuestionnaire is a special case of the PersistentForm and uses such an object internally. The questionnaire offers methods to move questions around and remove questions. I chose not to extend the PersistentForm class since the SimpleQuestionnaire is not an extension of that domain object but rather replaces many of its methods (i.e. add(Component)) with its own special methods (i.e. addQuestion).
Field Summary | |
static String |
versionId
|
Constructor Summary | |
SimpleQuestionnaire()
Default Constructor. |
|
SimpleQuestionnaire(BigDecimal formID)
|
|
SimpleQuestionnaire(String htmlName,
String adminName)
Construct a new Questionnaire that can be persisted with the save() method. |
Method Summary | |
void |
addProcessListener(PersistentProcessListener processListener)
|
void |
addQuestion(String questionText,
PersistentWidget widgetFactory)
Add a question after the questions already added. |
void |
addQuestion(String questionText,
PersistentWidget widgetFactory,
int position)
Add a question at the given position. |
Component |
createComponent()
Returns the Bebop Form representing this questionnaire. |
void |
delete()
Delete this questionnaire. |
String |
getAdminName()
|
AttributeMetaDataList |
getAttributeMetaData()
|
String |
getDescription()
|
String |
getHtmlName()
|
BigDecimal |
getID()
|
AttributeMetaDataList |
getListenerMetaData()
|
int |
getNumberOfQuestions()
|
Iterator |
getProcessListeners()
For convenience I provide the test process listener as default |
PersistentLabel |
getQuestionLabel(int questionPosition)
|
PersistentWidget |
getQuestionWidget(int questionPosition)
|
String |
getSubmitLabel()
|
boolean |
isNew()
Indicates if this questionnaire has been saved or not |
boolean |
listenerDictatesParameterSet()
If this returns true add links for questions will not be allowed, otherwise they will. |
boolean |
listenerHasMetaData()
Returns true if the process listener associated with the quesionnaire implements the AttributeMetaDataProvider interface and has more than zero attribute meta data objects that can be fetched via this interface. |
void |
moveQuestion(int atPosition,
int toPosition)
Move a question from its current position to a new position. |
void |
removeQuestion(int position)
Remove a question at a certain position. |
void |
save()
|
void |
setAdminEnabled(boolean isAdminEnabled)
Indicates if links should be added to the questionnaire with which the questions can be managed (added, edited and deleted). |
void |
setAdminName(String adminName)
|
void |
setDescription(String description)
|
void |
setHtmlName(String htmlName)
Care has been taken to make this method name JavaBean compiant with the htmlName property |
void |
setID(BigDecimal id)
|
void |
setSubmitLabel(String submitLabel)
Every simple questionnaire will have a submit button at the bottom. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public SimpleQuestionnaire()
public SimpleQuestionnaire(String htmlName, String adminName)
public SimpleQuestionnaire(BigDecimal formID) throws DataObjectNotFoundException
Method Detail |
public void save()
save
in interface PersistentComponentFactory
public boolean isNew()
isNew
in interface PersistentComponentFactory
public void delete()
delete
in interface PersistentComponentFactory
public Component createComponent()
createComponent
in interface PersistentComponentFactory
public void addQuestion(String questionText, PersistentWidget widgetFactory)
public void addQuestion(String questionText, PersistentWidget widgetFactory, int position)
public void removeQuestion(int position)
public void moveQuestion(int atPosition, int toPosition)
public PersistentLabel getQuestionLabel(int questionPosition)
public PersistentWidget getQuestionWidget(int questionPosition)
public String getHtmlName()
public void setHtmlName(String htmlName)
public void setAdminEnabled(boolean isAdminEnabled)
public int getNumberOfQuestions()
public void setSubmitLabel(String submitLabel)
public String getSubmitLabel()
public void setAdminName(String adminName)
public String getAdminName()
public void setDescription(String description)
public String getDescription()
public void addProcessListener(PersistentProcessListener processListener)
public Iterator getProcessListeners()
public void setID(BigDecimal id)
public BigDecimal getID()
getID
in interface PersistentComponentFactory
public AttributeMetaDataList getAttributeMetaData()
getAttributeMetaData
in interface AttributeMetaDataProvider
public boolean listenerDictatesParameterSet()
public boolean listenerHasMetaData()
public AttributeMetaDataList getListenerMetaData()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |