Package io.jmix.ui.sys
Class NotificationsImpl.NotificationBuilderImpl
java.lang.Object
io.jmix.ui.sys.NotificationsImpl.NotificationBuilderImpl
- All Implemented Interfaces:
Notifications.NotificationBuilder
- Enclosing class:
- NotificationsImpl
public class NotificationsImpl.NotificationBuilderImpl
extends Object
implements Notifications.NotificationBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected ContentModeprotected Stringprotected EventHubprotected intprotected booleanprotected Notifications.NotificationTypeprotected Notifications.Positionprotected Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.ui.Notification.TypeconvertType(Notifications.NotificationType notificationType) protected com.vaadin.ui.NotificationintgetType()booleanprotected voidsetNotificationDelayMsec(com.vaadin.ui.Notification notification, Notifications.NotificationType type) voidshow()Shows notification.withCaption(String caption) Sets notification caption.withCloseListener(Consumer<Notifications.CloseEvent> closeListener) Sets the listener that will be fired when notification will be closed.withContentMode(ContentMode contentMode) Sets content mode for caption and description of notification.withDescription(String description) Sets notification description.withHideDelayMs(int hideDelayMs) Sets the delay before the notification disappears.withHtmlSanitizer(boolean htmlSanitizerEnabled) Sets whether html sanitizer is enabled or not for notification content.withPosition(Notifications.Position position) Sets position of notification.withStyleName(String styleName) Sets CSS class name for notification DOM element.withType(Notifications.NotificationType notificationType) Sets type of notification.
-
Field Details
-
SYSTEM_STYLENAME
- See Also:
-
caption
-
description
-
styleName
-
htmlSanitizerEnabled
protected boolean htmlSanitizerEnabled -
position
-
hideDelayMs
protected int hideDelayMs -
contentMode
-
notificationType
-
eventHub
-
-
Constructor Details
-
NotificationBuilderImpl
public NotificationBuilderImpl()
-
-
Method Details
-
withCaption
Description copied from interface:Notifications.NotificationBuilderSets notification caption.- Specified by:
withCaptionin interfaceNotifications.NotificationBuilder- Parameters:
caption- caption- Returns:
- this
-
getCaption
- Specified by:
getCaptionin interfaceNotifications.NotificationBuilder- Returns:
- caption
-
withDescription
Description copied from interface:Notifications.NotificationBuilderSets notification description.- Specified by:
withDescriptionin interfaceNotifications.NotificationBuilder- Parameters:
description- description- Returns:
- this
-
getDescription
- Specified by:
getDescriptionin interfaceNotifications.NotificationBuilder- Returns:
- description
-
withType
Description copied from interface:Notifications.NotificationBuilderSets type of notification.- Specified by:
withTypein interfaceNotifications.NotificationBuilder- Parameters:
notificationType- type- Returns:
- this
-
getType
- Specified by:
getTypein interfaceNotifications.NotificationBuilder- Returns:
- type
-
withContentMode
Description copied from interface:Notifications.NotificationBuilderSets content mode for caption and description of notification.- Specified by:
withContentModein interfaceNotifications.NotificationBuilder- Parameters:
contentMode- content mode- Returns:
- this
-
getContentMode
- Specified by:
getContentModein interfaceNotifications.NotificationBuilder- Returns:
- content mode
-
withStyleName
Description copied from interface:Notifications.NotificationBuilderSets CSS class name for notification DOM element.- Specified by:
withStyleNamein interfaceNotifications.NotificationBuilder- Parameters:
styleName- CSS class name- Returns:
- this
-
getStyleName
- Specified by:
getStyleNamein interfaceNotifications.NotificationBuilder- Returns:
- CSS class name
-
withPosition
Description copied from interface:Notifications.NotificationBuilderSets position of notification.- Specified by:
withPositionin interfaceNotifications.NotificationBuilder- Parameters:
position- position- Returns:
- this
-
getPosition
- Specified by:
getPositionin interfaceNotifications.NotificationBuilder- Returns:
- position
-
withHtmlSanitizer
Description copied from interface:Notifications.NotificationBuilderSets whether html sanitizer is enabled or not for notification content.- Specified by:
withHtmlSanitizerin interfaceNotifications.NotificationBuilder- Parameters:
htmlSanitizerEnabled- specifies whether html sanitizer is enabled- Returns:
- builder
-
isHtmlSanitizerEnabled
public boolean isHtmlSanitizerEnabled()- Specified by:
isHtmlSanitizerEnabledin interfaceNotifications.NotificationBuilder- Returns:
- html sanitizer is enabled for notification content
-
withHideDelayMs
Description copied from interface:Notifications.NotificationBuilderSets the delay before the notification disappears.- Specified by:
withHideDelayMsin interfaceNotifications.NotificationBuilder- Parameters:
hideDelayMs- the desired delay in milliseconds, -1 to require the user to click the message
-
getHideDelayMs
public int getHideDelayMs()- Specified by:
getHideDelayMsin interfaceNotifications.NotificationBuilder- Returns:
- the delay before the notification disappears in milliseconds
-
withCloseListener
public Notifications.NotificationBuilder withCloseListener(Consumer<Notifications.CloseEvent> closeListener) Description copied from interface:Notifications.NotificationBuilderSets the listener that will be fired when notification will be closed.- Specified by:
withCloseListenerin interfaceNotifications.NotificationBuilder- Parameters:
closeListener-Notifications.CloseEventconsumer- Returns:
- this
-
convertType
protected com.vaadin.ui.Notification.Type convertType(Notifications.NotificationType notificationType) -
setNotificationDelayMsec
protected void setNotificationDelayMsec(com.vaadin.ui.Notification notification, Notifications.NotificationType type) -
createNotification
protected com.vaadin.ui.Notification createNotification() -
show
public void show()Description copied from interface:Notifications.NotificationBuilderShows notification.- Specified by:
showin interfaceNotifications.NotificationBuilder
-