Search in sources :

Example 1 with YesNoCancelPopup

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

the class MetadataWidget method onForceUnlock.

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

Example 2 with YesNoCancelPopup

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

the class AbstractToolbarCommand method executeWithConfirm.

protected void executeWithConfirm(final Command command) {
    final Command yesCommand = () -> {
        command.execute();
    };
    final Command noCommand = () -> {
    };
    // TODO: I18n.
    final YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup("Are you sure?", null, yesCommand, noCommand, noCommand);
    popup.show();
}
Also used : ClientSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand) ToolbarCommand(org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand) Command(org.uberfire.mvp.Command) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 3 with YesNoCancelPopup

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

the class AbstractToolbarCommand method executeWithConfirm.

private <V> void executeWithConfirm(final ClientSessionCommand.Callback<V> callback) {
    final Command yesCommand = () -> {
        this.executeWithNoConfirm(callback);
    };
    final Command noCommand = () -> {
    };
    final YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup(getConfirmMessage(), null, yesCommand, noCommand, noCommand);
    popup.show();
}
Also used : ClientSessionCommand(org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand) ToolbarCommand(org.kie.workbench.common.stunner.client.widgets.toolbar.ToolbarCommand) Command(org.uberfire.mvp.Command) YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 4 with YesNoCancelPopup

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

the class FormEditorViewImpl method showSavePopup.

@Override
public void showSavePopup(Path path, Command saveCommand, Command cancelCommand) {
    YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup(org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants.INSTANCE.Information(), translationService.getTranslation(FormEditorConstants.FormEditorViewImplSaveBeforeRename), saveCommand, CommonConstants.INSTANCE.Save(), null, null, cancelCommand, translationService.getTranslation(FormEditorConstants.FormEditorViewImplDontSave));
    popup.show();
}
Also used : YesNoCancelPopup(org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)

Example 5 with YesNoCancelPopup

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

the class DefaultSocialLinkCommandGenerator method generateNoRightsPopup.

void generateNoRightsPopup() {
    YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup(CommonConstants.INSTANCE.Information(), Constants.INSTANCE.Error_NoAccessRights(), null, null, () -> {
    /* do nothing, just to show the cancel button*/
    });
    popup.setClosable(false);
    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