public class FormEntryCaption extends java.lang.Object implements FormElementStateListener
Modifier and Type | Class and Description |
---|---|
class |
FormEntryCaption.RepeatOptions |
Modifier and Type | Field and Description |
---|---|
protected IFormElement |
element |
(package private) FormDef |
form |
(package private) FormIndex |
index |
static java.lang.String |
TEXT_FORM_AUDIO |
static java.lang.String |
TEXT_FORM_IMAGE |
static java.lang.String |
TEXT_FORM_LONG |
static java.lang.String |
TEXT_FORM_SHORT |
static java.lang.String |
TEXT_FORM_VIDEO |
private java.lang.String |
textID |
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) |
java.lang.String |
getAppearanceHint() |
java.lang.String |
getAudioText()
Convenience method
Get audio URI from Text form for THIS element (if available)
|
IFormElement |
getFormElement() |
java.lang.String |
getImageText()
Convenience method
Get image URI form of text for THIS element (if available)
|
FormIndex |
getIndex() |
protected java.lang.String |
getIText(java.lang.String textID,
java.lang.String form) |
java.lang.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() |
java.lang.String |
getQuestionText()
Same as getQuestionText(String textID), but for the current element textID;
|
java.lang.String |
getQuestionText(java.lang.String textID)
Attempts to return question text for this element.
|
FormEntryCaption.RepeatOptions |
getRepeatOptions() |
java.lang.String |
getRepeatText(java.lang.String typeKey) |
java.util.List<java.lang.String> |
getRepetitionsText() |
java.lang.String |
getRepetitionText(boolean newrep) |
private java.lang.String |
getRepetitionText(java.lang.String type,
FormIndex index,
boolean newrep) |
java.lang.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.
|
java.lang.String |
getSpecialFormQuestionText(java.lang.String form)
Same as getSpecialFormQuestionText(String textID,String form) except that the
textID defaults to the textID of the current element.
|
java.lang.String |
getSpecialFormQuestionText(java.lang.String textID,
java.lang.String form)
This method is generally used to retrieve special forms of a
textID, e.g.
|
protected java.lang.String |
getTextID() |
protected Localizer |
localizer() |
void |
register(IQuestionWidget viewWidget) |
boolean |
repeats() |
protected java.lang.String |
substituteStringArgs(java.lang.String templateStr) |
void |
unregister() |
FormDef form
FormIndex index
protected IFormElement element
private java.lang.String textID
public static final java.lang.String TEXT_FORM_LONG
public static final java.lang.String TEXT_FORM_SHORT
public static final java.lang.String TEXT_FORM_AUDIO
public static final java.lang.String TEXT_FORM_IMAGE
public static final java.lang.String TEXT_FORM_VIDEO
protected IQuestionWidget viewWidget
public FormEntryCaption()
public java.lang.String getLongText()
public java.lang.String getShortText()
public java.lang.String getAudioText()
public java.lang.String getImageText()
public java.lang.String getQuestionText(java.lang.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 java.lang.String getQuestionText()
getQuestionText(String textID)
public java.lang.String getSpecialFormQuestionText(java.lang.String textID, java.lang.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 java.lang.String getSpecialFormQuestionText(java.lang.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 java.lang.String getIText(java.lang.String textID, java.lang.String form)
textID
- - the textID of the text you'd like to retrieveform
- - the special form (e.g. "audio","long", etc) of the textpublic java.lang.String getRepeatText(java.lang.String typeKey)
public int getNumRepetitions()
public java.lang.String getRepetitionText(boolean newrep)
private java.lang.String getRepetitionText(java.lang.String type, FormIndex index, boolean newrep)
public java.util.List<java.lang.String> getRepetitionsText()
public FormEntryCaption.RepeatOptions getRepeatOptions()
public java.lang.String getAppearanceHint()
protected java.lang.String substituteStringArgs(java.lang.String templateStr)
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 FormElementStateListener
public void formElementStateChanged(TreeElement instanceNode, int changeFlags)
formElementStateChanged
in interface FormElementStateListener
protected java.lang.String getTextID()