Search in sources :

Example 11 with YesNoCancelPopup

use of org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup in project kie-wb-common by kiegroup.

the class JPADataObjectEditorViewImpl method showYesNoCancelPopup.

@Override
public void showYesNoCancelPopup(String title, String message, Command yesCommand, String yesButtonText, ButtonType yesButtonType, Command noCommand, String noButtonText, ButtonType noButtonType, Command cancelCommand, String cancelButtonText, ButtonType cancelButtonType) {
    YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, yesButtonText, yesButtonType, noCommand, noButtonText, noButtonType, cancelCommand, cancelButtonText, cancelButtonType);
    yesNoCancelPopup.setClosable(false);
    yesNoCancelPopup.show();
}
Also used : YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 12 with YesNoCancelPopup

use of org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup in project kie-wb-common by kiegroup.

the class ImportsWidgetViewImpl method setup.

private void setup() {
    // Setup table
    table.setStriped(true);
    table.setCondensed(true);
    table.setBordered(true);
    table.setEmptyTableWidget(new Label(ImportConstants.INSTANCE.noImportsDefined()));
    // Columns
    final TextColumn<Import> importTypeColumn = new TextColumn<Import>() {

        @Override
        public String getValue(final Import importType) {
            return importType.getType();
        }
    };
    final ButtonCell deleteImportButton = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL);
    final Column<Import, String> deleteImportColumn = new Column<Import, String>(deleteImportButton) {

        @Override
        public String getValue(final Import importType) {
            return ImportConstants.INSTANCE.remove();
        }
    };
    deleteImportColumn.setFieldUpdater((index, importType, value) -> {
        if (isReadOnly) {
            return;
        }
        final YesNoCancelPopup confirm = YesNoCancelPopup.newYesNoCancelPopup(ImportConstants.INSTANCE.remove(), ImportConstants.INSTANCE.promptForRemovalOfImport0(importType.getType()), () -> getRemoveImportCommand().execute(importType), () -> {
        /*Nothing*/
        }, null);
        confirm.show();
    });
    table.addColumn(importTypeColumn, new TextHeader(ImportConstants.INSTANCE.importType()));
    table.addColumn(deleteImportColumn, ImportConstants.INSTANCE.remove());
    // Link data
    getDataProvider().addDataDisplay(table);
    getDataProvider().setList(importTypes);
}
Also used : Import(org.kie.soup.project.datamodel.imports.Import) TextColumn(com.google.gwt.user.cellview.client.TextColumn) Column(com.google.gwt.user.cellview.client.Column) Label(org.gwtbootstrap3.client.ui.Label) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup) TextHeader(com.google.gwt.user.cellview.client.TextHeader) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell) TextColumn(com.google.gwt.user.cellview.client.TextColumn)

Example 13 with YesNoCancelPopup

use of org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup in project kie-wb-common by kiegroup.

the class DefaultWorkbenchErrorCallback method error.

@Override
public boolean error(final Message message, final Throwable throwable) {
    if (isInvalidBusContentException(throwable)) {
        final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup(DefaultWorkbenchConstants.INSTANCE.SessionTimeout(), DefaultWorkbenchConstants.INSTANCE.InvalidBusResponseProbablySessionTimeout(), Window.Location::reload, null, () -> {
        });
        result.clearScrollHeight();
        result.show();
        return false;
    } else if (isKieServerForbiddenException(throwable)) {
        ErrorPopup.showMessage(DefaultWorkbenchConstants.INSTANCE.KieServerError403());
        return false;
    } else if (isKieServerUnauthorizedException(throwable)) {
        ErrorPopup.showMessage(DefaultWorkbenchConstants.INSTANCE.KieServerError401());
        return false;
    } else if (throwable instanceof KieServicesHttpException) {
        KieServicesHttpException ex = (KieServicesHttpException) throwable;
        ErrorPopup.showMessage(CommonConstants.INSTANCE.ExceptionGeneric0(ex.getExceptionMessage()));
        return false;
    } else {
        return super.error(message, throwable);
    }
}
Also used : KieServicesHttpException(org.kie.server.api.exception.KieServicesHttpException) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 14 with YesNoCancelPopup

use of org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup in project kie-wb-common by kiegroup.

the class PopupsUtil method showOkButtonPopup.

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();
}
Also used : Command(org.uberfire.mvp.Command) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 15 with YesNoCancelPopup

use of org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup in project kie-wb-common by kiegroup.

the class DataModelerScreenViewImpl method showYesNoCancelPopup.

@Override
public void showYesNoCancelPopup(String title, String message, Command yesCommand, String yesButtonText, ButtonType yesButtonType, Command noCommand, String noButtonText, ButtonType noButtonType) {
    YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, yesButtonText, yesButtonType, noCommand, noButtonText, noButtonType, new Command() {

        @Override
        public void execute() {
        // do nothing, but let the cancel button be shown.
        }
    }, null, null);
    yesNoCancelPopup.setClosable(false);
    yesNoCancelPopup.show();
}
Also used : Command(org.uberfire.mvp.Command) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Aggregations

YesNoCancelPopup (org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)21 Command (org.uberfire.mvp.Command)9 ClientSessionCommand (org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand)3 Column (com.google.gwt.user.cellview.client.Column)2 TextColumn (com.google.gwt.user.cellview.client.TextColumn)2 TextHeader (com.google.gwt.user.cellview.client.TextHeader)2 Label (org.gwtbootstrap3.client.ui.Label)2 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)2 Import (org.kie.soup.project.datamodel.imports.Import)2 ToolbarCommand (org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand)2 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)1 Element (com.google.gwt.dom.client.Element)1 NativeEvent (com.google.gwt.dom.client.NativeEvent)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)1 UiHandler (com.google.gwt.uibinder.client.UiHandler)1 KieServicesHttpException (org.kie.server.api.exception.KieServicesHttpException)1 ClearSessionCommand (org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand)1 ClearStatesSessionCommand (org.kie.workbench.common.stunner.core.client.session.command.impl.ClearStatesSessionCommand)1 CopySelectionSessionCommand (org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand)1