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


Java CommitException类代码示例

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


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


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