private void executeWithConfirm(final String message, final Command command) { final Command yesCommand = command::execute; final Command noCommand = () -> { }; final YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup(message, null, yesCommand, noCommand, noCommand); popup.show(); }
private void showNotificationPopup(final String title, final String message) { YesNoCancelPopup popup = newNotificationPopup(title, message); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); }
public void showYesNoPopup( final String title, final String message, final Command yesCommand, final String yesButtonText, final ButtonType yesButtonType, final Command noCommand, final String noButtonText, final ButtonType noButtonType ) { YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup( title, message, yesCommand, yesButtonText, yesButtonType, noCommand, noButtonText, noButtonType, null, null, null ); yesNoCancelPopup.setClosable( false ); yesNoCancelPopup.show(); }
@Override public void confirmRemove(final Command command) { final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup(getConfirmRemovePopupTitle(), getConfirmRemovePopupMessage(), command, new Command() { @Override public void execute() { } }, null); result.clearScrollHeight(); result.show(); }
@EventHandler("delete") public void onDelete(ClickEvent event) { YesNoCancelPopup popupup = YesNoCancelPopup.newYesNoCancelPopup(translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplDelete), translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplDeleteMessage), null, null, null, () -> { }, translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplCancel), ButtonType.DEFAULT, () -> presenter.notifyDelete(), translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplDelete), ButtonType.DANGER); popupup.setSize(ModalSize.SMALL); popupup.clearScrollHeight(); popupup.show(); } }
protected YesNoCancelPopup newYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { return YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, noCommand, null); }
@Override public void onClick(ClickEvent event) { getYesNoCancelPopup(safeHtmlGridHeader, key).show(); } });
private static void showOkButtonPopup( final String title, final String message ) { YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup( title, message, new Command() { @Override public void execute() { } }, CommonConstants.INSTANCE.OK(), null, null, null, null ); yesNoCancelPopup.setClosable( false ); yesNoCancelPopup.show(); }
@Override public void confirmRemove(final Command command) { final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup(getTemplateRemovePopupTitle(), getTemplateRemovePopupText(), command, new Command() { @Override public void execute() { } }, null); result.clearScrollHeight(); result.show(); }
@EventHandler("delete") public void onDelete(ClickEvent event) { YesNoCancelPopup popupup = YesNoCancelPopup.newYesNoCancelPopup(translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplDelete), translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplDeleteMessage), null, null, null, () -> { }, translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplCancel), ButtonType.DEFAULT, () -> presenter.notifyDelete(), translationService.getTranslation(AppformerSSHConstants.SSHKeyEditorViewImplDelete), ButtonType.DANGER); popupup.setSize(ModalSize.SMALL); popupup.clearScrollHeight(); popupup.show(); } }
protected YesNoCancelPopup newYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { return YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, noCommand, null); }
@Override public void onClick(ClickEvent event) { getYesNoCancelPopup(safeHtmlGridHeader, key).show(); } });
@Override public void show(String title, String message, Command yesCommand) { YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, null, null).show(); } }
public static void showDeletePopup(final String contentText, final Command yesCommand) { YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup(CommonConstants.INSTANCE.Information(), contentText, yesCommand, ); yesNoCancelPopup.setClosable(false); yesNoCancelPopup.show();
public void showYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { YesNoCancelPopup popup = newYesNoPopup(title, message, yesCommand, noCommand); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); }
public void error(final Throwable throwable) { final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup( DefaultWorkbenchConstants.INSTANCE.SessionTimeout(), DefaultWorkbenchConstants.INSTANCE.InvalidBusResponseProbablySessionTimeout(), }); result.clearScrollHeight(); result.show(); return;
protected YesNoCancelPopup newNotificationPopup(final String title, final String message) { return YesNoCancelPopup.newYesNoCancelPopup(title, message, () -> { }, CommonConstants.INSTANCE.OK(), null, null, null, null); } }
@Test public void testRemoveTab() throws Exception { final Element element = mock(Element.class); when(element.getStyle()).thenReturn(mock(Style.class)); when(button.getElement()).thenReturn(element); when(button.addClickHandler(any(ClickHandler.class))).thenAnswer(new Answer() { public Object answer(InvocationOnMock aInvocation) throws Throwable { clickHandler = (ClickHandler) aInvocation.getArguments()[0]; return null; } }); final YesNoCancelPopup yesNoCancelPopup = mock(YesNoCancelPopup.class); doReturn(yesNoCancelPopup).when(filterPagedTable).getYesNoCancelPopup(anyString(), anyString()); filterPagedTable.addTab(mock(PagedTable.class), "", mock(Command.class)); clickHandler.onClick(new ClickEvent() { }); verify(yesNoCancelPopup).show(); verify(filterPagedTable, never()).removeTab(anyInt()); verify(filterPagedTable, never()).removeTab(anyString()); }
@Override public void show(String title, String message, Command yesCommand) { YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, null, null).show(); } }
@UiHandler("unlock") public void onForceUnlock(ClickEvent e) { final YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup(MetadataConstants.INSTANCE.ForceUnlockConfirmationTitle(), MetadataConstants.INSTANCE.ForceUnlockConfirmationText(metadata.getLockInfo().lockedBy()), new Command() { @Override public void execute() { forceUnlockHandler.run(); unlock.setEnabled(false); } }, new Command() { @Override public void execute() { } }, null); yesNoCancelPopup.setClosable(false); yesNoCancelPopup.show(); } }