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


Java FieldGroup.CommitException方法代码示例

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


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

示例1: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public void save(Button.ClickEvent event) {
    try {
        // Commit the fields from UI to DAO
        formFieldBindings.commit();

        // Save DAO to backend with direct synchronous service API
        getUI().userClient.createUser(contact);

        String msg = String.format("Saved '%s %s'.",
                contact.getFirstName(),
                contact.getLastName());
        Notification.show(msg, Type.TRAY_NOTIFICATION);
        getUI().refreshContacts();
    } catch (FieldGroup.CommitException e) {
        // Validation exceptions could be shown here
    }
}
 
开发者ID:pawankumar8608,项目名称:spring-cloud-microservices-docker,代码行数:18,代码来源:ContactForm.java

示例2: commitEditor

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
protected void commitEditor() throws FieldGroup.CommitException {
    if (!isEditorBuffered()) {
        // Not using buffered mode, nothing to do
        return;
    }
    try {
        fireEditorPreCommitEvent();

        Map<Field<?>, Validator.InvalidValueException> invalidValueExceptions = commitFields();
        if (invalidValueExceptions.isEmpty()) {
            fireEditorPostCommitEvent();
        } else {
            throw new FieldGroup.FieldGroupInvalidValueException(invalidValueExceptions);
        }
    } catch (Exception e) {
        throw new FieldGroup.CommitException("Commit failed", null, e);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:CubaGrid.java

示例3: buttonClick

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
@Override
public void buttonClick(Button.ClickEvent event) {
    if (event.getButton().equals(btnClose)) {
        close();
    } else if (event.getButton().equals(btnShowMore)) {
        xTextField.setVisible(!xTextField.isVisible());
        yTextField.setVisible(!yTextField.isVisible());
    } else if (event.getButton().equals(btnOk)) {
        try {
            // check transition name uniqueness
            if (!processModelLayout.getActiveElement().getTransitionModel().getName().equalsIgnoreCase(nameTextField.getValue())
                    && processModelLayout.getProcessModel().getTransitionModelByName(nameTextField.getValue()) != null) {
                throw new Validator.InvalidValueException("Transition name already exists!");
            }
            fieldGroup.commit();
            close();
        } catch (Validator.InvalidValueException | FieldGroup.CommitException ex) {
            ex.printStackTrace();
            Notification.show(("error"), ex.getMessage(), Notification.Type.ERROR_MESSAGE);
        }
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:23,代码来源:TransitionConfigureWindow.java

示例4: getInternalValue

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
@Override
protected List getInternalValue() {
    List<FieldModel> result = new ArrayList<>();
    for (Component comp : form) {
        if (comp instanceof ParameterForm) {
            ParameterForm parameterForm = (ParameterForm) comp;
            try {
                parameterForm.commit();
            } catch (FieldGroup.CommitException ex) {
                logger.log(Level.SEVERE, ex.getMessage(), ex);
            }
            result.add(parameterForm.getFieldModel());
        }
    }
    return result;
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:17,代码来源:ParametersFieldGroup.java

示例5: preCommit

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
@Override
public void preCommit(FieldGroup.CommitEvent commitEvent) throws FieldGroup.CommitException {
    for (Object propertyId : fieldGroup.getBoundPropertyIds()) {
        fieldGroup.getField(propertyId).removeStyleName("errorField");
    }
    StringBuilder errorMsg = new StringBuilder();
    int violationCount = 0;
    for (Field<?> f : commitEvent.getFieldBinder().getFields()) {
        try {
            if (f instanceof CustomField) {
                continue;
            }
            f.validate();
        } catch (com.vaadin.data.Validator.InvalidValueException e) {
            violationCount++;
            errorMsg.append(e.getHtmlMessage()).append("<br/>");
            f.addStyleName("errorField");
        }
    }
    if (violationCount > 0) {
        throw new FieldGroup.CommitException(errorMsg.toString());
    }
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:24,代码来源:AbstractBeanFieldGroupFieldFactory.java

示例6: postCommit

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
@Override
public void postCommit(FieldGroup.CommitEvent commitEvent) throws FieldGroup.CommitException {
    Set<ConstraintViolation<B>> violations = validation.validate(attachForm.getBean());
    if (violations.size() > 0) {
        StringBuilder errorMsg = new StringBuilder();

        for (ConstraintViolation violation : violations) {
            errorMsg.append(violation.getMessage()).append("<br/>");
            Path propertyPath = violation.getPropertyPath();
            if (propertyPath != null && !propertyPath.toString().equals("")) {
                fieldGroup.getField(propertyPath.toString()).addStyleName("errorField");
            } else {
                Annotation validateAnno = violation.getConstraintDescriptor().getAnnotation();
                if (validateAnno instanceof DateComparison) {
                    String firstDateField = ((DateComparison) validateAnno).firstDateField();
                    String lastDateField = ((DateComparison) validateAnno).lastDateField();

                    fieldGroup.getField(firstDateField).addStyleName("errorField");
                    fieldGroup.getField(lastDateField).addStyleName("errorField");
                }
            }

        }
        throw new FieldGroup.CommitException(errorMsg.toString());
    }
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:27,代码来源:AbstractBeanFieldGroupFieldFactory.java

示例7: saveEditor

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
@Override
public void saveEditor() throws FieldGroup.CommitException {
    try {
        editorSaving = true;
        commitEditor();
    } finally {
        editorSaving = false;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:10,代码来源:CubaGrid.java

示例8: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public void save() {
    try {
        fieldGroup.commit();
        this.processModelLayout.getActiveElement().getTaskModel().getInParameters().clear();
        this.processModelLayout.getActiveElement().getTaskModel().getInParameters().putAll(design.inputInParametersLayout.getValues());
        this.processModelLayout.getActiveElement().getTaskModel().getOutParameters().clear();
        this.processModelLayout.getActiveElement().getTaskModel().getOutParameters().putAll(design.outputOutParametersLayout.getValues());
    } catch (Validator.InvalidValueException | FieldGroup.CommitException ex) {
        ex.printStackTrace();
        Notification.show("Error", ex.getMessage(), Notification.Type.ERROR_MESSAGE);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:13,代码来源:TaskConfigureCustomComponent.java

示例9: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
private void save() {
    try {
        preferences.commit();
        module.setCode(preferences.getItemDataSource().getBean().getQuery());
        module.setDesign(HybridbpmCoreUtil.objectToJson(preferences.getItemDataSource().getBean()));

        module = HybridbpmUI.getDevelopmentAPI().saveModule(module);
    } catch (FieldGroup.CommitException ex) {
        logger.log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:12,代码来源:ChartEditor.java

示例10: getTabDefinition

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public TabDefinition getTabDefinition() {
    try {
        binder.commit();
        return binder.getItemDataSource().getBean();
    } catch (FieldGroup.CommitException ex) {
        Logger.getLogger(TabConfigurationLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
    return null;
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:TabConfigurationLayout.java

示例11: getViewDefinition

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public ViewDefinition getViewDefinition() {
    try {
        binder.commit();
        return binder.getItemDataSource().getBean();
    } catch (FieldGroup.CommitException ex) {
        Logger.getLogger(ViewConfigurationLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
    return null;
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:ViewConfigurationLayout.java

示例12: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public void save() {
    try {
        /* generated commits start */
        beanFieldGroup.commit();
        beanFieldGroup.setItemDataSource(HybridbpmUI.getCrudAPI().save(beanFieldGroup.getItemDataSource().getBean()));
        /* generated commits end */
    } catch (FieldGroup.CommitException ex) {
        logger.log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:11,代码来源:CrudForm.java

示例13: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public void save() {
    try {
        binder.commit();
        HybridbpmUI.getAccessAPI().saveGroup(binder.getItemDataSource().getBean());
    } catch (FieldGroup.CommitException ex) {
        Logger.getLogger(GroupLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:9,代码来源:GroupLayout.java

示例14: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public void save() {
    try {
        binder.commit();
        HybridbpmUI.getAccessAPI().saveRole(binder.getItemDataSource().getBean());
    } catch (FieldGroup.CommitException ex) {
        Logger.getLogger(RoleLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:9,代码来源:RoleLayout.java

示例15: getParameter

import com.vaadin.data.fieldgroup.FieldGroup; //导入方法依赖的package包/类
public Parameter getParameter() {
    try {
        binder.commit();
        return binder.getItemDataSource().getBean();
    } catch (FieldGroup.CommitException ex) {
        Logger.getLogger(SystemParameterLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
    return null;
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:SystemParameterLayout.java


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