@StudioFacet(xmlElement="notification", caption="Notification", description="Prepares and shows notifications", defaultProperty="caption", category="Facets", icon="io/jmix/ui/icon/facet/notification.svg") public interface NotificationFacet extends Facet
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addCloseListener(java.util.function.Consumer<Notifications.CloseEvent> listener)
Adds the given
Consumer as notification Notifications.CloseEvent listener. |
java.lang.String |
getActionTarget() |
java.lang.String |
getButtonTarget() |
java.lang.String |
getCaption() |
java.util.function.Supplier<java.lang.String> |
getCaptionProvider() |
ContentMode |
getContentMode() |
int |
getDelay() |
java.lang.String |
getDescription() |
java.util.function.Supplier<java.lang.String> |
getDescriptionProvider() |
Notifications.Position |
getPosition() |
java.lang.String |
getStyleName() |
Notifications.NotificationType |
getType() |
boolean |
isHtmlSanitizerEnabled() |
void |
setActionTarget(java.lang.String actionId)
Sets that notification should be shown when action with id
actionId
is performed. |
void |
setButtonTarget(java.lang.String buttonId)
Sets that notification should be shown when button with id
actionId
is clicked. |
void |
setCaption(java.lang.String caption)
Sets notification caption.
|
void |
setCaptionProvider(java.util.function.Supplier<java.lang.String> captionProvider)
Sets the given
Supplier as notification caption provider. |
void |
setContentMode(ContentMode contentMode)
Sets notification content mode.
|
void |
setDelay(int delayMs)
Sets the delay before the notification disappears.
|
void |
setDescription(java.lang.String description)
Sets notification description.
|
void |
setDescriptionProvider(java.util.function.Supplier<java.lang.String> descriptionProvider)
Sets the given
Supplier as notification description provider. |
void |
setHtmlSanitizerEnabled(boolean htmlSanitizerEnabled)
Sets whether html sanitizer is enabled or not for notification content.
|
void |
setPosition(Notifications.Position position)
Sets notification position.
|
void |
setStyleName(java.lang.String styleName)
Sets notification style name.
|
void |
setType(Notifications.NotificationType type)
Sets notification type.
|
void |
show()
Shows notification.
|
@StudioProperty(type=LOCALIZED_STRING) void setCaption(@Nullable java.lang.String caption)
caption
- caption@Nullable java.lang.String getCaption()
@StudioProperty(type=LOCALIZED_STRING) void setDescription(@Nullable java.lang.String description)
description
- description@Nullable java.lang.String getDescription()
@StudioProperty @PositiveOrZero void setDelay(int delayMs)
delayMs
- the desired delay in millisecondsint getDelay()
@StudioProperty(type=ENUMERATION, defaultValue="HUMANIZED") void setType(Notifications.NotificationType type)
type
- typeNotifications.NotificationType getType()
@StudioProperty(type=ENUMERATION, defaultValue="TEXT", options={"HTML","TEXT"}) void setContentMode(ContentMode contentMode)
contentMode
- content modeContentMode getContentMode()
@StudioProperty(name="stylename", type=CSS_CLASSNAME_LIST) void setStyleName(java.lang.String styleName)
styleName
- style name@Nullable java.lang.String getStyleName()
@StudioProperty(type=ENUMERATION, defaultValue="DEFAULT") void setPosition(Notifications.Position position)
position
- positionNotifications.Position getPosition()
@Nullable java.lang.String getActionTarget()
@StudioProperty(name="onAction", type=COMPONENT_REF, options="io.jmix.ui.action.Action") void setActionTarget(@Nullable java.lang.String actionId)
actionId
is performed.actionId
- action id@Nullable java.lang.String getButtonTarget()
@StudioProperty(name="onButton", type=COMPONENT_REF, options="io.jmix.ui.component.Button") void setButtonTarget(@Nullable java.lang.String buttonId)
actionId
is clicked.buttonId
- button id@StudioProperty(type=BOOLEAN, defaultValue="true") void setHtmlSanitizerEnabled(boolean htmlSanitizerEnabled)
htmlSanitizerEnabled
- specifies whether html sanitizer is enabledboolean isHtmlSanitizerEnabled()
void show()
void setCaptionProvider(@Nullable java.util.function.Supplier<java.lang.String> captionProvider)
Supplier
as notification caption provider.captionProvider
- notification caption provider@Nullable java.util.function.Supplier<java.lang.String> getCaptionProvider()
void setDescriptionProvider(@Nullable java.util.function.Supplier<java.lang.String> descriptionProvider)
Supplier
as notification description provider.descriptionProvider
- notification description provider@Nullable java.util.function.Supplier<java.lang.String> getDescriptionProvider()
io.jmix.core.common.event.Subscription addCloseListener(java.util.function.Consumer<Notifications.CloseEvent> listener)
Consumer
as notification Notifications.CloseEvent
listener.listener
- close event listener