Package org.javarosa.core.model
Class GroupDef
java.lang.Object
org.javarosa.core.model.GroupDef
- All Implemented Interfaces:
IFormElement,Localizable,Externalizable
public class GroupDef extends Object implements IFormElement, Localizable
The definition of a group in a form or questionaire.
- Author:
- Daniel Kayiwa
-
Field Summary
Fields Modifier and Type Field Description StringaddCaptionStringaddEmptyCaptionStringchooseCaptionIDataReferencecountStringdelCaptionStringdelHeaderStringdoneCaptionStringdoneEmptyCaptionStringentryHeaderStringmainHeaderbooleannoAddRemove -
Constructor Summary
Constructors Constructor Description GroupDef()GroupDef(int id, List<IFormElement> children, boolean repeat) -
Method Summary
Modifier and Type Method Description voidaddChild(IFormElement fe)ActionControllergetActionController()StringgetAdditionalAttribute(String namespace, String name)Retrieve the value of an additional attribute on a Question or GroupList<TreeElement>getAdditionalAttributes()Retrieve all additional attributes on a Question or GroupStringgetAppearanceAttr()IDataReferencegetBind()IFormElementgetChild(int i)List<IFormElement>getChildren()TreeReferencegetConextualizedCountReference(TreeReference context)IDataReferencegetCountReference()intgetDeepChildCount()intgetID()StringgetLabelInnerText()This method returns the regular innertext betweem label tags (if present) (<label>innertext</label>).booleangetRepeat()StringgetTextID()get the TextID for this element used for localization purposesvoidlocaleChanged(String locale, Localizer localizer)Updates the current object with the locate given.voidreadExternal(DataInputStream dis, PrototypeFactory pf)Reads a group definition object from the supplied stream.voidregisterStateObserver(FormElementStateListener qsl)Registers a state observer for this element.voidsetAdditionalAttribute(String namespace, String name, String value)Capture additional attributes on a Question or GroupvoidsetAppearanceAttr(String appearanceAttr)voidsetBind(IDataReference binding)voidsetChildren(List<IFormElement> children)voidsetID(int id)voidsetLabelInnerText(String lit)voidsetRepeat(boolean repeat)voidsetTextID(String textID)Set the textID for this element for use with localization.StringtoString()voidunregisterStateObserver(FormElementStateListener qsl)Unregisters a state observer for this element.voidwriteExternal(DataOutputStream dos)Write the group definition object to the supplied stream.
-
Field Details
-
chooseCaption
-
addCaption
-
delCaption
-
doneCaption
-
addEmptyCaption
-
doneEmptyCaption
-
entryHeader
-
delHeader
-
mainHeader
-
noAddRemove
public boolean noAddRemove -
count
-
-
Constructor Details
-
Method Details
-
getID
public int getID()- Specified by:
getIDin interfaceIFormElement- Returns:
- The unique ID of this element
-
setID
public void setID(int id)- Specified by:
setIDin interfaceIFormElement- Parameters:
id- The new unique ID of this element
-
getBind
- Specified by:
getBindin interfaceIFormElement- Returns:
- The data reference for this element
-
setBind
-
setAdditionalAttribute
Description copied from interface:IFormElementCapture additional attributes on a Question or Group- Specified by:
setAdditionalAttributein interfaceIFormElement
-
getAdditionalAttribute
Description copied from interface:IFormElementRetrieve the value of an additional attribute on a Question or Group- Specified by:
getAdditionalAttributein interfaceIFormElement- Returns:
-
getAdditionalAttributes
Description copied from interface:IFormElementRetrieve all additional attributes on a Question or Group- Specified by:
getAdditionalAttributesin interfaceIFormElement- Returns:
-
getChildren
- Specified by:
getChildrenin interfaceIFormElement- Returns:
- A List containing any children that this element might have. Null if the element is not able to have child elements.
-
setChildren
- Specified by:
setChildrenin interfaceIFormElement- Parameters:
children- the children of this element, if it is capable of having child elements.
-
addChild
- Specified by:
addChildin interfaceIFormElement- Parameters:
fe- The child element to be added
-
getChild
- Specified by:
getChildin interfaceIFormElement
-
getRepeat
public boolean getRepeat()- Returns:
- true if this represents a
element
-
setRepeat
public void setRepeat(boolean repeat) -
getLabelInnerText
Description copied from interface:IFormElementThis method returns the regular innertext betweem label tags (if present) (<label>innertext</label>).- Specified by:
getLabelInnerTextin interfaceIFormElement- Returns:
- <label> innertext or null (if innertext is not present).
-
setLabelInnerText
-
getAppearanceAttr
- Specified by:
getAppearanceAttrin interfaceIFormElement- Returns:
-
setAppearanceAttr
- Specified by:
setAppearanceAttrin interfaceIFormElement
-
getActionController
- Specified by:
getActionControllerin interfaceIFormElement
-
localeChanged
Description copied from interface:LocalizableUpdates the current object with the locate given.- Specified by:
localeChangedin interfaceLocalizable
-
getCountReference
-
getConextualizedCountReference
-
toString
-
getDeepChildCount
public int getDeepChildCount()- Specified by:
getDeepChildCountin interfaceIFormElement- Returns:
- A recursive count of how many elements are ancestors of this element.
-
readExternal
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationExceptionReads a group definition object from the supplied stream.- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionDeserializationException
-
writeExternal
Write the group definition object to the supplied stream.- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
registerStateObserver
Description copied from interface:IFormElementRegisters a state observer for this element.- Specified by:
registerStateObserverin interfaceIFormElement
-
unregisterStateObserver
Description copied from interface:IFormElementUnregisters a state observer for this element.- Specified by:
unregisterStateObserverin interfaceIFormElement
-
getTextID
Description copied from interface:IFormElementget the TextID for this element used for localization purposes- Specified by:
getTextIDin interfaceIFormElement- Returns:
- the TextID (bare, no ;form appended to it!!)
-
setTextID
Description copied from interface:IFormElementSet the textID for this element for use with localization.- Specified by:
setTextIDin interfaceIFormElement- Parameters:
textID- the plain TextID WITHOUT any form specification (e.g. ;long)
-