Class MessageTemplatesFragment
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<JmixFormLayout>
io.jmix.flowui.fragment.Fragment<JmixFormLayout>
io.jmix.notificationsflowui.fragment.MessageTemplatesFragment
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.shared.HasValidationProperties,SupportsValidation<MessageTemplate>,FacetOwner,FragmentOwner,Serializable
public class MessageTemplatesFragment
extends Fragment<JmixFormLayout>
implements SupportsValidation<MessageTemplate>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.fragment.Fragment
Fragment.ReadyEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable Supplier<ContentType> protected DialogWindowsprotected Iconsprotected MessageBundleprotected EntityPicker<MessageTemplate> protected ActionFields inherited from class io.jmix.flowui.fragment.Fragment
fragmentActions, fragmentData, fragmentFacets, parentController, uiComponentsFields inherited from interface io.jmix.flowui.component.SupportsValidation
PROPERTY_ERROR_MESSAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddValidator(Validator<? super MessageTemplate> validator) Adds a validator to the list of validators for the component.protected ActionvoidExecutes all registered validators against the current value of the component.@Nullable ContentTypeReturns the content type of the message generated from the selected template, determined by the template's own type.@Nullable MessageTemplatebooleanvoidprotected voidvoidonMessageTemplatePickerValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EntityPicker<MessageTemplate>, MessageTemplate> event) voidonReady(Fragment.ReadyEvent event) voidonUseMessageTemplatesCheckboxComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCheckbox, Boolean> event) protected voidprotected voidparametersDialogResultHandler(DialogWindow.AfterCloseEvent<MessageTemplateParametersInputDialog> event) voidsetContentTypeProvider(@Nullable Supplier<ContentType> contentTypeProvider) Sets an optional provider that restricts the template lookup to templates of a single content type.voidsetDefaultBodyFieldVisionChangeCallback(Consumer<Boolean> defaultBodyFieldVisionChangeCallback) voidsetInvalid(boolean invalid) Sets invalid state to the field considering result of field validation.Methods inherited from class io.jmix.flowui.fragment.Fragment
addReadyListener, findInnerComponent, getFragmentActions, getFragmentData, getFragmentFacets, getInnerComponent, getParentController, initContent, onAttach, onDetach, setFragmentActions, setFragmentData, setFragmentFacets, setParentController, setUiComponentsMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface io.jmix.flowui.facet.FacetOwner
getIdMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
isInvalidMethods inherited from interface io.jmix.flowui.component.SupportsValidation
getErrorMessage, setErrorMessage
-
Field Details
-
messageTemplatePicker
-
messageBundle
-
dialogWindows
-
icons
-
defaultBodyFieldVisionChangeCallback
-
contentTypeProvider
-
params
-
paramEditorAction
-
-
Constructor Details
-
MessageTemplatesFragment
public MessageTemplatesFragment()
-
-
Method Details
-
onReady
-
onUseMessageTemplatesCheckboxComponentValueChange
@Subscribe("useMessageTemplatesCheckbox") public void onUseMessageTemplatesCheckboxComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCheckbox, Boolean> event) -
onMessageTemplatePickerValueChange
@Subscribe("messageTemplatePicker") public void onMessageTemplatePickerValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EntityPicker<MessageTemplate>, MessageTemplate> event) -
parametersDialogConfigurer
-
parametersDialogResultHandler
protected void parametersDialogResultHandler(DialogWindow.AfterCloseEvent<MessageTemplateParametersInputDialog> event) -
messageTemplatePickerLookupActionViewConfigurer
@Install(to="messageTemplatePicker.lookupAction", subject="viewConfigurer") public void messageTemplatePickerLookupActionViewConfigurer(MessageTemplateListView view) -
setDefaultBodyFieldVisionChangeCallback
-
setContentTypeProvider
Sets an optional provider that restricts the template lookup to templates of a single content type. The fragment itself does not need it: the content type of a message follows from the selected template, seegetContentType().- Parameters:
contentTypeProvider- supplier of the content type to filter the templates by, ornullto offer templates of all types
-
isMessageTemplateUsed
public boolean isMessageTemplateUsed() -
getMessageTemplate
-
getContentType
Returns the content type of the message generated from the selected template, determined by the template's own type.- Returns:
- content type implied by the selected template, or
nullif no template is selected
-
getParameters
-
createPramEditAction
-
onEditParamsAction
-
addValidator
public com.vaadin.flow.shared.Registration addValidator(Validator<? super MessageTemplate> validator) Description copied from interface:SupportsValidationAdds a validator to the list of validators for the component. The provided validator will be used to validate the value of the component during validation execution.- Specified by:
addValidatorin interfaceSupportsValidation<MessageTemplate>- Parameters:
validator- the validator to be added; should not benull- Returns:
- a
Registrationobject that allows removing the added validator
-
executeValidators
Description copied from interface:SupportsValidationExecutes all registered validators against the current value of the component. If any of the validators fail, aValidationExceptionis thrown to indicate the failure. The exact behavior and order of validation depend on the validators added.- Specified by:
executeValidatorsin interfaceSupportsValidation<MessageTemplate>- Throws:
ValidationException- if validation fails for one or more validators
-
setInvalid
public void setInvalid(boolean invalid) Description copied from interface:SupportsValidationSets invalid state to the field considering result of field validation.- Invalid - false and validation passed - false = field is invalid
- Invalid - false and validation passed - true = field is valid
- Invalid - true and validation passed - false = field is invalid
- Invalid - true and validation passed - true = field is invalid
- Specified by:
setInvalidin interfacecom.vaadin.flow.component.HasValidation- Specified by:
setInvalidin interfacecom.vaadin.flow.component.shared.HasValidationProperties- Specified by:
setInvalidin interfaceSupportsValidation<MessageTemplate>- Parameters:
invalid- whether field should be invalid
-