public class VariableChoice extends MustInputField
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
additionalTagFragments |
protected java.lang.String |
className |
protected java.lang.String[][] |
content |
protected boolean |
editable |
protected java.lang.String |
editBeginValue |
protected boolean |
enabled |
protected int |
format |
protected static int |
FORMAT_KEY_INVISIBLE |
protected static int |
FORMAT_KEY_VISIBLE |
protected java.lang.String |
label |
protected boolean |
required |
protected java.lang.String |
selected |
protected java.lang.String |
selectedItemKey |
protected java.lang.String |
visibleColumnName |
comment, focus, name, placeholder, toolTipText
Constructor and Description |
---|
VariableChoice()
Constructs an new automatically named variable choice to be filler later
by setContent();
|
VariableChoice(KeyValuePair[] keyValuePairs)
Constructs an new variable choice with the specified content.
|
VariableChoice(KeyValuePair[] keyValuePairs,
boolean noChoicePossible)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(java.lang.String name)
Constructs an new variable choice with the specified name and items.
|
VariableChoice(java.lang.String[] items)
Constructs an new automatically named variable choice with the specified items.
|
VariableChoice(java.lang.String[][] content)
Constructs an new automatically named variable choice with the specified items.
|
VariableChoice(java.lang.String name,
KeyValuePair[] keyValuePairs)
Constructs an new variable choice with the specified name and items.
|
VariableChoice(java.lang.String name,
KeyValuePair[] keyValuePairs,
boolean noChoicePossible)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(java.lang.String name,
java.lang.String[] items)
Constructs an new variable choice with the specified name and items.
|
VariableChoice(java.lang.String name,
java.lang.String[][] content)
Constructs an new variable choice with the specified name and content.
|
VariableChoice(java.util.Vector<java.lang.String> items)
Constructs an new automatically named variable choice
|
Modifier and Type | Method and Description |
---|---|
void |
fetchYourValueFromRequest(GeneralizedRequest request)
Causes the component to read user input by calling request.getParameter and
update the internal mirrored value.
|
java.lang.String |
getCreationTag()
Returns the tag sequence that's needed to show this object in the user
interface.
|
java.lang.String |
getLabel()
Returns the component's label.
|
int |
getSelectedIndex()
Returns the index of first item in the list that matches the given item.
|
java.lang.String |
getSelectedItem()
Returns the selected item.
|
java.lang.String |
getSelectedItemKey()
Returns the key of the selected item.
|
boolean |
isFilled()
Returns true if the component has a value.
|
boolean |
isModified()
Indicates whether the component's value differs from its initial value.
|
boolean |
isRequirementUnfulfilled()
Returns true if the component's value is mandatory but not filled.
|
boolean |
isSpecialChoice()
Returns true if the selected item is not the placeholder for "none" or "any".
|
boolean |
isValid()
Returns true if the component's value is valid.
|
void |
setAdditionalTagFragments(java.lang.String additionalTagFragments)
Sets the component's additional tag fragments.
|
void |
setClassName(java.lang.String className)
Sets the component's class name - may be used to assign formatting
via stylesheets.
|
void |
setContent(java.lang.String[] items)
Sets the content of the variable choice.
|
void |
setContent(java.lang.String[][] content)
Sets the content of the variable choice.
|
void |
setContent(java.util.Vector<java.lang.String> items)
Sets the content of the variable choice.
|
static void |
setDefaultAdditionalTagFragments(java.lang.String newDefaultAdditionalTagFragments)
Sets the component's default additional tag fragments.
|
static void |
setDefaultClassName(java.lang.String newDefaultClassName)
Sets the component's default class name - may be used to assign formatting
via stylesheets.
|
static void |
setDefaultNameForNoChoice(java.lang.String newDefaultNameForNoChoice)
Sets the defaultNameForNoChoice.
|
void |
setEditable(boolean editable)
Sets the specified boolean to indicate whether or not this component
should be editable.
|
void |
setEnabled(boolean enabled)
Sets the specified boolean to indicate whether or not this component
is enabled.
|
void |
setName(java.lang.String name)
Sets the component's name
via stylesheets.
|
void |
setRequired(boolean required)
Sets the fact that user input is requested (mandatory)
|
void |
setSelected(java.lang.String stringToSelect)
Selects the item by string to select.
|
void |
setSelectedIndex(int anIndex)
Selects the item by string to select.
|
void |
setSelectedItemKey(java.lang.String key)
Selects the item by its key.
|
void |
setVisible(boolean visible)
Sets the visibility of the component.
|
destroy, getName, setComment, setFocus, setPlaceHolder, setToolTipText, toString
protected java.lang.String label
protected boolean required
protected java.lang.String className
protected java.lang.String additionalTagFragments
protected java.lang.String visibleColumnName
protected java.lang.String[][] content
protected java.lang.String selected
protected java.lang.String selectedItemKey
protected java.lang.String editBeginValue
protected boolean editable
protected boolean enabled
protected static final int FORMAT_KEY_VISIBLE
protected static final int FORMAT_KEY_INVISIBLE
protected int format
public VariableChoice(java.lang.String name)
name
- component's namepublic VariableChoice()
public VariableChoice(java.util.Vector<java.lang.String> items)
items
- the static items of the choice.public VariableChoice(java.lang.String[] items)
items
- the static items of the choice.public VariableChoice(java.lang.String name, java.lang.String[] items)
name
- component's nameitems
- the static items of the choice.public VariableChoice(KeyValuePair[] keyValuePairs)
keyValuePairs
- the content as an array of key value pairspublic VariableChoice(java.lang.String name, KeyValuePair[] keyValuePairs)
name
- component's namekeyValuePairs
- the content as an array of key value pairsitems
- the static items of the choice.public VariableChoice(KeyValuePair[] keyValuePairs, boolean noChoicePossible)
keyValuePairs
- the content as an array of key value pairsnoChoicePossible
- if true, an item is offered which represents the "no choice"public VariableChoice(java.lang.String name, KeyValuePair[] keyValuePairs, boolean noChoicePossible)
name
- component's namekeyValuePairs
- the content as an array of key value pairsnoChoicePossible
- if true, an item is offered which represents the "no choice"public VariableChoice(java.lang.String[][] content)
items
- the static items of the choice.public VariableChoice(java.lang.String name, java.lang.String[][] content)
name
- component's namecontent
- the statically filled content, each line is a pair of key and value.public static void setDefaultNameForNoChoice(java.lang.String newDefaultNameForNoChoice)
defaultNameForNoChoice
- The defaultNameForNoChoice to setpublic static void setDefaultClassName(java.lang.String newDefaultClassName)
newDefaultClassName
- the component's default class namepublic void setClassName(java.lang.String className)
newDefaultClassName
- the component's class namepublic static void setDefaultAdditionalTagFragments(java.lang.String newDefaultAdditionalTagFragments)
newDefaultClassName
- the component's default additional tag fragments.public void setAdditionalTagFragments(java.lang.String additionalTagFragments)
newDefaultClassName
- the component's additional tag fragments.public void setName(java.lang.String name)
name
- the component's namepublic void setEditable(boolean editable)
editable
- indicates whether or not this component is editablepublic void setEnabled(boolean enabled)
enabled
- indicates whether or not this component is enabledpublic void setVisible(boolean visible)
visible
- whether or not the component should be visiblepublic void setContent(java.lang.String[][] content)
content
- the statically filled content, each line is a pair of key and valuepublic void setContent(java.lang.String[] items)
items
- the static items of the choice.public void setContent(java.util.Vector<java.lang.String> items)
items
- the static items of the choice as a vector of Stringspublic void setSelectedIndex(int anIndex)
stringToSelect
- the string to selectpublic void setSelected(java.lang.String stringToSelect)
stringToSelect
- the string to selectpublic java.lang.String getLabel()
public java.lang.String getCreationTag()
public void fetchYourValueFromRequest(GeneralizedRequest request)
fetchYourValueFromRequest
in interface ValueFetcher
fetchYourValueFromRequest
in class MustInputField
request
- the current requestpublic int getSelectedIndex()
public java.lang.String getSelectedItem()
public java.lang.String getSelectedItemKey()
public void setSelectedItemKey(java.lang.String key)
key
- the key of the item to selectpublic boolean isSpecialChoice()
public void setRequired(boolean required)
required
- whether this inuput is mandatory or not.public boolean isFilled()
public boolean isValid()
public boolean isRequirementUnfulfilled()
public boolean isModified()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de