Search in sources :

Example 16 with YesNoCancelPopup

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

the class DataModelerScreenViewImpl method showParseErrorsDialog.

@Override
public void showParseErrorsDialog(String title, String message, Command onCloseCommand) {
    YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup(title, message, onCloseCommand, CommonConstants.INSTANCE.OK(), null, null, null, null, null, null, null);
    yesNoCancelPopup.setClosable(false);
    yesNoCancelPopup.show();
}
Also used : YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 17 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, Command noCommand) {
    YesNoCancelPopup yesNoCancelPopup = YesNoCancelPopup.newYesNoCancelPopup(title, message, yesCommand, noCommand, new Command() {

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

Example 18 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) {

        @Override
        public void render(final com.google.gwt.cell.client.Cell.Context context, final SafeHtml data, final SafeHtmlBuilder sb) {
            // Don't render a "Delete" button for "internal" Fact Types
            if (isExternalImport(context.getIndex())) {
                super.render(context, data, sb);
            }
        }

        @Override
        public void onBrowserEvent(final Context context, final Element parent, final String value, final NativeEvent event, final ValueUpdater<String> valueUpdater) {
            // Don't act on cell interactions for "internal" Fact Types
            if (isExternalImport(context.getIndex())) {
                super.onBrowserEvent(context, parent, value, event, valueUpdater);
            }
        }

        @Override
        protected void onEnterKeyDown(final Context context, final Element parent, final String value, final NativeEvent event, final ValueUpdater<String> valueUpdater) {
            // Don't act on cell interactions for "internal" Fact Types
            if (isExternalImport(context.getIndex())) {
                super.onEnterKeyDown(context, parent, value, event, valueUpdater);
            }
        }
    };
    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 display
    getDataProvider().addDataDisplay(table);
}
Also used : Import(org.kie.soup.project.datamodel.imports.Import) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) Element(com.google.gwt.dom.client.Element) Label(org.gwtbootstrap3.client.ui.Label) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup) TextHeader(com.google.gwt.user.cellview.client.TextHeader) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) TextColumn(com.google.gwt.user.cellview.client.TextColumn) Column(com.google.gwt.user.cellview.client.Column) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell) TextColumn(com.google.gwt.user.cellview.client.TextColumn) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 19 with YesNoCancelPopup

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

the class AbstractProjectDiagramEditor method executeWithConfirm.

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();
}
Also used : CopySelectionSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.CopySelectionSessionCommand) ClearStatesSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ClearStatesSessionCommand) ExportToPdfSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPdfSessionCommand) ClearSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ClearSessionCommand) DeleteSelectionSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.DeleteSelectionSessionCommand) PasteSelectionSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.PasteSelectionSessionCommand) RedoSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.RedoSessionCommand) CutSelectionSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.CutSelectionSessionCommand) UndoSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.UndoSessionCommand) ExportToPngSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToPngSessionCommand) ExportToBpmnSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToBpmnSessionCommand) ValidateSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ValidateSessionCommand) VisitGraphSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.VisitGraphSessionCommand) ClientSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand) Command(org.uberfire.mvp.Command) ExportToJpgSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.ExportToJpgSessionCommand) SwitchGridSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.impl.SwitchGridSessionCommand) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 20 with YesNoCancelPopup

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

the class PopupHelper method showYesNoPopup.

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();
}
Also used : 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