Class AbstractGomFormElement
java.lang.Object
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomFormElement
- All Implemented Interfaces:
GomCheckable
,GomElement
,GomFormElement
,GomHideable
,GomLangInfoProvider
,GomSearchRelevancy
,LineBreakable
,Serializable
public abstract class AbstractGomFormElement
extends AbstractGomElement
implements GomFormElement, GomCheckable, LineBreakable, GomSearchRelevancy
Abstract class defining most common features of a form element.
For using an extended language information container when subclassing, the extended container must subclass DefaultGomLangInfos
andoverride getLangInfos()
!
- Since:
- 4.0.17
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomCheckable
GomCheckable.Context
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates, whether empty values are allowed.boolean
breaks()
Indicates, whether to break after this form element.protected AbstractGomFormElement
clone()
Creates a clone of this form element.Provides a non-null setting for entity conversion.description
(String lang) Provides the description for this form element in the requested language.boolean
Indicates whether to fill the form horizontally with this form element.Indicates, whether the form element allows to stay empty.Provides the mode for entity conversions.EditorValue<?>
Provides the editor containing the default value for this form element.getHFill()
Indicates, whether to horizontally fill a form by this form element.Indicates, whether this form element is visible in the form.getLabel()
Deprecated.since 4.0.17 originally replaced by LangInfos-Tag, now for hiding in GOM and enable attribute to tag conversion.Provides language dependent information on this form element, like a label and description for multiple languages.getName()
Provide the form element name following specific rules.Indicates, whether the next form element should follow in the same line as this one.Provides the mode for handling preset value for this form element.Provides the relevancy level of this GOM element's value wrt. indexing.Indicates, whether to have separate values in different languages.boolean
isHidden()
Indicates, whether to hide this component from the form.Returns the forms name instead of anull
label.@NotNull String
name()
Provides the textual name of this form element.preset()
Provides the preset mode for this form element.void
setAllowEmpty
(YesNo allowEmpty) Sets whether empty is allowed for this form element.void
setConvertEntities
(ConvertEntity convertEntities) Sets the mode for entity conversions.void
setDefaultValue
(EditorValue<?> editorValue) Sets the editor providing the default value for this form element.void
Sets, whether to horizontally fill a form by this form element.void
Sets the form element to be hidden or not.void
Deprecated.since 4.0.17 originally replaced by LangInfos-Tag, now for hiding in GOM and enable attribute to tag conversion.final void
setLabelAndDescription
(@NotNull String lang, @Nullable String label, @Nullable String description) Sets the label and description for a specific language.void
setName
(Designator name) Sets the form element name.void
setNoBreak
(YesNo noBreak) Set whether the next form element should follow immediately in the same line as this one.void
Sets the preset mode to be used for default values.void
setSearchRelevancy
(@Nullable Relevancy relevancy) Sets the relevancy level for this GOM element.void
setUseLanguages
(YesNo useLanguages) Sets whether to use different values in each language or not.boolean
Indicates whether to use separate values in each language or not.void
validate
(GomCheckable.Context context) Validates the form element's state with respect to the given context.void
verify()
Verifies the form element's state.Methods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
getDefaultTag, getGomElementTag, getIncludeConfiguration, hasRepresentation, setGomElementTag, setIncludeConfiguration
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomElement
getGomElementTag, getIncludeConfiguration, hasRepresentation, setGomElementTag, setIncludeConfiguration
-
Constructor Details
-
AbstractGomFormElement
public AbstractGomFormElement()
-
-
Method Details
-
getName
Provide the form element name following specific rules.- Specified by:
getName
in interfaceGomFormElement
- Returns:
- A name designator.
- Since:
- 4.0.17
-
setName
Sets the form element name.- Specified by:
setName
in interfaceGomFormElement
- Parameters:
name
- The name designator.- Since:
- 4.0.17
-
getConvertEntities
Provides the mode for entity conversions.- Returns:
- The entity conversion mode. Default is
none
. - Since:
- 4.0.17
-
setConvertEntities
Sets the mode for entity conversions.- Parameters:
convertEntities
- The conversion mode.- Since:
- 4.0.17
-
getHFill
Indicates, whether to horizontally fill a form by this form element.- Returns:
YES
, if set to fill horizontally. Default isno
.- Since:
- 4.0.17
-
setHFill
Sets, whether to horizontally fill a form by this form element.- Parameters:
hfill
-YES
, if order to fill horizontally.- Since:
- 4.0.17
-
getUseLanguages
Indicates, whether to have separate values in different languages.- Returns:
YES
, if it has separate values. Default isYesNo.YES
.- Since:
- 4.0.17
-
setUseLanguages
Sets whether to use different values in each language or not.- Parameters:
useLanguages
-YES
, to allow for separate values.- Since:
- 4.0.17
-
getNoBreak
Indicates, whether the next form element should follow in the same line as this one.- Returns:
YES
, to make the next form element follow. Defaults toYesNo.NO
.- Since:
- 4.0.17
-
setNoBreak
Set whether the next form element should follow immediately in the same line as this one.- Parameters:
noBreak
-YES
, to make the next element follow in line.- Since:
- 4.0.17
-
getAllowEmpty
Indicates, whether the form element allows to stay empty.- Specified by:
getAllowEmpty
in interfaceGomFormElement
- Returns:
YES
, if empty is allowed. Defaults toYesNo.YES
.- Since:
- 4.0.17
-
setAllowEmpty
Sets whether empty is allowed for this form element.- Specified by:
setAllowEmpty
in interfaceGomFormElement
- Parameters:
allowEmpty
-YES
, if empty shall be allowed.- Since:
- 4.0.17
-
getHidden
Indicates, whether this form element is visible in the form.- Specified by:
getHidden
in interfaceGomFormElement
- Returns:
YES
, if hidden. Defaults tono
.- Since:
- 4.0.44
-
setHidden
Sets the form element to be hidden or not.- Specified by:
setHidden
in interfaceGomFormElement
- Parameters:
hidden
-YES
, to hide the form element.- Since:
- 4.0.44
-
getPreset
Provides the mode for handling preset value for this form element.- Specified by:
getPreset
in interfaceGomFormElement
- Returns:
- The preset mode. Defaults to
default
. - Since:
- 4.0.55
-
setPreset
Sets the preset mode to be used for default values.- Specified by:
setPreset
in interfaceGomFormElement
- Parameters:
preset
- The preset mode.- Since:
- 4.0.55
-
getLangInfos
Provides language dependent information on this form element, like a label and description for multiple languages.- Specified by:
getLangInfos
in interfaceGomLangInfoProvider
- Returns:
- A language information container.
- Since:
- 4.0.17
-
getSearchRelevancy
Provides the relevancy level of this GOM element's value wrt. indexing.- Specified by:
getSearchRelevancy
in interfaceGomSearchRelevancy
- Returns:
- The relevancy level.
- Since:
- 5.2.305
-
setSearchRelevancy
Sets the relevancy level for this GOM element.- Specified by:
setSearchRelevancy
in interfaceGomSearchRelevancy
- Parameters:
relevancy
- The relevancy level.- Since:
- 5.2.305
-
verify
Verifies the form element's state. In this generic part, checks for the required name and language information.- Specified by:
verify
in interfaceGomCheckable
- Throws:
IllegalStateException
- if any requirement is violated.- Since:
- 4.2.8
-
validate
Validates the form element's state with respect to the given context. This generic stub does not check anything.- Specified by:
validate
in interfaceGomCheckable
- Parameters:
context
- The context to validate for.- Throws:
GomValidationError
- if any requirement is violated.- Since:
- 4.0.17
-
clone
Creates a clone of this form element. -
getDefaultValue
Provides the editor containing the default value for this form element.- Specified by:
getDefaultValue
in interfaceGomFormElement
- Returns:
- The default value container.
- Since:
- 4.0.17
-
setDefaultValue
Sets the editor providing the default value for this form element.- Specified by:
setDefaultValue
in interfaceGomFormElement
- Parameters:
editorValue
- The default value provding container.- Since:
- 4.0.17
-
name
Provides the textual name of this form element.- Specified by:
name
in interfaceGomFormElement
- Returns:
- The element's name.
- Since:
- 4.0.17
-
convertEntities
Provides a non-null setting for entity conversion.- Specified by:
convertEntities
in interfaceGomFormElement
- Returns:
- The entity conversion setting.
- Since:
- 4.0.17
-
fillsHorizontally
public boolean fillsHorizontally()Indicates whether to fill the form horizontally with this form element.- Specified by:
fillsHorizontally
in interfaceGomFormElement
- Returns:
true
, if to fill horizontally.- Since:
- 4.0.17
-
usesLanguages
public boolean usesLanguages()Indicates whether to use separate values in each language or not.- Specified by:
usesLanguages
in interfaceGomFormElement
- Returns:
true
, if separate values are supported.- Since:
- 4.0.17
-
breaks
public boolean breaks()Indicates, whether to break after this form element.- Specified by:
breaks
in interfaceGomFormElement
- Specified by:
breaks
in interfaceLineBreakable
- Returns:
true
, if the next form element should follow in the next line.- Since:
- 4.0.17
-
allowsEmpty
public boolean allowsEmpty()Indicates, whether empty values are allowed.- Specified by:
allowsEmpty
in interfaceGomFormElement
- Returns:
true
, if empty values are allowed.- Since:
- 4.0.17
-
isHidden
public boolean isHidden()Indicates, whether to hide this component from the form.- Specified by:
isHidden
in interfaceGomHideable
- Returns:
true
, if hiding is requested.- Since:
- 4.0.44
-
preset
Provides the preset mode for this form element.- Specified by:
preset
in interfaceGomFormElement
- Returns:
- The preset mode.
- Since:
- 4.0.55
-
label
Returns the forms name instead of anull
label.- Specified by:
label
in interfaceGomLangInfoProvider
- Parameters:
lang
- The language abbreviation.- Returns:
- The label.
- Since:
- 4.0.17
- See Also:
-
description
Provides the description for this form element in the requested language.- Specified by:
description
in interfaceGomLangInfoProvider
- Parameters:
lang
- The language abbreviation.- Returns:
- The description.
- Since:
- 4.0.17
-
setLabelAndDescription
public final void setLabelAndDescription(@NotNull @NotNull String lang, @Nullable @Nullable String label, @Nullable @Nullable String description) Sets the label and description for a specific language.- Parameters:
lang
- The language abbreviation.label
- The label.description
- The description.- Since:
- 4.0.17
-
getLabel
Deprecated.since 4.0.17 originally replaced by LangInfos-Tag, now for hiding in GOM and enable attribute to tag conversion.For GOM parsing only. Enables conversion to LangInfos-Tag. Always returns null.- Since:
- 4.0.17
-
setLabel
Deprecated.since 4.0.17 originally replaced by LangInfos-Tag, now for hiding in GOM and enable attribute to tag conversion.For GOM parsing only. Enables conversion to LangInfos-Tag.- Since:
- 4.0.17
-