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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected List<Consumer<Notifications.CloseEvent>>protected ContentModeprotected intprotected Stringprotected booleanprotected Notifications.Positionprotected Stringprotected Notifications.NotificationTypeFields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCloseListener(Consumer<Notifications.CloseEvent> listener) Adds the givenConsumeras notificationNotifications.CloseEventlistener.intgetDelay()getType()protected voidbooleanvoidsetActionTarget(String actionId) Sets that notification should be shown when action with idactionIdis performed.voidsetButtonTarget(String buttonId) Sets that notification should be shown when button with idactionIdis clicked.voidsetCaption(String caption) Sets notification caption.voidsetCaptionProvider(Supplier<String> captionProvider) Sets the givenSupplieras notification caption provider.voidsetContentMode(ContentMode contentMode) Sets notification content mode.voidsetDelay(int delayMs) Sets the delay before the notification disappears.voidsetDescription(String description) Sets notification description.voidsetDescriptionProvider(Supplier<String> descriptionProvider) Sets the givenSupplieras notification description provider.voidsetHtmlSanitizerEnabled(boolean htmlSanitizerEnabled) Sets whether html sanitizer is enabled or not for notification content.voidvoidsetPosition(Notifications.Position position) Sets notification position.voidsetStyleName(String styleName) Sets notification style name.voidSets notification type.voidshow()Shows notification.protected voidprotected voidsubscribeOnAction(Frame owner) protected voidsubscribeOnButton(Frame owner) Methods inherited from class io.jmix.ui.component.impl.AbstractFacet
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
-
Field Details
-
caption
-
description
-
delayMs
protected int delayMs -
styleName
-
type
-
contentMode
-
position
-
captionProvider
-
descriptionProvider
-
closeListeners
-
actionId
-
buttonId
-
htmlSanitizerEnabled
protected boolean htmlSanitizerEnabled
-
-
Constructor Details
-
NotificationFacetImpl
public NotificationFacetImpl()
-
-
Method Details
-
setCaption
Description copied from interface:NotificationFacetSets notification caption.- Specified by:
setCaptionin interfaceNotificationFacet- Parameters:
caption- caption
-
getCaption
- Specified by:
getCaptionin interfaceNotificationFacet- Returns:
- notification caption
-
setDescription
Description copied from interface:NotificationFacetSets notification description.- Specified by:
setDescriptionin interfaceNotificationFacet- Parameters:
description- description
-
getDescription
- Specified by:
getDescriptionin interfaceNotificationFacet- Returns:
- notification description
-
setType
Description copied from interface:NotificationFacetSets notification type.- Specified by:
setTypein interfaceNotificationFacet- Parameters:
type- type
-
getType
- Specified by:
getTypein interfaceNotificationFacet- Returns:
- notification type
-
setDelay
public void setDelay(int delayMs) Description copied from interface:NotificationFacetSets the delay before the notification disappears.- Specified by:
setDelayin interfaceNotificationFacet- Parameters:
delayMs- the desired delay in milliseconds
-
getDelay
public int getDelay()- Specified by:
getDelayin interfaceNotificationFacet- Returns:
- the delay before the notification disappears
-
setContentMode
Description copied from interface:NotificationFacetSets notification content mode.- Specified by:
setContentModein interfaceNotificationFacet- Parameters:
contentMode- content mode
-
getContentMode
- Specified by:
getContentModein interfaceNotificationFacet- Returns:
- notification content mode
-
setStyleName
Description copied from interface:NotificationFacetSets notification style name.- Specified by:
setStyleNamein interfaceNotificationFacet- Parameters:
styleName- style name
-
getStyleName
- Specified by:
getStyleNamein interfaceNotificationFacet- Returns:
- notification style name
-
setPosition
Description copied from interface:NotificationFacetSets notification position.- Specified by:
setPositionin interfaceNotificationFacet- Parameters:
position- position
-
getPosition
- Specified by:
getPositionin interfaceNotificationFacet- Returns:
- notification position
-
addCloseListener
Description copied from interface:NotificationFacetAdds the givenConsumeras notificationNotifications.CloseEventlistener.- Specified by:
addCloseListenerin interfaceNotificationFacet- Parameters:
listener- close event listener- Returns:
- close event subscription
-
internalRemoveCloseListener
-
setCaptionProvider
Description copied from interface:NotificationFacetSets the givenSupplieras notification caption provider.- Specified by:
setCaptionProviderin interfaceNotificationFacet- Parameters:
captionProvider- notification caption provider
-
getCaptionProvider
- Specified by:
getCaptionProviderin interfaceNotificationFacet- Returns:
- notification caption provider
-
setDescriptionProvider
Description copied from interface:NotificationFacetSets the givenSupplieras notification description provider.- Specified by:
setDescriptionProviderin interfaceNotificationFacet- Parameters:
descriptionProvider- notification description provider
-
getDescriptionProvider
- Specified by:
getDescriptionProviderin interfaceNotificationFacet- Returns:
- notification description provider
-
getActionTarget
- Specified by:
getActionTargetin interfaceNotificationFacet- Returns:
- id of action that triggers notification
-
setActionTarget
Description copied from interface:NotificationFacetSets that notification should be shown when action with idactionIdis performed.- Specified by:
setActionTargetin interfaceNotificationFacet- Parameters:
actionId- action id
-
getButtonTarget
- Specified by:
getButtonTargetin interfaceNotificationFacet- Returns:
- id of button that triggers notification
-
setButtonTarget
Description copied from interface:NotificationFacetSets that notification should be shown when button with idactionIdis clicked.- Specified by:
setButtonTargetin interfaceNotificationFacet- Parameters:
buttonId- button id
-
setHtmlSanitizerEnabled
public void setHtmlSanitizerEnabled(boolean htmlSanitizerEnabled) Description copied from interface:NotificationFacetSets whether html sanitizer is enabled or not for notification content.- Specified by:
setHtmlSanitizerEnabledin interfaceNotificationFacet- Parameters:
htmlSanitizerEnabled- specifies whether html sanitizer is enabled
-
isHtmlSanitizerEnabled
public boolean isHtmlSanitizerEnabled()- Specified by:
isHtmlSanitizerEnabledin interfaceNotificationFacet- Returns:
- html sanitizer is enabled for notification content
-
setOwner
Description copied from interface:Facet- Specified by:
setOwnerin interfaceFacet- Overrides:
setOwnerin classAbstractFacet- Parameters:
owner- owner frame
-
show
public void show()Description copied from interface:NotificationFacetShows notification.- Specified by:
showin interfaceNotificationFacet
-
subscribe
protected void subscribe() -
subscribeOnAction
-
subscribeOnButton
-