public class VariableChoiceNumKey extends MustInputField
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
additionalTagFragments |
protected java.lang.String |
className |
protected boolean |
editable |
protected int |
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 int |
selectedItemKey |
protected java.lang.String |
visibleColumnName |
comment, focus, name, placeholder, toolTipText
Constructor and Description |
---|
VariableChoiceNumKey(KeyValuePairNum[] keyValuePairs)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoiceNumKey(java.lang.String name,
KeyValuePairNum[] keyValuePairs)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoiceNumKey(java.lang.String name,
KeyValuePairNum[] keyValuePairs,
boolean noChoicePossible)
Constructs an new variable choice with the specified content and offer control.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys the markupable.
|
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.
|
int |
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.
|
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 |
setSelectedIndex(int anIndex)
Selects the item by string to select.
|
void |
setSelectedItemKey(int key)
Selects the item by its key.
|
void |
setVisible(boolean visible)
Sets the visibility of the component.
|
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 int selectedItemKey
protected int 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 VariableChoiceNumKey(KeyValuePairNum[] keyValuePairs)
keyValuePairs
- the content as an array of key value pairspublic VariableChoiceNumKey(java.lang.String name, KeyValuePairNum[] keyValuePairs)
name
- the name of the field to be used for markup parameterskeyValuePairs
- the content as an array of key value pairsnoChoicePossible
- if true, an item is offered which represents the "no choice"public VariableChoiceNumKey(java.lang.String name, KeyValuePairNum[] keyValuePairs, boolean noChoicePossible)
name
- the name of the field to be used for markup parameterskeyValuePairs
- the content as an array of key value pairsnoChoicePossible
- if true, an item is offered which represents the "no choice"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 setSelectedIndex(int anIndex)
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 int getSelectedItemKey()
public void setSelectedItemKey(int 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()
public void destroy()
Markupable
destroy
in interface Markupable
destroy
in class MustInputField
Markupable.destroy()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de