Search in sources :

Example 1 with ContentMode

use of com.haulmont.cuba.gui.components.ContentMode in project cuba by cuba-platform.

the class WebNotificationFacet method show.

@Override
public void show() {
    Frame owner = getOwner();
    if (owner == null) {
        throw new IllegalStateException("Notification is not attached to Frame");
    }
    Notifications notifications = UiControllerUtils.getScreenContext(owner.getFrameOwner()).getNotifications();
    String caption = this.caption;
    if (captionProvider != null) {
        caption = captionProvider.get();
    }
    String description = this.description;
    if (descriptionProvider != null) {
        description = descriptionProvider.get();
    }
    notifications.create(type).withCaption(caption).withDescription(description).withHideDelayMs(delayMs).withContentMode(contentMode).withHtmlSanitizer(htmlSanitizerEnabled).withStyleName(styleName).withPosition(position).withCloseListener(e -> publish(CloseEvent.class, new CloseEvent(this))).show();
}
Also used : NotificationFacet(com.haulmont.cuba.gui.components.NotificationFacet) Frame(com.haulmont.cuba.gui.components.Frame) NotificationType(com.haulmont.cuba.gui.Notifications.NotificationType) Button(com.haulmont.cuba.gui.components.Button) ContentMode(com.haulmont.cuba.gui.components.ContentMode) Supplier(java.util.function.Supplier) StringUtils.isNotEmpty(org.apache.commons.lang3.StringUtils.isNotEmpty) Consumer(java.util.function.Consumer) Subscription(com.haulmont.bali.events.Subscription) GuiDevelopmentException(com.haulmont.cuba.gui.GuiDevelopmentException) Notifications(com.haulmont.cuba.gui.Notifications) WebAbstractFacet(com.haulmont.cuba.web.gui.WebAbstractFacet) BaseAction(com.haulmont.cuba.gui.components.actions.BaseAction) Component(com.haulmont.cuba.gui.components.Component) Action(com.haulmont.cuba.gui.components.Action) Nullable(javax.annotation.Nullable) UiControllerUtils(com.haulmont.cuba.gui.screen.UiControllerUtils) Frame(com.haulmont.cuba.gui.components.Frame) Notifications(com.haulmont.cuba.gui.Notifications)

Aggregations

Subscription (com.haulmont.bali.events.Subscription)1 GuiDevelopmentException (com.haulmont.cuba.gui.GuiDevelopmentException)1 Notifications (com.haulmont.cuba.gui.Notifications)1 NotificationType (com.haulmont.cuba.gui.Notifications.NotificationType)1 Action (com.haulmont.cuba.gui.components.Action)1 Button (com.haulmont.cuba.gui.components.Button)1 Component (com.haulmont.cuba.gui.components.Component)1 ContentMode (com.haulmont.cuba.gui.components.ContentMode)1 Frame (com.haulmont.cuba.gui.components.Frame)1 NotificationFacet (com.haulmont.cuba.gui.components.NotificationFacet)1 BaseAction (com.haulmont.cuba.gui.components.actions.BaseAction)1 UiControllerUtils (com.haulmont.cuba.gui.screen.UiControllerUtils)1 WebAbstractFacet (com.haulmont.cuba.web.gui.WebAbstractFacet)1 Consumer (java.util.function.Consumer)1 Supplier (java.util.function.Supplier)1 Nullable (javax.annotation.Nullable)1 StringUtils.isNotEmpty (org.apache.commons.lang3.StringUtils.isNotEmpty)1