www.element4solution.com

e4s.html.input.extended
Class E4SelectValues

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.input.extended.E4SelectValues
Direct Known Subclasses:
E4SelectValuesAjax

public class E4SelectValues
extends E4Object

Selection values for SELECT input-fields.

See Also:
SELECT, E4SelectValuesFieldDependent

Nested Class Summary
static class E4SelectValues.OPTION
          Option for the selection.
static class E4SelectValues.OPTIONGROUP
          A optiongroup defines a grouping in <OPTION>-tags for a SELECT element.
 
Field Summary
protected  CLASS_Name m_css_class
           
protected  java.util.Vector m_vec
           
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
E4SelectValues()
           
E4SelectValues(E4DBSelect_Intf sel, E4DBColumnName column)
          Use the database selection (represented by declared select object).
E4SelectValues(java.lang.String[] selection)
           
E4SelectValues(java.util.Vector vec)
          Deprecated.  
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void add(E4SelectValues.OPTION option)
          Deprecated.  
 void addAll(E4SelectValues val2)
          Add a complete vector to this selection vector.
 E4SelectValues.OPTION addElement(boolean option, E4Label_Intf display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(boolean option, java.lang.String display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(char option, E4Label_Intf display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(char option, java.lang.String display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(E4Long option, E4Label_Intf display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(E4Long option, java.lang.String display)
          Add an element to the selection vector.
 void addElement(E4SelectValues.OPTION option)
          Add an element to the selection vector.
 void addElement(E4SelectValues.OPTIONGROUP optiongroup)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(E4String option)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(E4String option, E4Label_Intf display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(E4String option, java.lang.String display)
          Add an element to the selection vector.
 void addElement(int n)
           
 E4SelectValues.OPTION addElement(long option, E4Label_Intf display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(long option, E4String display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(long option, java.lang.String display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(java.lang.String option)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(java.lang.String option, E4Label_Intf display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(java.lang.String option, E4String display)
          Add an element to the selection vector.
 E4SelectValues.OPTION addElement(java.lang.String option, java.lang.String display)
          Add an element to the selection vector.
 E4SelectValues addOptionGroup(E4Label_Intf label)
          Adds an <OPTGROUP>-Tag to the <SELECT> tag.
 E4SelectValues.OPTIONGROUP addOptionGroup(E4Label_Intf label, E4SelectValues val)
          Adds an <OPTGROUP>-Tag to the <SELECT> tag.
 E4SelectValues addOptionGroup(java.lang.String label)
          Adds an <OPTGROUP>-Tag to the <SELECT> tag.
 E4SelectValues.OPTIONGROUP addOptionGroup(java.lang.String label, E4SelectValues val)
          Adds an <OPTGROUP>-Tag to the <SELECT> tag.
 java.lang.Class classAt(int i)
          Check the class of the element at the specified position, this might be either #OPTION or #OPTIONGROUP.
 void collectStylesForEditing(E4StylesHash v, E4ServletImplementation_Intf servlet)
           
 void collectTranslationsForEditing(E4TranslationsVec translations, E4ServletImplementation_Intf servlet)
           
 int countValidElements()
           
static E4SelectValues createMonthSelection()
          Creates a selection by month, based on Calendar.MONTH values.
static E4SelectValues createRangeSelection(int range_from, int range_to, int range_increment)
          Create a selection range out of two integer numbers and an incremental value.
static E4SelectValues createWeekdaySelection()
          Creates a selection by weekday, based on Calendar.DAY_OF_WEEK values.
static E4SelectValues createYesNoSelection()
          Creates a selection by weekday, based on Calendar.DAY_OF_WEEK values.
 E4SelectValues.OPTION elementAt(int i)
          Get the element at the specified position
 E4Label_Intf findOption(java.lang.String searchFor)
          Get the label associated with a specified option value.
 E4Label_Intf firstOptionLabel()
          Get the label for the first option, including looking in all sub selections.
 java.lang.String firstOptionValue()
          Get the first option value, including looking in all sub selections.
 java.lang.String getDefaultValue()
          Get the default value for this selector.
 boolean getEncodehtmlDisplaytext()
           
 boolean getEncodehtmlOptionvalue()
           
 E4SelectValues.OPTION[] getOptionsIncludingSub()
           
 CLASS_Name getSTYLE()
           
 void removeAll()
          Remove all options.
 void setDefaultValue(boolean val)
          Set the default value for this selector.
 void setDefaultValue(E4Long val)
          Set the default value for this selector.
 void setDefaultValue(E4String val)
          Set the default value for this selector.
 void setDefaultValue(long val)
          Set the default value for this selector.
 void setDefaultValue(java.lang.String val)
          Set the default value for this selector.
 void setEncodehtmlDisplaytext(boolean m_encodehtml_displaytext)
           
 void setEncodehtmlOptionvalue(boolean m_encodehtml_value)
           
 void setSTYLE(CLASS_Name css_class)
           
 void showUntranslatedInBrackets(boolean mode)
          Change the current display behavior for non-translated items.
 int size()
          Get the number of elements in the vector (no sub elements).
 int sizeIncludingSub()
          Get the number of elements in the vector (including sub elements defined by addOptionGroup(String) and others.
 void sort(Language dest_lang)
          Sort a Vector of OPTIONS objects ascending.
 java.lang.StringBuffer toHtmlOptions(java.lang.String sValue, boolean displayonly, Language dest_lang)
           
protected  java.lang.StringBuffer toHtmlOptions(java.lang.String sValue, boolean displayonly, Language dest_lang, int sizeElements, E4SelectValues selection)
           
 java.lang.String toString()
           
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_vec

protected java.util.Vector m_vec

m_css_class

protected CLASS_Name m_css_class
Constructor Detail

E4SelectValues

public E4SelectValues()

E4SelectValues

public E4SelectValues(java.lang.String[] selection)

E4SelectValues

public E4SelectValues(java.util.Vector vec)
Deprecated. 

See Also:
E4SelectValues()

E4SelectValues

public E4SelectValues(E4DBSelect_Intf sel,
                      E4DBColumnName column)
               throws java.lang.Exception
Use the database selection (represented by declared select object).

Parameters:
sel - a database seelction
column - the column to be used for both, value and label
Throws:
java.lang.Exception
Method Detail

getEncodehtmlOptionvalue

public boolean getEncodehtmlOptionvalue()

setEncodehtmlOptionvalue

public void setEncodehtmlOptionvalue(boolean m_encodehtml_value)

getEncodehtmlDisplaytext

public boolean getEncodehtmlDisplaytext()

setEncodehtmlDisplaytext

public void setEncodehtmlDisplaytext(boolean m_encodehtml_displaytext)

addOptionGroup

public E4SelectValues.OPTIONGROUP addOptionGroup(java.lang.String label,
                                                 E4SelectValues val)
Adds an <OPTGROUP>-Tag to the <SELECT> tag. The <OPTGROUP> can contain <OPTION> elements.

Parameters:
label - the label which is displayed in the SELECT element.
val - the sub-values of the option-group.
Returns:
the new created and already added option-group
See Also:
addOptionGroup(e4s.translate.E4Label_Intf,e4s.html.input.extended.E4SelectValues), addOptionGroup(String), addOptionGroup(e4s.translate.E4Label_Intf)

addOptionGroup

public E4SelectValues addOptionGroup(java.lang.String label)
Adds an <OPTGROUP>-Tag to the <SELECT> tag. The <OPTGROUP> can contain <OPTION> elements.

Parameters:
label - the label which is displayed in the SELECT element.
Returns:
the new created and already added E4SelectValues
See Also:
addOptionGroup(String,e4s.html.input.extended.E4SelectValues), addOptionGroup(e4s.translate.E4Label_Intf)

addOptionGroup

public E4SelectValues addOptionGroup(E4Label_Intf label)
Adds an <OPTGROUP>-Tag to the <SELECT> tag. The <OPTGROUP> can contain <OPTION> elements.

Parameters:
label - the label which is displayed in the SELECT element.
Returns:
the new created and already added E4SelectValues
See Also:
addOptionGroup(e4s.translate.E4Label_Intf,e4s.html.input.extended.E4SelectValues), addOptionGroup(String,e4s.html.input.extended.E4SelectValues), addOptionGroup(String)

addOptionGroup

public E4SelectValues.OPTIONGROUP addOptionGroup(E4Label_Intf label,
                                                 E4SelectValues val)
Adds an <OPTGROUP>-Tag to the <SELECT> tag. The <OPTGROUP> can contain <OPTION> elements.

Parameters:
label - the label which is displayed in the SELECT element.
val - the sub-values of the option-group.
Returns:
the new created and already added option-group
See Also:
addOptionGroup(String,e4s.html.input.extended.E4SelectValues), addOptionGroup(String), #addOptionGroup(e4s.html.translate.E4Label_Intf)

add

public void add(E4SelectValues.OPTION option)
Deprecated. 

See Also:
addElement(e4s.html.input.extended.E4SelectValues.OPTION)

addElement

public void addElement(E4SelectValues.OPTION option)
Add an element to the selection vector.

Parameters:
option - the new option value to be added
See Also:
addElement(String), addElement(String,String)

addElement

public void addElement(E4SelectValues.OPTIONGROUP optiongroup)
Add an element to the selection vector.

Parameters:
optiongroup - the new option-group to be added
See Also:
addOptionGroup(java.lang.String, e4s.html.input.extended.E4SelectValues)

addAll

public void addAll(E4SelectValues val2)
Add a complete vector to this selection vector.

Parameters:
val2 - the vector to be added.

addElement

public E4SelectValues.OPTION addElement(java.lang.String option,
                                        java.lang.String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(java.lang.String option,
                                        E4Label_Intf display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(char option,
                                        java.lang.String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(char option,
                                        E4Label_Intf display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(E4String option,
                                        java.lang.String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(E4String option,
                                        E4Label_Intf display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(E4Long option,
                                        java.lang.String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(E4Long option,
                                        E4Label_Intf display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(long option,
                                        java.lang.String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(boolean option,
                                        java.lang.String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(boolean option,
                                        E4Label_Intf display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(long option,
                                        E4Label_Intf display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(java.lang.String option,
                                        E4String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(long option,
                                        E4String display)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value (internally)
display - is the label that is shown on the screen and present for the user
See Also:
addElement(String)

addElement

public E4SelectValues.OPTION addElement(java.lang.String option)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value and display
See Also:
addElement(String, String)

addElement

public E4SelectValues.OPTION addElement(E4String option)
Add an element to the selection vector.

Parameters:
option - is the value associated with the field value and display
See Also:
addElement(String, String)

size

public int size()
Get the number of elements in the vector (no sub elements).

Returns:
the number of elements
See Also:
elementAt(int), sizeIncludingSub()

sizeIncludingSub

public int sizeIncludingSub()
Get the number of elements in the vector (including sub elements defined by addOptionGroup(String) and others.

Returns:
the number of elements
See Also:
#elementAt()

elementAt

public E4SelectValues.OPTION elementAt(int i)
                                throws java.lang.Exception
Get the element at the specified position

Parameters:
i - the index of the element
Returns:
null if no values are defined, or the element at position i
Throws:
an - exception, if the element at the specified position is not of type #OPTION
java.lang.Exception
See Also:
size()

classAt

public java.lang.Class classAt(int i)
Check the class of the element at the specified position, this might be either #OPTION or #OPTIONGROUP.

Parameters:
i - the index of the element
Returns:
null if no values are defined, or the class of the element at position i
See Also:
elementAt(int)

getOptionsIncludingSub

public E4SelectValues.OPTION[] getOptionsIncludingSub()

collectTranslationsForEditing

public void collectTranslationsForEditing(E4TranslationsVec translations,
                                          E4ServletImplementation_Intf servlet)

sort

public void sort(Language dest_lang)
Sort a Vector of OPTIONS objects ascending.

Parameters:
v - the vector to sort (v will be changed)

countValidElements

public int countValidElements()

toHtmlOptions

public java.lang.StringBuffer toHtmlOptions(java.lang.String sValue,
                                            boolean displayonly,
                                            Language dest_lang)

toHtmlOptions

protected java.lang.StringBuffer toHtmlOptions(java.lang.String sValue,
                                               boolean displayonly,
                                               Language dest_lang,
                                               int sizeElements,
                                               E4SelectValues selection)

showUntranslatedInBrackets

public void showUntranslatedInBrackets(boolean mode)
Change the current display behavior for non-translated items. By default, if a translation is not found then the text will be displayed in original text and language instead of the translated text. To give the user a feedback about this missing translation, the non-translated text in original language in this case will be displayed included in [ ] brackets.

Parameters:
mode - true = show un-translated text in brackets (default), false = no brackets
See Also:
e4s.translate.E4Label_Intf#showUntranslatedInBrackets(boolean)

createRangeSelection

public static E4SelectValues createRangeSelection(int range_from,
                                                  int range_to,
                                                  int range_increment)
Create a selection range out of two integer numbers and an incremental value.

Parameters:
range_from - the range starting from
range_to - the range ending (including)
range_increment - a positive increment value.

createMonthSelection

public static E4SelectValues createMonthSelection()
Creates a selection by month, based on Calendar.MONTH values.

Returns:
the new created month selection.

createWeekdaySelection

public static E4SelectValues createWeekdaySelection()
Creates a selection by weekday, based on Calendar.DAY_OF_WEEK values.

Returns:
the new created weekday selection.

createYesNoSelection

public static E4SelectValues createYesNoSelection()
Creates a selection by weekday, based on Calendar.DAY_OF_WEEK values.

Returns:
the new created weekday selection.

setDefaultValue

public void setDefaultValue(java.lang.String val)
Set the default value for this selector.

See Also:
E4InputField.setValue(String), getDefaultValue(), setDefaultValue(long)

setDefaultValue

public void setDefaultValue(long val)
Set the default value for this selector.

See Also:
E4InputField.setValue(String), getDefaultValue(), setDefaultValue(String)

setDefaultValue

public void setDefaultValue(E4String val)
Set the default value for this selector.

See Also:
E4InputField.setValue(String), getDefaultValue(), setDefaultValue(long)

setDefaultValue

public void setDefaultValue(E4Long val)
Set the default value for this selector.

See Also:
E4InputField.setValue(String), getDefaultValue(), setDefaultValue(String)

setDefaultValue

public void setDefaultValue(boolean val)
Set the default value for this selector.

See Also:
E4InputField.setValue(String), getDefaultValue(), setDefaultValue(String)

getDefaultValue

public java.lang.String getDefaultValue()
Get the default value for this selector.

See Also:
E4InputField.setValue(String), setDefaultValue(String)

findOption

public E4Label_Intf findOption(java.lang.String searchFor)
Get the label associated with a specified option value.

Parameters:
searchFor - the string to search for
Returns:
null if not found or the label.

addElement

public void addElement(int n)

removeAll

public void removeAll()
Remove all options.


collectStylesForEditing

public void collectStylesForEditing(E4StylesHash v,
                                    E4ServletImplementation_Intf servlet)

setSTYLE

public void setSTYLE(CLASS_Name css_class)

getSTYLE

public CLASS_Name getSTYLE()

firstOptionValue

public java.lang.String firstOptionValue()
Get the first option value, including looking in all sub selections.

Returns:
the first option or null if not found
See Also:
#getFirstOptionLabel()

firstOptionLabel

public E4Label_Intf firstOptionLabel()
Get the label for the first option, including looking in all sub selections.

Returns:
the first option or null if not found
See Also:
#getFirstOptionValue()

toString

public java.lang.String toString()
Overrides:
toString in class E4Object

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com