public class QuestionDef extends java.lang.Object implements IFormElement, Localizable
Modifier and Type | Field and Description |
---|---|
private java.util.List<TreeElement> |
additionalAttributes |
private java.lang.String |
appearanceAttr |
private IDataReference |
binding |
private java.util.List<SelectChoice> |
choices |
private int |
controlType
reference to a location in the model to store data in
|
private ItemsetBinding |
dynamicChoices |
private java.lang.String |
helpInnerText |
private java.lang.String |
helpText |
private java.lang.String |
helpTextID |
private int |
id |
private java.lang.String |
labelInnerText |
(package private) java.util.List<FormElementStateListener> |
observers |
private java.lang.String |
textID |
Constructor and Description |
---|
QuestionDef() |
QuestionDef(int id,
int controlType) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(IFormElement fe) |
void |
addSelectChoice(SelectChoice choice) |
void |
alertStateObservers(int changeFlags) |
java.lang.String |
getAdditionalAttribute(java.lang.String namespace,
java.lang.String name)
Retrieve the value of an additional attribute on a Question or Group
|
java.util.List<TreeElement> |
getAdditionalAttributes()
Retrieve all additional attributes on a Question or Group
|
java.lang.String |
getAppearanceAttr() |
IDataReference |
getBind() |
IFormElement |
getChild(int i) |
java.util.List<IFormElement> |
getChildren() |
SelectChoice |
getChoice(int i) |
SelectChoice |
getChoiceForValue(java.lang.String value) |
java.util.List<SelectChoice> |
getChoices() |
int |
getControlType() |
int |
getDeepChildCount() |
ItemsetBinding |
getDynamicChoices() |
java.lang.String |
getHelpInnerText() |
java.lang.String |
getHelpText()
Only if there is no localizable version of the <hint> available should this method be used
|
java.lang.String |
getHelpTextID() |
int |
getID() |
java.lang.String |
getLabelInnerText()
This method returns the regular
innertext betweem label tags (if present) (<label>innertext</label>).
|
int |
getNumChoices() |
java.lang.String |
getTextID()
get the TextID for this element used for localization purposes
|
boolean |
isComplex()
true if the answer to this question yields xml tree data, not a simple string value
|
void |
localeChanged(java.lang.String locale,
Localizer localizer)
Updates the current object with the locate given.
|
void |
readExternal(java.io.DataInputStream dis,
PrototypeFactory pf) |
void |
registerStateObserver(FormElementStateListener qsl)
Registers a state observer for this element.
|
void |
removeAllSelectChoices() |
void |
removeSelectChoice(SelectChoice choice) |
void |
setAdditionalAttribute(java.lang.String namespace,
java.lang.String name,
java.lang.String value)
Capture additional attributes on a Question or Group
|
void |
setAppearanceAttr(java.lang.String appearanceAttr) |
void |
setBind(IDataReference binding) |
void |
setChildren(java.util.List<IFormElement> v) |
void |
setControlType(int controlType) |
void |
setDynamicChoices(ItemsetBinding ib) |
void |
setHelpInnerText(java.lang.String helpInnerText) |
void |
setHelpText(java.lang.String helpText)
Only if there is no localizable version of the <hint>available should this method be used
|
void |
setHelpTextID(java.lang.String textID) |
void |
setID(int id) |
void |
setLabelInnerText(java.lang.String labelInnerText) |
void |
setTextID(java.lang.String textID)
Set the textID for this element for use with localization.
|
void |
unregisterAll() |
void |
unregisterStateObserver(FormElementStateListener qsl)
Unregisters a state observer for this element.
|
void |
writeExternal(java.io.DataOutputStream dos) |
private int id
private IDataReference binding
private int controlType
private java.lang.String appearanceAttr
private java.lang.String helpTextID
private java.lang.String labelInnerText
private java.lang.String helpText
private java.lang.String textID
private java.lang.String helpInnerText
private java.util.List<TreeElement> additionalAttributes
private java.util.List<SelectChoice> choices
private ItemsetBinding dynamicChoices
java.util.List<FormElementStateListener> observers
public QuestionDef()
public QuestionDef(int id, int controlType)
public int getID()
getID
in interface IFormElement
public void setID(int id)
setID
in interface IFormElement
id
- The new unique ID of this elementpublic IDataReference getBind()
getBind
in interface IFormElement
public void setBind(IDataReference binding)
public int getControlType()
public void setControlType(int controlType)
public java.lang.String getAppearanceAttr()
getAppearanceAttr
in interface IFormElement
public void setAppearanceAttr(java.lang.String appearanceAttr)
setAppearanceAttr
in interface IFormElement
public java.lang.String getHelpText()
public void setHelpText(java.lang.String helpText)
public void setAdditionalAttribute(java.lang.String namespace, java.lang.String name, java.lang.String value)
IFormElement
setAdditionalAttribute
in interface IFormElement
public java.lang.String getAdditionalAttribute(java.lang.String namespace, java.lang.String name)
IFormElement
getAdditionalAttribute
in interface IFormElement
public java.util.List<TreeElement> getAdditionalAttributes()
IFormElement
getAdditionalAttributes
in interface IFormElement
public java.lang.String getHelpTextID()
public void setHelpTextID(java.lang.String textID)
public void addSelectChoice(SelectChoice choice)
public void removeSelectChoice(SelectChoice choice)
public void removeAllSelectChoices()
public java.util.List<SelectChoice> getChoices()
public SelectChoice getChoice(int i)
public int getNumChoices()
public SelectChoice getChoiceForValue(java.lang.String value)
public ItemsetBinding getDynamicChoices()
public void setDynamicChoices(ItemsetBinding ib)
public boolean isComplex()
public void localeChanged(java.lang.String locale, Localizer localizer)
Localizable
localeChanged
in interface Localizable
public java.util.List<IFormElement> getChildren()
getChildren
in interface IFormElement
public void setChildren(java.util.List<IFormElement> v)
setChildren
in interface IFormElement
v
- the children of this element, if it is capable of having
child elements.public void addChild(IFormElement fe)
addChild
in interface IFormElement
fe
- The child element to be addedpublic IFormElement getChild(int i)
getChild
in interface IFormElement
public void readExternal(java.io.DataInputStream dis, PrototypeFactory pf) throws java.io.IOException, DeserializationException
readExternal
in interface Externalizable
java.io.IOException
DeserializationException
public void writeExternal(java.io.DataOutputStream dos) throws java.io.IOException
writeExternal
in interface Externalizable
java.io.IOException
public void registerStateObserver(FormElementStateListener qsl)
IFormElement
registerStateObserver
in interface IFormElement
public void unregisterStateObserver(FormElementStateListener qsl)
IFormElement
unregisterStateObserver
in interface IFormElement
public void unregisterAll()
public void alertStateObservers(int changeFlags)
public int getDeepChildCount()
getDeepChildCount
in interface IFormElement
public void setLabelInnerText(java.lang.String labelInnerText)
public java.lang.String getLabelInnerText()
IFormElement
getLabelInnerText
in interface IFormElement
public void setHelpInnerText(java.lang.String helpInnerText)
public java.lang.String getHelpInnerText()
public java.lang.String getTextID()
IFormElement
getTextID
in interface IFormElement
public void setTextID(java.lang.String textID)
IFormElement
setTextID
in interface IFormElement
textID
- the plain TextID WITHOUT any form specification (e.g. ;long)