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


Java ConfirmDialog类代码示例

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


ConfirmDialog类属于org.vaadin.dialogs包,在下文中一共展示了ConfirmDialog类的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: create

import org.vaadin.dialogs.ConfirmDialog; //导入依赖的package包/类
@Override
public ConfirmDialog create(String caption, String message, String okCaption, String cancelCaption, String notOkCaption) {
    ConfirmDialog d = super.create(caption, message, okCaption, cancelCaption, notOkCaption);

    d.getContent().setStyleName("custom-dialog");
    d.getContent().setHeightUndefined();
    d.setHeightUndefined();

    Button ok = d.getOkButton();
    ok.setStyleName(WebThemes.BUTTON_ACTION);

    HorizontalLayout buttons = (HorizontalLayout) ok.getParent();
    buttons.setHeightUndefined();

    Button cancelBtn = d.getCancelButton();
    cancelBtn.setStyleName(WebThemes.BUTTON_OPTION);
    cancelBtn.focus();

    return d;
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:21,代码来源:ConfirmDialogExt.java

示例8: buttonClick

import org.vaadin.dialogs.ConfirmDialog; //导入依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
	
	if(event.getButton().equals(downloadButton)) {
		FileResource resource = new FileResource((File) filesTable.getValue());
		EnterpriseApplication.getInstance().getMainWindow().open(resource, "", true);
		updateTable();
		
	} else if(event.getButton().equals(deleteButton)) {
		Utils.yesNoDialog(this, Constants.uiConfirmDeletion, new ConfirmDialog.Listener() {
			
			public void onClose(ConfirmDialog dialog) {
				if(dialog.isConfirmed()) {
					File file = (File) filesTable.getValue();
					file.delete();
					updateTable();
				}
			}
			
		});
	}
	
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:24,代码来源:FilesViewerComponent.java

示例9: 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

示例10: 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

示例11: styleConfirmDialog

import org.vaadin.dialogs.ConfirmDialog; //导入依赖的package包/类
void styleConfirmDialog()
{
	final ConfirmDialog.Factory df = new DefaultConfirmDialogFactory()
	{
		private static final long serialVersionUID = 1L;

		// We change the default order of the buttons
		@Override
		public ConfirmDialog create(final String caption, final String message, final String okCaption,
				final String cancelCaption)
		{
			final ConfirmDialog d = super.create(caption, message, okCaption, cancelCaption);
			d.setStyleName("black");
			d.setModal(true);

			return d;
		}

	};
	ConfirmDialog.setFactory(df);

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

示例12: 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

示例13: 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

示例14: enter

import org.vaadin.dialogs.ConfirmDialog; //导入依赖的package包/类
@Override
public void enter(ViewChangeEvent event) {
    getAddButton().setCaption("Nouvelle aventure");
    setFilterAllowed(false);

    if (CurrentUser.get().getAdventure() == null) {

        grid.addComponentColumn(adventure -> {
            FButton button = new FButton("Joindre").withEnabled(adventure.isOpened())
                                                   .withStyleName(ValoTheme.BUTTON_PRIMARY)
                                                   .withClickListener(clickEvent -> {
                                                       ConfirmDialog.show(getUI(), "Joindre l'aventure",
                                                               "Êtes-vous certain de joindre cette aventure", "Oui", "Non", new Runnable() {

                                                                   @Override
                                                                   public void run() {
                                                                       User user = CurrentUser.get();
                                                                       user.setAdventure(adventure);
                                                                       user = userService.update(user);
                                                                       CurrentUser.set(user);
                                                                       grid.removeColumn("join");
                                                                       EventBus.post(new ViewAddedEvent(AdventureView.class,
                                                                               ViewDestination.MENUBAR, "Mon aventure",
                                                                               AdventureView.URI + "/" + adventure.getId()));
                                                                   }

                                                               });
                                                   });
            return button;
        }).setId("join");

        grid.setRowHeight(40);

    }

    super.enter(event);
}
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:38,代码来源:AdventureListView.java

示例15: 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


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