• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CommitException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



CommitException类属于com.vaadin.data.fieldgroup.FieldGroup包,在下文中一共展示了CommitException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: commit

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
public final void commit()
{
	try
	{
		// Validate all fields
		qty.validate(); // throws InvalidValueException which will be handled on upper level
		
		binder.commit();
		
		updateSentStatus();
	}
	catch (final CommitException e)
	{
		Notification.show(i18n.get("DailyProductQtyReportView.error.InvalidValue"));
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:17,代码来源:DailyProductQtyReportView.java


示例2: commit

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
public final void commit()
{
	try
	{
		// Validate all fields
		qty.validate(); // throws InvalidValueException which will be handled on upper level

		binder.commit();

		updateSentStatus();
	}
	catch (final CommitException e)
	{
		Notification.show(i18n.get("DailyProductQtyReportView.error.InvalidValue"));
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:17,代码来源:NumberEditorView.java


示例3: initializeButtons

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private void initializeButtons() {
	this.saveButton.addClickListener(new ClickListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void buttonClick(ClickEvent event) {
			try {
				fieldGroup.commit();
				self.isSaved = true;
				self.close();
			} catch (CommitException e) {
				e.printStackTrace();
			}
		}
		
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:18,代码来源:ObadviceEditorWindow.java


示例4: saveEditor

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
@Override
public void saveEditor() throws CommitException {
	super.saveEditor();
	// check auto commit on save
	if (isCommitOnSave()) {
		requireDataSource().commit();
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:9,代码来源:DefaultItemListing.java


示例5: buildFooter

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private Component buildFooter() {
    HorizontalLayout footer = new HorizontalLayout();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth(100.0f, Unit.PERCENTAGE);

    Button ok = new Button("OK");
    ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
    ok.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                fieldGroup.commit();
                // Updated user should also be persisted to database. But
                // not in this demo.

                Notification success = new Notification(
                        "Profile updated successfully");
                success.setDelayMsec(2000);
                success.setStyleName("bar success small");
                success.setPosition(Position.BOTTOM_CENTER);
                success.show(Page.getCurrent());

                DashboardEventBus.post(new DashboardEvent.ProfileUpdatedEvent());
                close();
            } catch (CommitException e) {
                Notification.show("Error while updating profile",
                        Type.ERROR_MESSAGE);
            }

        }
    });
    ok.focus();
    footer.addComponent(ok);
    footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);
    return footer;
}
 
开发者ID:imotSpot,项目名称:imotSpot,代码行数:37,代码来源:ProfilePreferencesWindow.java


示例6: buildFooter

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private Component buildFooter() {
    HorizontalLayout footer = new HorizontalLayout();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth(100.0f, Unit.PERCENTAGE);

    Button ok = new Button("OK");
    ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
    ok.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                fieldGroup.commit();
                // Updated user should also be persisted to database. But
                // not in this demo.

                Notification success = new Notification(
                        "Profile updated successfully");
                success.setDelayMsec(2000);
                success.setStyleName("bar success small");
                success.setPosition(Position.BOTTOM_CENTER);
                success.show(Page.getCurrent());

                DashboardEventBus.post(new ProfileUpdatedEvent());
                close();
            } catch (CommitException e) {
                Notification.show("Error while updating profile",
                        Type.ERROR_MESSAGE);
            }

        }
    });
    ok.focus();
    footer.addComponent(ok);
    footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);
    return footer;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:37,代码来源:ProfilePreferencesWindow.java


示例7: initializeButtons

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
protected void initializeButtons() {
	this.grid.setComponentAlignment(this.buttonSave, Alignment.BOTTOM_CENTER);
	this.buttonSave.setImmediate(true);
	this.buttonSave.setEnabled(false);
	this.buttonSave.addClickListener(new ClickListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void buttonClick(ClickEvent event) {
			try {
				//
				// Commit changes
				//
				self.fieldGroup.commit();
				//
				// Save
				//
				self.isSaved = true;
				//
				// We can close
				//
				self.close();
			} catch (CommitException e) {
				logger.warn("Couldn't commit, the save button should NOT be enabled.");
			}
		}			
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:29,代码来源:PIPResolverEditorWindow.java


示例8: getSubmitButtonClickListener

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
/**
 * @return
 */
private ClickListener getSubmitButtonClickListener() {
	return new Button.ClickListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = 4846553077403712887L;

		@Override
		public void buttonClick(ClickEvent event) {
			try {

				fieldGroup.commit();
			} catch (CommitException e) {
				Map<Field<?>, InvalidValueException> invalidFields = e
						.getInvalidFields();
				// TODO handle it in a better way
				for (Map.Entry<Field<?>, InvalidValueException> invalidField : invalidFields
						.entrySet()) {
					((AbstractField<?>) invalidField.getKey())
							.setValidationVisible(true);
				}
				if (invalidFields.isEmpty()) {
					// TODO Handle this error
					e.printStackTrace();
					Notification.show("Save failed, Please try again");
				}

			}

		}
	};
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:37,代码来源:BasicFormImpl.java


示例9: onSaveButtonClick

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private void onSaveButtonClick() {
	if (flightFieldGroup.isValid()) {
		try {
			flightFieldGroup.commit();
		} catch (CommitException e) {
			Notification.show(e.getMessage(), Type.ERROR_MESSAGE);
		}
		Flight flight = flightFieldGroup.getItemDataSource().getBean();
		travelService.saveFlight(flight);
		flightFieldGroup.setItemDataSource(new Flight());
		refreshFlightTable();
	}
}
 
开发者ID:sboe0705,项目名称:flightservice,代码行数:14,代码来源:FlightMaintenanceView.java


示例10: PreferencesDialog

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
public PreferencesDialog() {
	super("Preferences"); // Set window caption

	center();
       setClosable(true);
       setModal(true);;
       setResizable(false);
       
       FormLayout layout = new FormLayout();
       
       // Form for editing the bean
       final BeanFieldGroup<UserData> binder =
               new BeanFieldGroup<UserData>(UserData.class);

       UserData userData = ((AnalyzerUI)UI.getCurrent()).getUserData();
       binder.setItemDataSource(userData);
       layout.addComponent(binder.buildAndBind("Repository", "repository"));

       // Buffer the form content
       binder.setBuffered(true);
       layout.addComponent(new Button("Save", new ClickListener() {
       	
		private static final long serialVersionUID = 1L;

		@Override
           public void buttonClick(ClickEvent event) {
               try {
                   binder.commit();
                   close();
               } catch (CommitException e) {
               }
           }
       }));
       
       setContent(layout);
}
 
开发者ID:qa82,项目名称:analyzer,代码行数:37,代码来源:PreferencesDialog.java


示例11: commit

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
@Override
public void commit() throws CommitException
{
    fieldGroup.commit();        
    for (IModuleConfigForm form: allForms)
        form.commit();
}
 
开发者ID:sensiasoft,项目名称:sensorhub,代码行数:8,代码来源:GenericConfigForm.java


示例12: getConfiguration

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
@Override
public DistributionMetadataConfig_V1 getConfiguration() throws DPUConfigException {
    try {
        if (binder.isValid()) {
            binder.commit();
        } else {
            throw new DPUConfigException(ctx.tr(this.getClass().getSimpleName() + ".validation.exception"));
        }
    } catch (CommitException ex) {
        throw new DPUConfigException(ctx.tr(this.getClass().getSimpleName() + ".validation.exception"));
    }
    return binder.getItemDataSource().getBean();
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:14,代码来源:DistributionMetadataVaadinDialog.java


示例13: getConfiguration

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
@Override
public RdfGraphMergerConfig_V1 getConfiguration() throws DPUConfigException {
    try {
        if (binder.isValid()) {
            binder.commit();
        } else {
            throw new DPUConfigException(ctx.tr(this.getClass().getSimpleName() + ".validation.exception"));
        }
    } catch (CommitException ex) {
        throw new DPUConfigException(ctx.tr(this.getClass().getSimpleName() + ".validation.exception"));
    }
    return binder.getItemDataSource().getBean();
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:14,代码来源:RdfGraphMergerVaadinDialog.java


示例14: setActionListeners

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private void setActionListeners() {
	createButton.addClickListener(new ClickListener() {

		public void buttonClick(ClickEvent event) {
			try {
				commitFields();
				createPdf();
				titlePanel.setLink(controller.getPdfFile());
			} catch (CommitException e) {
				e.printStackTrace();
			}
		}
	});
}
 
开发者ID:nyholmniklas,项目名称:vaadinInvoiceGenerator,代码行数:15,代码来源:VaadinInvoiceGui.java


示例15: buttonClick

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
	try {
		binder.commit();
		
		Account account = binder.getItemDataSource().getBean();
		mvpPresenterHandlers.tryCreateAccount(account);
		
	} catch (CommitException e) {
		username.setValidationVisible(true);
		password.setValidationVisible(true);
		firstName.setValidationVisible(true);
		lastName.setValidationVisible(true);			
	} 		
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecurity,代码行数:16,代码来源:SignUpViewImpl.java


示例16: buttonClick

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
	
	try {
		binder.commit();
		
		SignupModel model = binder.getItemDataSource().getBean();			
		Account account = new Account(model.getUsername(), model.getPassword(), model.getFirstName(), model.getLastName());
		accountRepository.createAccount(account);
		
		if (account != null) {
			SignInUtils.signin(account.getUsername());
			
			//Create social connection				
			ProviderSignInAttempt attempt = (ProviderSignInAttempt) UI.getCurrent().getSession().getSession().getAttribute(ProviderSignInAttempt.SESSION_ATTRIBUTE);
			if (attempt != null) {
				usersConnectionRepository.createConnectionRepository(account.getUsername()).addConnection(attempt.getConnection());
				UI.getCurrent().getSession().getSession().removeAttribute(ProviderSignInAttempt.SESSION_ATTRIBUTE);
			}
			
			Page.getCurrent().setLocation("/ui/");
		}
		
	} catch (CommitException e) {
		username.setValidationVisible(true);
		password.setValidationVisible(true);
		firstName.setValidationVisible(true);
		lastName.setValidationVisible(true);
		
	} catch (UsernameAlreadyInUseException eu) {
		username.setComponentError(new UserError(eu.getMessage()));
		username.setValidationVisible(true);
		password.setValidationVisible(true);
		firstName.setValidationVisible(true);
		lastName.setValidationVisible(true);
		
	}
	
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecuritySocial,代码行数:40,代码来源:SignupContent.java


示例17: buildFooter

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private HorizontalLayout buildFooter() {
	HorizontalLayout footer = new HorizontalLayout();
	footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
	footer.setWidth(100.0f, Unit.PERCENTAGE);

	Button ok = new Button(Messages.getString("Caption.Button.OK"));
	ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
	ok.addClickListener(e -> {
           try {
               fieldGroup.commit();
               userService.add(fieldGroup.getItemDataSource().getBean());

               Notification success = new Notification(Messages.getString("Message.Info.ProfileUpdated"));
               success.setDelayMsec(2000);
               success.setPosition(Position.BOTTOM_CENTER);
               success.show(Page.getCurrent());

               mainEvent.fire(new MainUIEvent.ProfileUpdatedEvent());
               window.close();
           } catch (CommitException ex) {
               Notification.show(Messages.getString("Message.Error.ProfileUpdate"), Type.ERROR_MESSAGE);
           }

       });
	ok.focus();
	footer.addComponent(ok);
	footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);

	Button cancel = new Button(Messages.getString("Caption.Button.Cancel"));
	cancel.addClickListener(e -> {
           fieldGroup.discard();
           window.close();
       });
	footer.addComponent(cancel);

	return footer;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:38,代码来源:UserSettingsWindowPresenterImpl.java


示例18: buildFooter

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private Component buildFooter() {
	HorizontalLayout footer = new HorizontalLayout();
	footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
	footer.setWidth(100.0f, Unit.PERCENTAGE);
	footer.setSpacing(true);

	Button ok = new Button(Messages.getString("Caption.Button.OK"));
	ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
	ok.addClickListener(e -> {
			try {
				commitForm();

				Notification success;
				if (state == WindowState.CREATE) {
					success = new Notification(Messages.getString("Message.Info.GroupAdded"));
				} else if (state == WindowState.UPDATE) {
					success = new Notification(Messages.getString("Message.Info.GroupUpdated"));
				} else {
					success = new Notification(Messages.getString("Message.Info.GroupsUpdated"));
				}
				success.setDelayMsec(2000);
				success.setPosition(Position.BOTTOM_CENTER);
				success.show(Page.getCurrent());

				window.close();

		} catch (CommitException ex) {
			Notification.show(ex.getMessage(), Type.WARNING_MESSAGE);
			}
	});
	ok.focus();
	footer.addComponent(ok);
	footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);

	Button cancel = new Button(Messages.getString("Caption.Button.Cancel"));
	cancel.addClickListener(e -> window.close());
	footer.addComponent(cancel);

	return footer;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:41,代码来源:GroupWindowPresenterImpl.java


示例19: buildFooter

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
private Component buildFooter() {
	HorizontalLayout footer = new HorizontalLayout();
	footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
	footer.setWidth(100.0f, Unit.PERCENTAGE);
	footer.setSpacing(true);

	Button ok = new Button(Messages.getString("Caption.Button.OK"));
	ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
	ok.addClickListener(e -> {
           try {
               commitForm();

               Notification success;
               if (state == WindowState.CREATE) {
                   success = new Notification(Messages.getString("Message.Info.UserAdded"));
               } else if (state == WindowState.UPDATE) {
                   success = new Notification(Messages.getString("Message.Info.UserUpdated"));
               } else {
                   success = new Notification(Messages.getString("Message.Info.UsersUpdated"));
               }
               success.setDelayMsec(2000);
               success.setPosition(Position.BOTTOM_CENTER);
               success.show(Page.getCurrent());

               window.close();

           } catch (CommitException ex) {
               Notification.show(ex.getMessage(), Type.WARNING_MESSAGE);
           }
       });
	ok.focus();
	footer.addComponent(ok);
	footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);

	Button cancel = new Button(Messages.getString("Caption.Button.Cancel"));
	cancel.addClickListener(e -> window.close());
	footer.addComponent(cancel);

	return footer;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:41,代码来源:UserWindowPresenterImpl.java


示例20: commitFieldGroup

import com.vaadin.data.fieldgroup.FieldGroup.CommitException; //导入依赖的package包/类
protected void commitFieldGroup() throws CommitException
{
	formValidate();
	String fieldName = selectFirstErrorFieldAndShowTab(this.fieldGroup);
	if (!fieldGroup.isValid())
	{
		throw new InvalidValueException("Invalid Field: " + fieldName);
	}
	fieldGroup.commit();
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:11,代码来源:BaseCrudView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DocAttribute类代码示例发布时间:2022-05-21
下一篇:
Java Parser类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap