Package io.jmix.ui.component.impl
Class NotificationFacetImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractFacet
io.jmix.ui.component.impl.NotificationFacetImpl
- All Implemented Interfaces:
Facet
,NotificationFacet
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected String
protected String
protected List<Consumer<Notifications.CloseEvent>>
protected ContentMode
protected int
protected String
protected boolean
protected Notifications.Position
protected String
protected Notifications.NotificationType
Fields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCloseListener
(Consumer<Notifications.CloseEvent> listener) Adds the givenConsumer
as notificationNotifications.CloseEvent
listener.int
getDelay()
getType()
protected void
boolean
void
setActionTarget
(String actionId) Sets that notification should be shown when action with idactionId
is performed.void
setButtonTarget
(String buttonId) Sets that notification should be shown when button with idactionId
is clicked.void
setCaption
(String caption) Sets notification caption.void
setCaptionProvider
(Supplier<String> captionProvider) Sets the givenSupplier
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
(String description) Sets notification description.void
setDescriptionProvider
(Supplier<String> descriptionProvider) Sets the givenSupplier
as notification description provider.void
setHtmlSanitizerEnabled
(boolean htmlSanitizerEnabled) Sets whether html sanitizer is enabled or not for notification content.void
void
setPosition
(Notifications.Position position) Sets notification position.void
setStyleName
(String styleName) Sets notification style name.void
Sets notification type.void
show()
Shows notification.protected void
protected void
subscribeOnAction
(Frame owner) protected void
subscribeOnButton
(Frame owner) Methods inherited from class io.jmix.ui.component.impl.AbstractFacet
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
-
Field Details
-
description
-
delayMs
protected int delayMs -
styleName
-
type
-
contentMode
-
position
-
descriptionProvider
-
closeListeners
-
actionId
-
buttonId
-
htmlSanitizerEnabled
protected boolean htmlSanitizerEnabled
-
Constructor Details
-
NotificationFacetImpl
public NotificationFacetImpl()
-
-
Method Details
-
setCaption
Description copied from interface:NotificationFacet
Sets notification caption.- Specified by:
setCaption
in interfaceNotificationFacet
- Parameters:
caption
- caption
-
getCaption
- Specified by:
getCaption
in interfaceNotificationFacet
- Returns:
- notification caption
-
setDescription
Description copied from interface:NotificationFacet
Sets notification description.- Specified by:
setDescription
in interfaceNotificationFacet
- Parameters:
description
- description
-
getDescription
- Specified by:
getDescription
in interfaceNotificationFacet
- Returns:
- notification description
-
setType
Description copied from interface:NotificationFacet
Sets notification type.- Specified by:
setType
in interfaceNotificationFacet
- Parameters:
type
- type
-
getType
- Specified by:
getType
in interfaceNotificationFacet
- Returns:
- notification type
-
setDelay
public void setDelay(int delayMs) Description copied from interface:NotificationFacet
Sets the delay before the notification disappears.- Specified by:
setDelay
in interfaceNotificationFacet
- Parameters:
delayMs
- the desired delay in milliseconds
-
getDelay
public int getDelay()- Specified by:
getDelay
in interfaceNotificationFacet
- Returns:
- the delay before the notification disappears
-
setContentMode
Description copied from interface:NotificationFacet
Sets notification content mode.- Specified by:
setContentMode
in interfaceNotificationFacet
- Parameters:
contentMode
- content mode
-
getContentMode
- Specified by:
getContentMode
in interfaceNotificationFacet
- Returns:
- notification content mode
-
setStyleName
Description copied from interface:NotificationFacet
Sets notification style name.- Specified by:
setStyleName
in interfaceNotificationFacet
- Parameters:
styleName
- style name
-
getStyleName
- Specified by:
getStyleName
in interfaceNotificationFacet
- Returns:
- notification style name
-
setPosition
Description copied from interface:NotificationFacet
Sets notification position.- Specified by:
setPosition
in interfaceNotificationFacet
- Parameters:
position
- position
-
getPosition
- Specified by:
getPosition
in interfaceNotificationFacet
- Returns:
- notification position
-
addCloseListener
Description copied from interface:NotificationFacet
Adds the givenConsumer
as notificationNotifications.CloseEvent
listener.- Specified by:
addCloseListener
in interfaceNotificationFacet
- Parameters:
listener
- close event listener- Returns:
- close event subscription
-
internalRemoveCloseListener
-
setCaptionProvider
Description copied from interface:NotificationFacet
Sets the givenSupplier
as notification caption provider.- Specified by:
setCaptionProvider
in interfaceNotificationFacet
- Parameters:
captionProvider
- notification caption provider
-
getCaptionProvider
- Specified by:
getCaptionProvider
in interfaceNotificationFacet
- Returns:
- notification caption provider
-
setDescriptionProvider
Description copied from interface:NotificationFacet
Sets the givenSupplier
as notification description provider.- Specified by:
setDescriptionProvider
in interfaceNotificationFacet
- Parameters:
descriptionProvider
- notification description provider
-
getDescriptionProvider
- Specified by:
getDescriptionProvider
in interfaceNotificationFacet
- Returns:
- notification description provider
-
getActionTarget
- Specified by:
getActionTarget
in interfaceNotificationFacet
- Returns:
- id of action that triggers notification
-
setActionTarget
Description copied from interface:NotificationFacet
Sets that notification should be shown when action with idactionId
is performed.- Specified by:
setActionTarget
in interfaceNotificationFacet
- Parameters:
actionId
- action id
-
getButtonTarget
- Specified by:
getButtonTarget
in interfaceNotificationFacet
- Returns:
- id of button that triggers notification
-
setButtonTarget
Description copied from interface:NotificationFacet
Sets that notification should be shown when button with idactionId
is clicked.- Specified by:
setButtonTarget
in interfaceNotificationFacet
- Parameters:
buttonId
- button id
-
setHtmlSanitizerEnabled
public void setHtmlSanitizerEnabled(boolean htmlSanitizerEnabled) Description copied from interface:NotificationFacet
Sets whether html sanitizer is enabled or not for notification content.- Specified by:
setHtmlSanitizerEnabled
in interfaceNotificationFacet
- Parameters:
htmlSanitizerEnabled
- specifies whether html sanitizer is enabled
-
isHtmlSanitizerEnabled
public boolean isHtmlSanitizerEnabled()- Specified by:
isHtmlSanitizerEnabled
in interfaceNotificationFacet
- Returns:
- html sanitizer is enabled for notification content
-
setOwner
Description copied from interface:Facet
- Specified by:
setOwner
in interfaceFacet
- Overrides:
setOwner
in classAbstractFacet
- Parameters:
owner
- owner frame
-
show
public void show()Description copied from interface:NotificationFacet
Shows notification.- Specified by:
show
in interfaceNotificationFacet
-
subscribe
protected void subscribe() -
subscribeOnAction
-
subscribeOnButton
-