public class NotificationFacetImpl extends AbstractFacet implements NotificationFacet
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
actionId |
protected java.lang.String |
buttonId |
protected java.lang.String |
caption |
protected java.util.function.Supplier<java.lang.String> |
captionProvider |
protected java.util.List<java.util.function.Consumer<Notifications.CloseEvent>> |
closeListeners |
protected ContentMode |
contentMode |
protected int |
delayMs |
protected java.lang.String |
description |
protected java.util.function.Supplier<java.lang.String> |
descriptionProvider |
protected boolean |
htmlSanitizerEnabled |
protected Notifications.Position |
position |
protected java.lang.String |
styleName |
protected Notifications.NotificationType |
type |
id, owner| Constructor and Description |
|---|
NotificationFacetImpl() |
| 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() |
protected void |
internalRemoveCloseListener(java.util.function.Consumer<Notifications.CloseEvent> listener) |
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 |
setOwner(Frame owner)
|
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.
|
protected void |
subscribe() |
protected void |
subscribeOnAction(Frame owner) |
protected void |
subscribeOnButton(Frame owner) |
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribeprotected java.lang.String caption
protected java.lang.String description
protected int delayMs
protected java.lang.String styleName
protected Notifications.NotificationType type
protected ContentMode contentMode
protected Notifications.Position position
protected java.util.function.Supplier<java.lang.String> captionProvider
protected java.util.function.Supplier<java.lang.String> descriptionProvider
protected java.util.List<java.util.function.Consumer<Notifications.CloseEvent>> closeListeners
protected java.lang.String actionId
protected java.lang.String buttonId
protected boolean htmlSanitizerEnabled
public void setCaption(@Nullable
java.lang.String caption)
NotificationFacetsetCaption in interface NotificationFacetcaption - caption@Nullable public java.lang.String getCaption()
getCaption in interface NotificationFacetpublic void setDescription(@Nullable
java.lang.String description)
NotificationFacetsetDescription in interface NotificationFacetdescription - description@Nullable public java.lang.String getDescription()
getDescription in interface NotificationFacetpublic void setType(Notifications.NotificationType type)
NotificationFacetsetType in interface NotificationFacettype - typepublic Notifications.NotificationType getType()
getType in interface NotificationFacetpublic void setDelay(int delayMs)
NotificationFacetsetDelay in interface NotificationFacetdelayMs - the desired delay in millisecondspublic int getDelay()
getDelay in interface NotificationFacetpublic void setContentMode(ContentMode contentMode)
NotificationFacetsetContentMode in interface NotificationFacetcontentMode - content modepublic ContentMode getContentMode()
getContentMode in interface NotificationFacetpublic void setStyleName(java.lang.String styleName)
NotificationFacetsetStyleName in interface NotificationFacetstyleName - style name@Nullable public java.lang.String getStyleName()
getStyleName in interface NotificationFacetpublic void setPosition(Notifications.Position position)
NotificationFacetsetPosition in interface NotificationFacetposition - positionpublic Notifications.Position getPosition()
getPosition in interface NotificationFacetpublic io.jmix.core.common.event.Subscription addCloseListener(java.util.function.Consumer<Notifications.CloseEvent> listener)
NotificationFacetConsumer as notification Notifications.CloseEvent listener.addCloseListener in interface NotificationFacetlistener - close event listenerprotected void internalRemoveCloseListener(java.util.function.Consumer<Notifications.CloseEvent> listener)
public void setCaptionProvider(@Nullable
java.util.function.Supplier<java.lang.String> captionProvider)
NotificationFacetSupplier as notification caption provider.setCaptionProvider in interface NotificationFacetcaptionProvider - notification caption provider@Nullable public java.util.function.Supplier<java.lang.String> getCaptionProvider()
getCaptionProvider in interface NotificationFacetpublic void setDescriptionProvider(@Nullable
java.util.function.Supplier<java.lang.String> descriptionProvider)
NotificationFacetSupplier as notification description provider.setDescriptionProvider in interface NotificationFacetdescriptionProvider - notification description provider@Nullable public java.util.function.Supplier<java.lang.String> getDescriptionProvider()
getDescriptionProvider in interface NotificationFacet@Nullable public java.lang.String getActionTarget()
getActionTarget in interface NotificationFacetpublic void setActionTarget(@Nullable
java.lang.String actionId)
NotificationFacetactionId
is performed.setActionTarget in interface NotificationFacetactionId - action id@Nullable public java.lang.String getButtonTarget()
getButtonTarget in interface NotificationFacetpublic void setButtonTarget(@Nullable
java.lang.String buttonId)
NotificationFacetactionId
is clicked.setButtonTarget in interface NotificationFacetbuttonId - button idpublic void setHtmlSanitizerEnabled(boolean htmlSanitizerEnabled)
NotificationFacetsetHtmlSanitizerEnabled in interface NotificationFacethtmlSanitizerEnabled - specifies whether html sanitizer is enabledpublic boolean isHtmlSanitizerEnabled()
isHtmlSanitizerEnabled in interface NotificationFacetpublic void setOwner(@Nullable
Frame owner)
FacetsetOwner in interface FacetsetOwner in class AbstractFacetowner - owner framepublic void show()
NotificationFacetshow in interface NotificationFacetprotected void subscribe()
protected void subscribeOnAction(Frame owner)
protected void subscribeOnButton(Frame owner)