Openfire 3.6.1 Javadoc

org.jivesoftware.openfire.forms
Interface FormField

All Known Implementing Classes:
XFormFieldImpl

public interface FormField

Represents a field of a form. The field could be used to represent a question to complete, a completed question or a data returned from a search. The exact interpretation of the field depends on the context where the field is used.

Author:
Gaston Dombiak

Field Summary
static String TYPE_BOOLEAN
           
static String TYPE_FIXED
           
static String TYPE_HIDDEN
           
static String TYPE_JID_MULTI
           
static String TYPE_JID_SINGLE
           
static String TYPE_LIST_MULTI
           
static String TYPE_LIST_SINGLE
           
static String TYPE_TEXT_MULTI
           
static String TYPE_TEXT_PRIVATE
           
static String TYPE_TEXT_SINGLE
           
 
Method Summary
 void addOption(String label, String value)
          Adds an available option to the question that the user has in order to answer the question.
 void addValue(String value)
          Adds a default value to the question if the question is part of a form to fill out.
 void clearValues()
          Removes all the values of the field.
 String getDescription()
          Returns a description that provides extra clarification about the question.
 String getLabel()
          Returns the label of the question which should give enough information to the user to fill out the form.
 String getType()
          Returns an indicative of the format for the data to answer.
 Iterator<String> getValues()
          Returns an Iterator for the default values of the question if the question is part of a form to fill out.
 String getVariable()
          Returns the variable name that the question is filling out.
 boolean isRequired()
          Returns true if the question must be answered in order to complete the questionnaire.
 void setDescription(String description)
          Sets a description that provides extra clarification about the question.
 void setLabel(String label)
          Sets the label of the question which should give enough information to the user to fill out the form.
 void setRequired(boolean required)
          Sets if the question must be answered in order to complete the questionnaire.
 void setType(String type)
          Sets an indicative of the format for the data to answer.
 

Field Detail

TYPE_BOOLEAN

static final String TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_FIXED

static final String TYPE_FIXED
See Also:
Constant Field Values

TYPE_HIDDEN

static final String TYPE_HIDDEN
See Also:
Constant Field Values

TYPE_JID_MULTI

static final String TYPE_JID_MULTI
See Also:
Constant Field Values

TYPE_JID_SINGLE

static final String TYPE_JID_SINGLE
See Also:
Constant Field Values

TYPE_LIST_MULTI

static final String TYPE_LIST_MULTI
See Also:
Constant Field Values

TYPE_LIST_SINGLE

static final String TYPE_LIST_SINGLE
See Also:
Constant Field Values

TYPE_TEXT_MULTI

static final String TYPE_TEXT_MULTI
See Also:
Constant Field Values

TYPE_TEXT_PRIVATE

static final String TYPE_TEXT_PRIVATE
See Also:
Constant Field Values

TYPE_TEXT_SINGLE

static final String TYPE_TEXT_SINGLE
See Also:
Constant Field Values
Method Detail

addValue

void addValue(String value)
Adds a default value to the question if the question is part of a form to fill out. Otherwise, adds an answered value to the question.

Parameters:
value - a default value or an answered value of the question.

clearValues

void clearValues()
Removes all the values of the field.


addOption

void addOption(String label,
               String value)
Adds an available option to the question that the user has in order to answer the question.

Parameters:
label - a label that represents the option.
value - the value of the option.

setType

void setType(String type)
Sets an indicative of the format for the data to answer. Valid formats are:

Parameters:
type - an indicative of the format for the data to answer.

setRequired

void setRequired(boolean required)
Sets if the question must be answered in order to complete the questionnaire.

Parameters:
required - if the question must be answered in order to complete the questionnaire.

setLabel

void setLabel(String label)
Sets the label of the question which should give enough information to the user to fill out the form.

Parameters:
label - the label of the question.

setDescription

void setDescription(String description)
Sets a description that provides extra clarification about the question. This information could be presented to the user either in tool-tip, help button, or as a section of text before the question.

If the question is of type FIXED then the description should remain empty.

Parameters:
description - provides extra clarification about the question.

isRequired

boolean isRequired()
Returns true if the question must be answered in order to complete the questionnaire.

Returns:
true if the question must be answered in order to complete the questionnaire.

getVariable

String getVariable()
Returns the variable name that the question is filling out.

Returns:
the variable name of the question.

getValues

Iterator<String> getValues()
Returns an Iterator for the default values of the question if the question is part of a form to fill out. Otherwise, returns an Iterator for the answered values of the question.

Returns:
an Iterator for the default values or answered values of the question.

getType

String getType()
Returns an indicative of the format for the data to answer. Valid formats are:

Returns:
format for the data to answer.

getLabel

String getLabel()
Returns the label of the question which should give enough information to the user to fill out the form.

Returns:
label of the question.

getDescription

String getDescription()
Returns a description that provides extra clarification about the question. This information could be presented to the user either in tool-tip, help button, or as a section of text before the question.

If the question is of type FIXED then the description should remain empty.

Returns:
description that provides extra clarification about the question.

Openfire 3.6.1 Javadoc

Copyright © 2003-2008 Jive Software.