public class FormEntryCaption extends Object implements FormElementStateListener
| Modifier and Type | Class and Description |
|---|---|
class |
FormEntryCaption.RepeatOptions |
| Modifier and Type | Field and Description |
|---|---|
protected IFormElement |
element |
static String |
TEXT_FORM_AUDIO |
static String |
TEXT_FORM_IMAGE |
static String |
TEXT_FORM_LONG |
static String |
TEXT_FORM_SHORT |
static String |
TEXT_FORM_VIDEO |
protected IQuestionWidget |
viewWidget |
CHANGE_DATA, CHANGE_ENABLED, CHANGE_INIT, CHANGE_LOCALE, CHANGE_OTHER, CHANGE_RELEVANT, CHANGE_REQUIRED| Constructor and Description |
|---|
FormEntryCaption()
This empty constructor exists for convenience of any supertypes of this
prompt
|
FormEntryCaption(FormDef form,
FormIndex index)
Creates a FormEntryCaption for the element at the given index in the form.
|
| Modifier and Type | Method and Description |
|---|---|
void |
formElementStateChanged(IFormElement element,
int changeFlags) |
void |
formElementStateChanged(TreeElement instanceNode,
int changeFlags) |
String |
getAppearanceHint() |
String |
getAudioText()
Convenience method
Get audio URI from Text form for THIS element (if available)
|
IFormElement |
getFormElement() |
String |
getImageText()
Convenience method
Get image URI form of text for THIS element (if available)
|
FormIndex |
getIndex() |
protected String |
getIText(String textID,
String form) |
String |
getLongText()
Convenience method
Get longText form of text for THIS element (if available)
!!Falls back to default form if 'long' form does not exist.!!
Use getSpecialFormQuestionText() if you want short form only.
|
int |
getMultiplicity() |
int |
getNumRepetitions() |
String |
getQuestionText()
Same as getQuestionText(String textID), but for the current element textID;
|
String |
getQuestionText(String textID)
Attempts to return question text for this element.
|
FormEntryCaption.RepeatOptions |
getRepeatOptions() |
String |
getRepeatText(String typeKey) |
List<String> |
getRepetitionsText() |
String |
getRepetitionText(boolean newrep) |
String |
getShortText()
Convenience method
Get shortText form of text for THIS element (if available)
!!Falls back to default form if 'short' form does not exist.!!
Use getSpecialFormQuestionText() if you want short form only.
|
String |
getSpecialFormQuestionText(String form)
Same as getSpecialFormQuestionText(String textID,String form) except that the
textID defaults to the textID of the current element.
|
String |
getSpecialFormQuestionText(String textID,
String form)
This method is generally used to retrieve special forms of a
textID, e.g.
|
protected String |
getTextID() |
protected Localizer |
localizer() |
void |
register(IQuestionWidget viewWidget) |
boolean |
repeats() |
protected String |
substituteStringArgs(String templateStr) |
void |
unregister() |
protected IFormElement element
public static final String TEXT_FORM_LONG
public static final String TEXT_FORM_SHORT
public static final String TEXT_FORM_AUDIO
public static final String TEXT_FORM_IMAGE
public static final String TEXT_FORM_VIDEO
protected IQuestionWidget viewWidget
public FormEntryCaption()
public String getLongText()
public String getShortText()
public String getAudioText()
public String getImageText()
public String getQuestionText(String textID)
textID - - The textID of the text you're trying to retrieve. if textID == null will get LabelInnerText for current elementnull if no text for this element exists (after all fallbacks).RunTimeException - if this method is called on an element that is NOT a QuestionDefpublic String getQuestionText()
getQuestionText(String textID)public String getSpecialFormQuestionText(String textID, String form)
textID - - The textID of the text you're trying to retrieve.form - - special text form of textID you're trying to retrieve.null if no text for this element exists (with the specified special form).RunTimeException - if this method is called on an element that is NOT a QuestionDefpublic String getSpecialFormQuestionText(String form)
form - - special text form of textID you're trying to retrieve.null if no text for this element exists (with the specified special form).RunTimeException - if this method is called on an element that is NOT a QuestionDefprotected String getIText(String textID, String form)
textID - - the textID of the text you'd like to retrieveform - - the special form (e.g. "audio","long", etc) of the textpublic int getNumRepetitions()
public String getRepetitionText(boolean newrep)
public FormEntryCaption.RepeatOptions getRepeatOptions()
public String getAppearanceHint()
public int getMultiplicity()
public IFormElement getFormElement()
public boolean repeats()
public FormIndex getIndex()
protected Localizer localizer()
public void register(IQuestionWidget viewWidget)
public void unregister()
public void formElementStateChanged(IFormElement element, int changeFlags)
formElementStateChanged in interface FormElementStateListenerpublic void formElementStateChanged(TreeElement instanceNode, int changeFlags)
formElementStateChanged in interface FormElementStateListenerprotected String getTextID()
Copyright © 2022. All rights reserved.