Interface ShowFormDialogOperation
public interface ShowFormDialogOperation
Operation enabling to show a form as a dialog. A container providing this API is be used to configure the operation,
i.e., the dialog and form to be shown, and execute the operation once
perform(Form, List)
gets
invoked.- Since:
- 5.0.100
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Exception informing about an invalid ruleset definition. -
Field Summary
Modifier and TypeFieldDescriptionstatic final OperationType<ShowFormDialogOperation>
The operation's technical type to be used to look up the operation via anOperationAgent
. -
Method Summary
Modifier and TypeMethodDescription@Nullable FormData
Show a form based on the given structural definition and return the form's result.void
setContextElement
(@Nullable IDProvider element) Store element providing the context in which the form is displayed.void
setDefaults
(FormData defaults) Set data, which are handled a default values, i.e., data that will be applied, if no values have been manually orinitially
been set.void
setDisabled
(boolean disabled) Define, whether the form should be disabled.void
setFormData
(@Nullable FormData data) Set data to be loaded initially to the form.void
setModified
(boolean modified) Define, whether the form should initially be marked modified.void
setMultiLanguage
(boolean active) Define, whether to allow for a multiple language form.void
Set the text for the OK action of the form.void
setPreselectedLanguage
(@Nullable Language language) Sets a preselected languagevoid
setRuleset
(@NotNull String rulesetDefinition) Set the ruleset to be used by providing an XML-based definition.void
Set the title for the form's dialog.void
setUiStyle
(Store.Type storeType) Set the UI style be the store type the form should base upon.void
setValidation
(boolean active) Define, whether to validate the form on confirmation.
-
Field Details
-
TYPE
The operation's technical type to be used to look up the operation via anOperationAgent
.- Since:
- 5.0.100
-
-
Method Details
-
setUiStyle
Set the UI style be the store type the form should base upon. If no type is given, the operation's context will define the fallback style.- Parameters:
storeType
- The store type to base the ui style upon.- Since:
- 5.0.100
-
setTitle
Set the title for the form's dialog.- Parameters:
title
- The dialog title.- Since:
- 5.0.100
-
setOkText
Set the text for the OK action of the form. If no text is given, the common OK text will be used.- Parameters:
okText
- The OK text.- Since:
- 5.0.100
-
setMultiLanguage
void setMultiLanguage(boolean active) Define, whether to allow for a multiple language form.- Parameters:
active
- Iftrue
, enable multiple language input.- Since:
- 5.0.100
-
setValidation
void setValidation(boolean active) Define, whether to validate the form on confirmation. If validation is active, the form data must be valid to be accepted.- Parameters:
active
- Iftrue
, enable validation.- Since:
- 5.0.100
-
setDisabled
void setDisabled(boolean disabled) Define, whether the form should be disabled.- Parameters:
disabled
- Iftrue
, form will be disabled.- Since:
- 5.0.100
-
setModified
void setModified(boolean modified) Define, whether the form should initially be marked modified. If the form is not modified, the form usually cannot be confirmed but only be cancelled.- Parameters:
modified
- Iftrue
, form will be marked modified.- Since:
- 5.0.100
-
setFormData
Set data to be loaded initially to the form.Note 1: The data object will not be used to store the form's resulting input.
Note 2: Providing initial data does not have the same semantics as defaults being set to the form's definition.
Note 3: The form definition provided by this data object will be ignored.- Parameters:
data
- The date to be loaded.- Since:
- 5.0.102
-
setDefaults
Set data, which are handled a default values, i.e., data that will be applied, if no values have been manually orinitially
been set.Note: If used in combination with
perform(Form, List)
, defaults set to the form will be overridden by the ones given here.- Parameters:
defaults
- The default data.- Since:
- 5.0.100
- See Also:
-
setContextElement
Store element providing the context in which the form is displayed. Specifically, this needs not to be related to the form.- Parameters:
element
- The contextual element for the form.- Since:
- 5.0.100
-
setRuleset
Set the ruleset to be used by providing an XML-based definition.- Parameters:
rulesetDefinition
- An XML-based definition of rules.- Since:
- 5.0.100
-
setPreselectedLanguage
Sets a preselected language- Parameters:
language
- the language which should be preselected- Since:
- 5.2.180803
-
perform
@Nullable @Nullable FormData perform(@NotNull @NotNull Form form, @NotNull @NotNull List<Language> languages) throws ShowFormDialogOperation.InvalidRulesetDefinition Show a form based on the given structural definition and return the form's result.- Parameters:
form
- The form definition.languages
- The languages to request in.- Returns:
- The resulting data or
null
, if the form was cancelled. - Throws:
ShowFormDialogOperation.InvalidRulesetDefinition
- If a given ruleset is invalid.- Since:
- 5.0.100
-