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
Modifier and TypeFieldDescriptionprotected String
protected ContentMode
protected String
protected EventHub
protected int
protected boolean
protected Notifications.NotificationType
protected Notifications.Position
protected String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.ui.Notification.Type
convertType
(Notifications.NotificationType notificationType) protected com.vaadin.ui.Notification
int
getType()
boolean
protected void
setNotificationDelayMsec
(com.vaadin.ui.Notification notification, Notifications.NotificationType type) 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.withType
(Notifications.NotificationType notificationType) Sets type of notification.
-
Field Details
-
SYSTEM_STYLENAME
- See Also:
-
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.NotificationBuilder
Sets notification caption.- Specified by:
withCaption
in interfaceNotifications.NotificationBuilder
- Parameters:
caption
- caption- Returns:
- this
-
getCaption
- Specified by:
getCaption
in interfaceNotifications.NotificationBuilder
- Returns:
- caption
-
withDescription
Description copied from interface:Notifications.NotificationBuilder
Sets notification description.- Specified by:
withDescription
in interfaceNotifications.NotificationBuilder
- Parameters:
description
- description- Returns:
- this
-
getDescription
- Specified by:
getDescription
in interfaceNotifications.NotificationBuilder
- Returns:
- description
-
withType
Description copied from interface:Notifications.NotificationBuilder
Sets type of notification.- Specified by:
withType
in interfaceNotifications.NotificationBuilder
- Parameters:
notificationType
- type- Returns:
- this
-
getType
- Specified by:
getType
in interfaceNotifications.NotificationBuilder
- Returns:
- type
-
withContentMode
Description copied from interface:Notifications.NotificationBuilder
Sets content mode for caption and description of notification.- Specified by:
withContentMode
in interfaceNotifications.NotificationBuilder
- Parameters:
contentMode
- content mode- Returns:
- this
-
getContentMode
- Specified by:
getContentMode
in interfaceNotifications.NotificationBuilder
- Returns:
- content mode
-
withStyleName
Description copied from interface:Notifications.NotificationBuilder
Sets CSS class name for notification DOM element.- Specified by:
withStyleName
in interfaceNotifications.NotificationBuilder
- Parameters:
styleName
- CSS class name- Returns:
- this
-
getStyleName
- Specified by:
getStyleName
in interfaceNotifications.NotificationBuilder
- Returns:
- CSS class name
-
withPosition
Description copied from interface:Notifications.NotificationBuilder
Sets position of notification.- Specified by:
withPosition
in interfaceNotifications.NotificationBuilder
- Parameters:
position
- position- Returns:
- this
-
getPosition
- Specified by:
getPosition
in interfaceNotifications.NotificationBuilder
- Returns:
- position
-
withHtmlSanitizer
Description copied from interface:Notifications.NotificationBuilder
Sets whether html sanitizer is enabled or not for notification content.- Specified by:
withHtmlSanitizer
in interfaceNotifications.NotificationBuilder
- Parameters:
htmlSanitizerEnabled
- specifies whether html sanitizer is enabled- Returns:
- builder
-
isHtmlSanitizerEnabled
public boolean isHtmlSanitizerEnabled()- Specified by:
isHtmlSanitizerEnabled
in interfaceNotifications.NotificationBuilder
- Returns:
- html sanitizer is enabled for notification content
-
withHideDelayMs
Description copied from interface:Notifications.NotificationBuilder
Sets the delay before the notification disappears.- Specified by:
withHideDelayMs
in interfaceNotifications.NotificationBuilder
- Parameters:
hideDelayMs
- the desired delay in milliseconds, -1 to require the user to click the message
-
getHideDelayMs
public int getHideDelayMs()- Specified by:
getHideDelayMs
in 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.NotificationBuilder
Sets the listener that will be fired when notification will be closed.- Specified by:
withCloseListener
in interfaceNotifications.NotificationBuilder
- Parameters:
closeListener
-Notifications.CloseEvent
consumer- 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.NotificationBuilder
Shows notification.- Specified by:
show
in interfaceNotifications.NotificationBuilder
-