@Override public LoadingBox.View show() { NotifySettings settings = NotifySettings.newSettings(); settings.setShowProgressbar(true); settings.setPauseOnMouseOver(false); Notify.notify("Please wait", "Loading...", IconType.CLOCK_O, settings); return this; }
/** * Set the Notify's close event handler. This event is fired immediately when * the notification is closing. * * @param handler */ public final void setCloseHandler(final NotifyCloseHandler handler) { onClose((handler != null) ? handler : NotifyCloseHandler.DEFAULT_CLOSE_HANDLER); }
/** * Set the Notify's closed event handler. This event is fired when the modal * has finished closing and is removed from the document (will wait for CSS * transitions to complete). * * @param handler */ public final void setClosedHandler(final NotifyClosedHandler handler) { onClosed((handler != null) ? handler : NotifyClosedHandler.DEFAULT_CLOSED_HANDLER); }
/** * Set custom style name to Notify. Resulting class name is "alert-[customType]". * * @param customType Style name to set */ public final native void setType(String customType) /*-{ this.type = customType; }-*/;
@PostConstruct public void init() { settings.setShowProgressbar(false); settings.setPauseOnMouseOver(true); settings.setAllowDismiss(true); settings.setDelay(DELAY); settings.setTimer(TIMER); handlerRegistration = addDomHandler((e) -> { e.preventDefault(); e.stopPropagation(); }, ContextMenuEvent.getType()); addAttachHandler(event -> { if (event.isAttached()) { getElement().getParentElement().getStyle().setHeight(100.0, Style.Unit.PCT); getElement().getParentElement().getStyle().setWidth(100.0, Style.Unit.PCT); } }); showLoading(false); //getting initial palette position paletteInitialTop = palettePanel.getAbsoluteTop(); paletteInitialLeft = palettePanel.getAbsoluteLeft(); }
/** * Set the Notify's shown event handler. This event is fired when the modal has * been made visible to the user (will wait for CSS transitions to complete). * * @param handler */ public final void setShownHandler(final NotifyShownHandler handler) { onShown((handler != null) ? handler : NotifyShownHandler.DEFAULT_SHOWN_HANDLER); }
/** * Set the Notify's show event handler. The show event fires immediately when * the show instance method is called. * * @param handler */ public final void setShowHandler(final NotifyShowHandler handler) { onShow((handler != null) ? handler : NotifyShowHandler.DEFAULT_SHOW_HANDLER); }
/** * Set Animation to Notify when it enters and exit the screen. * * Default is enter = Animation.FADE_IN_DOWN, exit = Animation.FADE_OUT_UP * * @see org.gwtbootstrap3.extras.animate.client.ui.constants.Animation * * @param enter animation style when Notify enters the screen * @param exit animation style when Notify exists the screen */ public final void setAnimation(Animation enter, Animation exit) { setAnimation((enter != null) ? enter.getCssName() : Animation.NO_ANIMATION.getCssName(), (exit != null) ? exit.getCssName() : Animation.NO_ANIMATION.getCssName()); }
/** * Set custom style name to Notify. Resulting class name is "alert-[customType]". * * @param customType Style name to set */ public final native void setType(String customType) /*-{ this.type = customType; }-*/;
/** * Set the Notify's shown event handler. This event is fired when the modal has * been made visible to the user (will wait for CSS transitions to complete). * * @param handler */ public final void setShownHandler(final NotifyShownHandler handler) { onShown((handler != null) ? handler : NotifyShownHandler.DEFAULT_SHOWN_HANDLER); }
/** * Set the Notify's show event handler. The show event fires immediately when * the show instance method is called. * * @param handler */ public final void setShowHandler(final NotifyShowHandler handler) { onShow((handler != null) ? handler : NotifyShowHandler.DEFAULT_SHOW_HANDLER); }
/** * Set Animation to Notify when it enters and exit the screen. * * Default is enter = Animation.FADE_IN_DOWN, exit = Animation.FADE_OUT_UP * * @see org.gwtbootstrap3.extras.animate.client.ui.constants.Animation * * @param enter animation style when Notify enters the screen * @param exit animation style when Notify exists the screen */ public final void setAnimation(Animation enter, Animation exit) { setAnimation((enter != null) ? enter.getCssName() : Animation.NO_ANIMATION.getCssName(), (exit != null) ? exit.getCssName() : Animation.NO_ANIMATION.getCssName()); }
@Override public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; }
/** * Set the Notify's closed event handler. This event is fired when the modal * has finished closing and is removed from the document (will wait for CSS * transitions to complete). * * @param handler */ public final void setClosedHandler(final NotifyClosedHandler handler) { onClosed((handler != null) ? handler : NotifyClosedHandler.DEFAULT_CLOSED_HANDLER); }
/** * Set the Notify's close event handler. This event is fired immediately when * the notification is closing. * * @param handler */ public final void setCloseHandler(final NotifyCloseHandler handler) { onClose((handler != null) ? handler : NotifyCloseHandler.DEFAULT_CLOSE_HANDLER); }
@Override public SessionPresenterView showMessage(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.SUCCESS)); showNotification(translate(SessionPresenterView_Info), message, IconType.INFO_CIRCLE); return this; }
@Override public SessionPresenter.View showWarning(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.WARNING)); showNotification(translate(SessionPresenterView_Warning), message, IconType.EXCLAMATION_TRIANGLE); return this; }
@Test public void testShowWarning() { final SessionPresenterView view = spy(new SessionPresenterView()); final String message = "Hello<br />World"; final String warning = "Warning"; when(translationService.getTranslation(SessionPresenterView_Warning)).thenReturn(warning); when(view.getTranslationService()).thenReturn(translationService); when(view.getSettings()).thenReturn(settings); view.showWarning(message); verify(settings).setType("warning kie-session-notification"); verify(view).showNotification(warning, message, IconType.EXCLAMATION_TRIANGLE); }
@Test public void testShowError() { final SessionPresenterView view = spy(new SessionPresenterView()); final String message = "Hello<br />World"; final String error = "Error"; when(translationService.getTranslation(SessionPresenterView_Error)).thenReturn(error); when(view.getTranslationService()).thenReturn(translationService); when(view.getSettings()).thenReturn(settings); view.showError(message); verify(settings).setType("danger kie-session-notification"); verify(view).showNotification(error, message, IconType.EXCLAMATION_CIRCLE); }
@Test public void testShowMessage() { final SessionPresenterView view = spy(new SessionPresenterView()); final String message = "Hello<br />World"; final String info = "Info"; when(translationService.getTranslation(SessionPresenterView_Info)).thenReturn(info); when(view.getTranslationService()).thenReturn(translationService); when(view.getSettings()).thenReturn(settings); view.showMessage(message); verify(settings).setType("success kie-session-notification"); verify(view).showNotification(info, message, IconType.INFO_CIRCLE); }