当前位置: 首页>>代码示例>>Java>>正文


Java ConfirmDialog.show方法代码示例

本文整理汇总了Java中org.vaadin.dialogs.ConfirmDialog.show方法的典型用法代码示例。如果您正苦于以下问题:Java ConfirmDialog.show方法的具体用法?Java ConfirmDialog.show怎么用?Java ConfirmDialog.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.vaadin.dialogs.ConfirmDialog的用法示例。


在下文中一共展示了ConfirmDialog.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onTabClose

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
@Override
    public void onTabClose(final TabSheet tabsheet, final Component tabContent) {
        if (tabContent instanceof DashboardTab) {
            final DashboardTab dashboardTab = (DashboardTab) tabContent;

            ConfirmDialog.show(UI.getCurrent(), Translate.getMessage("windowTitleConfirm"), "Delete tab?", Translate.getMessage("btnOK"), Translate.getMessage("btnCancel"), new ConfirmDialog.Listener() {

                @Override
                public void onClose(ConfirmDialog dialog) {
                    if (dialog.isConfirmed()) {
                        HybridbpmUI.getDashboardAPI().deleteTabDefinition(dashboardTab.getTabDefinition().getId(), true);

                        tabsheet.removeComponent(tabContent);
                        tabsheet.setSelectedTab(0);
                    } else {
//                                this.close();
                    }
                }
            });
        }
    }
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:22,代码来源:DashboardView.java

示例2: buttonClick

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
@Override
public void buttonClick(final Button.ClickEvent event) {
    if (event.getButton() instanceof TableButton && ((TableButton) event.getButton()).getType().equals(TableButton.TYPE.EDIT)) {
        addPermission(document, ((TableButton<Permission>) event.getButton()).getCustomData());
    } else  if (event.getButton() instanceof TableButton && ((TableButton) event.getButton()).getType().equals(TableButton.TYPE.DELETE)) {
        ConfirmDialog.show(UI.getCurrent(), Translate.getMessage("windowTitleConfirm"), Translate.getMessage("questionDeletePermission"), Translate.getMessage("btnOK"), Translate.getMessage("btnCancel"), new ConfirmDialog.Listener() {

            @Override
            public void onClose(ConfirmDialog dialog) {
                if (dialog.isConfirmed()) {
                    Permission permission = ((TableButton<Permission>) event.getButton()).getCustomData();
                    HybridbpmUI.getDocumentAPI().removeDocumentPermission(permission.getId().toString());
                    refreshTable();
                }
            }
        });
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:19,代码来源:DocumentAccessLayout.java

示例3: saveAskMsg

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
/**
 * Validates and saves changes with prior asking depending on customization
 * parameters.
 * 
 * @param actionClose
 *            the action to perform after successful saving. null - do
 *            nothing
 */
public void saveAskMsg(final Runnable actionClose) {
	if (!validateSave(true))
		return;
	if (isModified() && isAskSave()) {

		ConfirmDialog.show(getUI(), getI18S("SaveQ"),
				getI18S("Save_changesQ"), getI18S("btYes"),
				getI18S("btNo"), new Runnable() {

					@Override
					public void run() {
						if (saveChk())
							if (actionClose != null)
								actionClose.run();
					}
				});
	} else if (saveEInt())
		if (actionClose != null)
			actionClose.run();
}
 
开发者ID:mi9rom,项目名称:VaadHL,代码行数:29,代码来源:BaseEditWindow.java

示例4: discardAskMsg

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
/**
 * Validates and discards changes with behaviour depending on customization
 * parameters.
 * 
 * @param actionClose
 *            the action to perform after successful discarding. null - do
 *            nothing
 */
public void discardAskMsg(final Runnable actionClose) {
	if (!validateDiscard(true))
		return;

	if (isModified() && isAskDiscard()) {
		ConfirmDialog.show(getUI(), getI18S("DiscardQ"),
				getI18S("Discard_changesQ"), getI18S("btYes"),
				getI18S("btNo"), new Runnable() {

					@Override
					public void run() {
						if (discardChk())
							if (actionClose != null)
								actionClose.run();
					}
				});
	} else if (discardChk())
		if (actionClose != null)
			actionClose.run();
}
 
开发者ID:mi9rom,项目名称:VaadHL,代码行数:29,代码来源:BaseEditWindow.java

示例5: deleteAskMsg

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
/**
 * Validates and deletes the content with prior asking depending on
 * customization parameters.
 */
public void deleteAskMsg() {
	if (!canDeleteMsg())
		return;
	if (isAskDelete())
		ConfirmDialog.show(getUI(), getI18S("DeleteQ"),
				getI18S("Confirm_deleteQ"), getI18S("btYes"),
				getI18S("btNo"), new Runnable() {

					@Override
					public void run() {
						deleteIfNotMod();
					}
				});
	else
		deleteIfNotMod();
}
 
开发者ID:mi9rom,项目名称:VaadHL,代码行数:21,代码来源:BaseEditWindow.java

示例6: createAskMsg

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
/**
 * Validates and creates the content with prior asking depending on
 * customization parameters.
 */
public void createAskMsg() {
	if (!canCreateMsg())
		return;
	if (isAskCreate())
		ConfirmDialog.show(getUI(), getI18S("CreateQ"),
				getI18S("Confirm_createQ"), getI18S("btYes"),
				getI18S("btNo"), new Runnable() {

					@Override
					public void run() {
						createIfNotMod();
					}
				});
	else
		createIfNotMod();
}
 
开发者ID:mi9rom,项目名称:VaadHL,代码行数:21,代码来源:BaseEditWindow.java

示例7: run

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
public void run(final RunnableSer action) {
    checkNotNull(confirmCaption);
    checkNotNull(confirmMessage);
    checkNotNull(condition);
    checkNotNull(predictAction);
    checkNotNull(action);

    // проверяем выполняется ли условие
    if (!this.condition.get()) {
        // запрашиваем подтверждение на выполнение предварительных операций
        ConfirmDialog.show(UI.getCurrent(),
                confirmCaption,
                confirmMessage,
                "Да", "Нет",
                dialog -> {
                    if (dialog.isConfirmed()) {
                        // когда получили подтверждение - выполняем предварительные процедуры
                        predictAction.run();
                        // запускаем основную процедуру если предварительная закончилась успехом
                        if (this.condition.get())
                            action.run();
                    }
                });
    } else
        action.run();
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:27,代码来源:PredictConfirmedAction.java

示例8: exec

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
@Override
public void exec(final BaseCrudView<E> crud, final EntityItem<E> entity)
{
	ConfirmDialog.show(UI.getCurrent(), "Confirm Delete",
			"Are you sure you want to delete " + entity.getEntity().getName() + "?", "Delete", "Cancel",
			new ConfirmDialog.Listener()
			{
				private static final long serialVersionUID = 1L;

				@Override
				public void onClose(final ConfirmDialog dialog)
				{
					if (dialog.isConfirmed())
					{

						crud.delete();
					}
				}

			});

}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:23,代码来源:EventDetails.java

示例9: createMenuButtonForNotification

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
private Button createMenuButtonForNotification(VaadinIcons icon, String caption, String message) {
  final Button button
      = new Button(caption,
                   (e) -> {
                     UI ui = UI.getCurrent();
                     ConfirmDialog.show(
                         ui,
                         message, // ToDo extract in Executor
                         (ConfirmDialog.Listener) dialog -> {
                           if (dialog.isConfirmed()) {
                             VaadinSession vaadinSession = ui.getSession();
                             vaadinSession.setAttribute(SESSION_ATTRIBUTE_USER, null);
                             vaadinSession.close();
                             ui.getPage().setLocation("/");
                           }
                           else {
                             // User did not confirm
                             // CANCEL STUFF
                           }
                         });
                   });

  button.setIcon(icon);
  button.addStyleName(ValoTheme.BUTTON_HUGE);
  button.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
  button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
  button.addStyleName(ValoTheme.MENU_ITEM);
  button.setWidth("100%");

  button.setId(buttonID().apply(MainView.class, caption));

  return button;

}
 
开发者ID:Java-Publications,项目名称:javamagazin-009-microkernel,代码行数:35,代码来源:MainView.java

示例10: createMenuButtonForNotification

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
private Pair<String, Button> createMenuButtonForNotification(VaadinIcons icon, String caption, String message) {
  final Button button
      = new Button(caption,
                   (e) -> {
                     UI ui = UI.getCurrent();
                     ConfirmDialog.show(
                         ui,
                         message, // ToDo extract in Executor
                         (ConfirmDialog.Listener) dialog -> {
                           if (dialog.isConfirmed()) {

                             getSubject().logout(); //removes all identifying information and invalidates their session too.

                             VaadinSession vaadinSession = ui.getSession();
                             vaadinSession.setAttribute(SESSION_ATTRIBUTE_USER, null);
                             vaadinSession.close();
                             ui.getPage().setLocation("/");
                           }
                           else {
                             // User did not confirm
                             // CANCEL STUFF
                           }
                         });
                   });

  button.setIcon(icon);
  button.addStyleName(ValoTheme.BUTTON_HUGE);
  button.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
  button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
  button.addStyleName(ValoTheme.MENU_ITEM);
  button.setWidth("100%");

  button.setId(buttonID().apply(MainView.class, caption));

  return new Pair<>(mapToShiroRole(caption), button);

}
 
开发者ID:Java-Publications,项目名称:vaadin-016-helloworld-14,代码行数:38,代码来源:MenuComponent.java

示例11: fireClick

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
@Override
protected void fireClick(final MouseEventDetails details) {
    ConfirmDialog dialog = ConfirmDialog.show(getUI(), getConfirmWindowCaption(), getConfirmationText(), getOkCaption(),
            getCancelCaption(), new Runnable() {
                @Override
                public void run() {
                    doFireClickListener(details);
                }
            });

    dialog.getOkButton().addStyleName(confirmWindowOkButtonStyle);
}
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:13,代码来源:ConfirmButton.java

示例12: confirmDelete

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
@Override
public void confirmDelete(T entity) {
    ConfirmDialog.show(UI.getCurrent(), "Delete", "Are you sure you want to delete " + entityUtil.getDisplayName(entity) + "?", "OK", "Cancel",
            dialog -> {
                if (dialog.isConfirmed()) {
                    listeners.forEach(EntityEditorView.Listener::deleteConfirmed);
                }
            });
}
 
开发者ID:limbr-management,项目名称:limbr,代码行数:10,代码来源:EntityEditorViewImpl.java

示例13: deleteViewDefinitionWindow

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
public static void deleteViewDefinitionWindow(final ViewDefinition vd) {
        final ViewDefinition viewDefinition = vd;
        ConfirmDialog.show(UI.getCurrent(), Translate.getMessage("windowTitleConfirm"), "Delete view?", Translate.getMessage("btnOK"), Translate.getMessage("btnCancel"), new ConfirmDialog.Listener() {

                @Override
                public void onClose(ConfirmDialog dialog) {
                    if (dialog.isConfirmed()) {
                        HybridbpmUI.getDashboardAPI().deleteViewDefinition(viewDefinition.getId(), true);
                        HybridbpmUI.navigateTo(viewDefinition.getUrl());
                    } else {
//                                this.close();
                    }
                }
            });
    }
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:16,代码来源:ViewManager.java

示例14: deletePanel

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
private void deletePanel() {
    ConfirmDialog.show(UI.getCurrent(), Translate.getMessage("windowTitleConfirm"), "Delete panel?", Translate.getMessage("btnOK"), Translate.getMessage("btnCancel"), new ConfirmDialog.Listener() {

        @Override
        public void onClose(ConfirmDialog dialog) {
            if (dialog.isConfirmed()) {
                HybridbpmUI.getDashboardAPI().deletePanelDefinition(panelDefinition.getId().toString(), false);
                dashboardTab.refresh();
            }
        }
    });
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:13,代码来源:DashboardPanel.java

示例15: buttonClick

import org.vaadin.dialogs.ConfirmDialog; //导入方法依赖的package包/类
@Override
public void buttonClick(final Button.ClickEvent event) {
    super.buttonClick(event);
    if (event.getButton() instanceof TableButton && ((TableButton)event.getButton()).getType().equals(TableButton.TYPE.DELETE)) {
        ConfirmDialog.show(UI.getCurrent(), Translate.getMessage("windowTitleConfirm"), "Delete?", Translate.getMessage("btnOK"), Translate.getMessage("btnCancel"), new ConfirmDialog.Listener() {
            @Override
            public void onClose(ConfirmDialog dialog) {
                if (dialog.isConfirmed()) {
                    HybridbpmUI.getAccessAPI().removeInstance(((TableButton) event.getButton()).getCustomData().toString());
                    refreshTable();
                }
            }
        });
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:16,代码来源:AbstractAccessLayout.java


注:本文中的org.vaadin.dialogs.ConfirmDialog.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。