Package io.jmix.notificationsflowui.view
Class NotificationDetailViewSupport
java.lang.Object
io.jmix.notificationsflowui.view.NotificationDetailViewSupport
@Component("ntf_NotificationDetailViewSupport")
public class NotificationDetailViewSupport
extends Object
Utility class to simplify initialization of detail views for
InAppNotification entity.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Dialogsprotected final Iconsprotected final Messagesprotected final NotificationTypesRepositoryprotected final UiComponents -
Constructor Summary
ConstructorsConstructorDescriptionNotificationDetailViewSupport(Messages messages, NotificationTypesRepository notificationTypesRepository, UiComponents uiComponents, Icons icons, Dialogs dialogs) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyBodyFieldsVisibility(ContentType contentType, JmixTextArea plainField, RichTextEditor htmlField) Shows the body field matching the given content type and hides the other.protected StringgetLocalizedNotificationType(@Nullable NotificationType notificationType) voidinitTypeField(JmixSelect<NotificationType> typeField) protected com.vaadin.flow.component.Componentprotected voidonTypeFieldComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.select.Select<NotificationType>, NotificationType> event) voidsetupContentTypeSwitch(JmixRadioButtonGroup<ContentType> contentTypeField, JmixTextArea plainField, RichTextEditor htmlField) Wires the content-type radio group to swap the visible body field between plain-text and HTML editors in response to user selection.
-
Field Details
-
messages
-
notificationTypesRepository
-
uiComponents
-
icons
-
dialogs
-
-
Constructor Details
-
NotificationDetailViewSupport
public NotificationDetailViewSupport(Messages messages, NotificationTypesRepository notificationTypesRepository, UiComponents uiComponents, Icons icons, Dialogs dialogs)
-
-
Method Details
-
setupContentTypeSwitch
public void setupContentTypeSwitch(JmixRadioButtonGroup<ContentType> contentTypeField, JmixTextArea plainField, RichTextEditor htmlField) Wires the content-type radio group to swap the visible body field between plain-text and HTML editors in response to user selection.- Parameters:
contentTypeField- content-type selectorplainField- plain-text body fieldhtmlField- HTML body field
-
applyBodyFieldsVisibility
public void applyBodyFieldsVisibility(ContentType contentType, JmixTextArea plainField, RichTextEditor htmlField) Shows the body field matching the given content type and hides the other.- Parameters:
contentType- content type that determines the visible body fieldplainField- plain-text body fieldhtmlField- HTML body field
-
initTypeField
-
onTypeFieldComponentRenderer
-
onTypeFieldComponentValueChange
protected void onTypeFieldComponentValueChange(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.select.Select<NotificationType>, NotificationType> event) -
getLocalizedNotificationType
-