Package io.jmix.ui
Interface Notifications.NotificationBuilder
- All Known Implementing Classes:
NotificationsImpl.NotificationBuilderImpl
- Enclosing interface:
- Notifications
public static interface Notifications.NotificationBuilder
Notification builder object.
-
Method Summary
Modifier and TypeMethodDescriptionint
getType()
boolean
void
show()
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.Sets type of notification.
-
Method Details
-
withCaption
Sets notification caption.- Parameters:
caption
- caption- Returns:
- this
-
getCaption
String getCaption()- Returns:
- caption
-
withDescription
Sets notification description.- Parameters:
description
- description- Returns:
- this
-
getDescription
String getDescription()- Returns:
- description
-
withType
Sets type of notification.- Parameters:
type
- type- Returns:
- this
-
getType
Notifications.NotificationType getType()- Returns:
- type
-
withContentMode
Sets content mode for caption and description of notification.- Parameters:
contentMode
- content mode- Returns:
- this
-
getContentMode
ContentMode getContentMode()- Returns:
- content mode
-
withStyleName
Sets CSS class name for notification DOM element.- Parameters:
styleName
- CSS class name- Returns:
- this
-
getStyleName
String getStyleName()- Returns:
- CSS class name
-
withPosition
Sets position of notification.- Parameters:
position
- position- Returns:
- this
-
getPosition
Notifications.Position getPosition()- Returns:
- position
-
withHtmlSanitizer
Sets whether html sanitizer is enabled or not for notification content.- Parameters:
htmlSanitizerEnabled
- specifies whether html sanitizer is enabled- Returns:
- builder
-
isHtmlSanitizerEnabled
boolean isHtmlSanitizerEnabled()- Returns:
- html sanitizer is enabled for notification content
-
withHideDelayMs
Sets the delay before the notification disappears.- Parameters:
hideDelayMs
- the desired delay in milliseconds, -1 to require the user to click the message
-
getHideDelayMs
int getHideDelayMs()- Returns:
- the delay before the notification disappears in milliseconds
-
withCloseListener
Notifications.NotificationBuilder withCloseListener(Consumer<Notifications.CloseEvent> closeListener) Sets the listener that will be fired when notification will be closed.- Parameters:
closeListener
-Notifications.CloseEvent
consumer- Returns:
- this
-
show
void show()Shows notification.
-