Package io.jmix.dynmodelflowui.action
Class DynamicLocalizedMessageEditSupport.Editor
java.lang.Object
io.jmix.dynmodelflowui.action.DynamicLocalizedMessageEditSupport.Editor
- Enclosing class:
DynamicLocalizedMessageEditSupport
Holder of the localized-messages edit dialog. Configure the dialog once via the
fluent
withXxx(...) setters and invoke edit(HasDynamicLocalizedMessages)
for every item to edit.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.component.button.Buttonprotected booleanprotected com.vaadin.flow.component.dialog.Dialogprotected HasDynamicLocalizedMessagesprotected booleanprotected booleanprotected Stringprotected Stringprotected Stringprotected com.vaadin.flow.component.button.Button -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddButtonClickShortcut(com.vaadin.flow.component.button.Button button, com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers) protected voidprotected DynamicLocalizedMessageModelprotected com.vaadin.flow.component.button.Buttonprotected com.vaadin.flow.component.Componentprotected com.vaadin.flow.component.HasValueAndElement<?, String> createField(Locale locale) protected DynamicLocalizedMessageModelcreateLocalizedMessage(Locale locale) protected com.vaadin.flow.component.button.Buttonprotected voiddoClose(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voiddoSave(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) voidOpens the dialog for the given item.protected @Nullable DynamicLocalizedMessageModelfindLocalizedMessage(List<DynamicLocalizedMessageModel> localizedMessages, Locale locale) protected @Nullable DynamicLocalizedMessageModelfindLocalizedMessage(Locale locale) protected com.vaadin.flow.component.HasValueAndElement<?, String> protected StringgetInitialValue(Locale locale) protected StringgetLocaleCode(Locale locale) protected List<DynamicLocalizedMessageModel> protected voidprotected voidprotected voidinitMultilineField(com.vaadin.flow.component.HasValueAndElement<?, String> field) protected booleanisSameLocale(@Nullable String localeCode, Locale locale) protected voidonDialogOpenedChanged(com.vaadin.flow.component.dialog.Dialog.OpenedChangeEvent openedChangeEvent) protected voidonFieldInvalidChanged(com.vaadin.flow.dom.PropertyChangeEvent propertyChangeEvent) protected voidprotected voidwithCancelButtonTheme(@Nullable String themeName) Sets the Cancel button theme name.withCancelIcon(@Nullable com.vaadin.flow.component.Component icon) Sets the Cancel button icon.withCancelText(@Nullable String text) Sets the Cancel button text.withCheckForUnsavedChanges(boolean checkForUnsavedChanges) Sets whether the dialog asks the user to confirm closing when fields contain unsaved changes.withClassName(@Nullable String className) Sets the CSS class of the dialog element.withHeight(@Nullable String height) Sets the dialog height.withMaxHeight(@Nullable String maxHeight) Sets the dialog maximum height.withMaxWidth(@Nullable String maxWidth) Sets the dialog maximum width.withMinHeight(@Nullable String minHeight) Sets the dialog minimum height.withMinWidth(@Nullable String minWidth) Sets the dialog minimum width.withMultiline(boolean multiline) Sets whether each locale's input is rendered as a multi-lineTextArea.withMultilineFieldHeight(@Nullable String height) Sets the height applied to multi-line locale fields whenwithMultiline(boolean)is enabled.withMultilineFieldMaxHeight(@Nullable String maxHeight) Sets the maximum height applied to multi-line locale fields.withMultilineFieldMinHeight(@Nullable String minHeight) Sets the minimum height applied to multi-line locale fields.withSaveButtonTheme(@Nullable String themeName) Sets the Save button theme name.withSaveIcon(@Nullable com.vaadin.flow.component.Component icon) Sets the Save button icon.withSaveText(@Nullable String text) Sets the Save button text.Sets the dialog width.
-
Field Details
-
dialog
protected com.vaadin.flow.component.dialog.Dialog dialog -
saveButton
protected com.vaadin.flow.component.button.Button saveButton -
cancelButton
protected com.vaadin.flow.component.button.Button cancelButton -
fields
-
editedItem
-
multiline
protected boolean multiline -
multilineFieldHeight
-
multilineFieldMinHeight
-
multilineFieldMaxHeight
-
hasUnsavedChanges
protected boolean hasUnsavedChanges -
checkForUnsavedChanges
protected boolean checkForUnsavedChanges
-
-
Constructor Details
-
Editor
protected Editor()
-
-
Method Details
-
withMultiline
Sets whether each locale's input is rendered as a multi-lineTextArea. A single-lineTextFieldis used by default. -
withCheckForUnsavedChanges
public DynamicLocalizedMessageEditSupport.Editor withCheckForUnsavedChanges(boolean checkForUnsavedChanges) Sets whether the dialog asks the user to confirm closing when fields contain unsaved changes.trueby default. -
withWidth
Sets the dialog width. Accepts any CSS length (e.g."30em"or"400px"); passnullto clear the value. -
withMinWidth
Sets the dialog minimum width. Accepts any CSS length; passnullto clear. -
withMaxWidth
Sets the dialog maximum width. Accepts any CSS length; passnullto clear. -
withHeight
Sets the dialog height. Accepts any CSS length; passnullto clear. -
withMinHeight
Sets the dialog minimum height. Accepts any CSS length; passnullto clear. -
withMaxHeight
Sets the dialog maximum height. Accepts any CSS length; passnullto clear. -
withMultilineFieldHeight
Sets the height applied to multi-line locale fields whenwithMultiline(boolean)is enabled. Accepts any CSS length; passnullto clear. -
withMultilineFieldMinHeight
public DynamicLocalizedMessageEditSupport.Editor withMultilineFieldMinHeight(@Nullable String minHeight) Sets the minimum height applied to multi-line locale fields. Accepts any CSS length; passnullto clear. -
withMultilineFieldMaxHeight
public DynamicLocalizedMessageEditSupport.Editor withMultilineFieldMaxHeight(@Nullable String maxHeight) Sets the maximum height applied to multi-line locale fields. Accepts any CSS length; passnullto clear. -
withClassName
Sets the CSS class of the dialog element. Passnullto remove the class. -
withSaveText
Sets the Save button text. Passnullto remove the text. -
withSaveIcon
public DynamicLocalizedMessageEditSupport.Editor withSaveIcon(@Nullable com.vaadin.flow.component.Component icon) Sets the Save button icon. Passnullto remove the icon. -
withSaveButtonTheme
Sets the Save button theme name. Passnullto clear the theme. -
withCancelText
Sets the Cancel button text. Passnullto remove the text. -
withCancelIcon
public DynamicLocalizedMessageEditSupport.Editor withCancelIcon(@Nullable com.vaadin.flow.component.Component icon) Sets the Cancel button icon. Passnullto remove the icon. -
withCancelButtonTheme
Sets the Cancel button theme name. Passnullto clear the theme. -
edit
Opens the dialog for the given item. The item'smessageslist is replaced with the edited copy on save. -
initDialog
protected void initDialog() -
createSaveButton
protected com.vaadin.flow.component.button.Button createSaveButton() -
createCancelButton
protected com.vaadin.flow.component.button.Button createCancelButton() -
addButtonClickShortcut
protected void addButtonClickShortcut(com.vaadin.flow.component.button.Button button, com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers) -
doSave
protected void doSave(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
doClose
protected void doClose(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
closeInternal
protected void closeInternal() -
showUnsavedChangesDialog
protected void showUnsavedChangesDialog() -
createContent
protected com.vaadin.flow.component.Component createContent() -
getField
-
createField
-
initField
-
onFieldInvalidChanged
protected void onFieldInvalidChanged(com.vaadin.flow.dom.PropertyChangeEvent propertyChangeEvent) -
updateSaveButtonState
protected void updateSaveButtonState() -
initMultilineField
-
getInitialValue
-
findLocalizedMessage
-
findLocalizedMessage
protected @Nullable DynamicLocalizedMessageModel findLocalizedMessage(List<DynamicLocalizedMessageModel> localizedMessages, Locale locale) -
isSameLocale
-
createLocalizedMessage
-
copyLocalizedMessage
-
getTargetMessages
-
getLocaleCode
-
onDialogOpenedChanged
protected void onDialogOpenedChanged(com.vaadin.flow.component.dialog.Dialog.OpenedChangeEvent openedChangeEvent)
-