Interface NotificationFacet

All Superinterfaces:
Facet
All Known Implementing Classes:
NotificationFacetImpl

@StudioFacet(xmlElement="notification", caption="Notification", description="Prepares and shows notifications", defaultProperty="caption", category="Facets", icon="io/jmix/ui/icon/facet/notification.svg", documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/facets/notification-facet.html") public interface NotificationFacet extends Facet
Prepares and shows notifications.
  • Method Details

    • setCaption

      @StudioProperty(type=LOCALIZED_STRING) void setCaption(@Nullable String caption)
      Sets notification caption.
      Parameters:
      caption - caption
    • getCaption

      @Nullable String getCaption()
      Returns:
      notification caption
    • setDescription

      @StudioProperty(type=LOCALIZED_STRING) void setDescription(@Nullable String description)
      Sets notification description.
      Parameters:
      description - description
    • getDescription

      @Nullable String getDescription()
      Returns:
      notification description
    • setDelay

      @StudioProperty @PositiveOrZero void setDelay(int delayMs)
      Sets the delay before the notification disappears.
      Parameters:
      delayMs - the desired delay in milliseconds
    • getDelay

      int getDelay()
      Returns:
      the delay before the notification disappears
    • setType

      Sets notification type.
      Parameters:
      type - type
    • getType

      Returns:
      notification type
    • setContentMode

      @StudioProperty(type=ENUMERATION, defaultValue="TEXT", options={"HTML","TEXT"}) void setContentMode(ContentMode contentMode)
      Sets notification content mode.
      Parameters:
      contentMode - content mode
    • getContentMode

      ContentMode getContentMode()
      Returns:
      notification content mode
    • setStyleName

      @StudioProperty(name="stylename", type=CSS_CLASSNAME_LIST) void setStyleName(String styleName)
      Sets notification style name.
      Parameters:
      styleName - style name
    • getStyleName

      @Nullable String getStyleName()
      Returns:
      notification style name
    • setPosition

      @StudioProperty(type=ENUMERATION, defaultValue="DEFAULT") void setPosition(Notifications.Position position)
      Sets notification position.
      Parameters:
      position - position
    • getPosition

      Notifications.Position getPosition()
      Returns:
      notification position
    • getActionTarget

      @Nullable String getActionTarget()
      Returns:
      id of action that triggers notification
    • setActionTarget

      @StudioProperty(name="onAction", type=COMPONENT_REF, options="io.jmix.ui.action.Action") void setActionTarget(@Nullable String actionId)
      Sets that notification should be shown when action with id actionId is performed.
      Parameters:
      actionId - action id
    • getButtonTarget

      @Nullable String getButtonTarget()
      Returns:
      id of button that triggers notification
    • setButtonTarget

      @StudioProperty(name="onButton", type=COMPONENT_REF, options="io.jmix.ui.component.Button") void setButtonTarget(@Nullable String buttonId)
      Sets that notification should be shown when button with id actionId is clicked.
      Parameters:
      buttonId - button id
    • setHtmlSanitizerEnabled

      @StudioProperty(type=BOOLEAN, defaultValue="true") void setHtmlSanitizerEnabled(boolean htmlSanitizerEnabled)
      Sets whether html sanitizer is enabled or not for notification content.
      Parameters:
      htmlSanitizerEnabled - specifies whether html sanitizer is enabled
    • isHtmlSanitizerEnabled

      boolean isHtmlSanitizerEnabled()
      Returns:
      html sanitizer is enabled for notification content
    • show

      void show()
      Shows notification.
    • setCaptionProvider

      void setCaptionProvider(@Nullable Supplier<String> captionProvider)
      Sets the given Supplier as notification caption provider.
      Parameters:
      captionProvider - notification caption provider
    • getCaptionProvider

      @Nullable Supplier<String> getCaptionProvider()
      Returns:
      notification caption provider
    • setDescriptionProvider

      void setDescriptionProvider(@Nullable Supplier<String> descriptionProvider)
      Sets the given Supplier as notification description provider.
      Parameters:
      descriptionProvider - notification description provider
    • getDescriptionProvider

      @Nullable Supplier<String> getDescriptionProvider()
      Returns:
      notification description provider
    • addCloseListener

      Subscription addCloseListener(Consumer<Notifications.CloseEvent> listener)
      Adds the given Consumer as notification Notifications.CloseEvent listener.
      Parameters:
      listener - close event listener
      Returns:
      close event subscription