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

Java FieldGroup类代码示例

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

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



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

import com.vaadin.data.fieldgroup.FieldGroup; //导入依赖的package包/类
@Override
public void uploadSucceeded(Upload.SucceededEvent event) {
    try {
        image = baos.toByteArray();
        binder.commit();
        document = binder.getItemDataSource().getBean();
        document.setUpdateDate(new Date());
        document.setName(document.getId() != null ? document.getName() : filename);
        document.setBody(image);
        document.setMime(document.getId() != null ? document.getMime() : mimeType);
        document.setSize(image.length);
        binder.setItemDataSource(document);
        checkVisibility();
    } catch (FieldGroup.CommitException ex) {
        Logger.getLogger(DocumentFormLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:18,代码来源:DocumentFormLayout.java


示例6: InfoPanel

import com.vaadin.data.fieldgroup.FieldGroup; //导入依赖的package包/类
public InfoPanel(BeanItem<Invoice> invoiceBean) {
	this.invoiceBean = invoiceBean;

	Address companyAddress = invoiceBean.getBean().getCompany();
	Address customerAddress = invoiceBean.getBean().getCustomer();
	customerBean = new BeanItem<Address>(customerAddress);
	companyBean = new BeanItem<Address>(companyAddress);
	customerFieldGroup = new FieldGroup(customerBean);
	companyFieldGroup = new FieldGroup(companyBean);
	
	invoiceInfoFieldGroup = new FieldGroup(this.invoiceBean);

	initComponents();
	doBind();
	setValidators();
	setLayout();
}
 
开发者ID:nyholmniklas,项目名称:vaadinInvoiceGenerator,代码行数:18,代码来源:InfoPanel.java


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


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


示例9: bindTagField

import com.vaadin.data.fieldgroup.FieldGroup; //导入依赖的package包/类
public <T extends BaseEntity, L> TokenField bindTagField(final AbstractLayout form, final FieldGroup group,
		final Selected<T> selected, final String fieldLabel, final String fieldName)
{
	final TokenField field = new SplitTagField<T>(fieldLabel, false);
	field.setWidth("100%"); // width...
	field.setInputWidth("100%"); // and input width separately
	field.setFilteringMode(FilteringMode.CONTAINS); // suggest
	field.setTokenCaptionPropertyId(Tag_.name.getName());
	field.setInputPrompt("Enter one or more comma separated tags");
	field.setRememberNewTokens(false); // we can opt to do this ourselves
	field.setImmediate(true);

	if (group != null)
	{
		group.bind(field, fieldName);
	}
	form.addComponent(field);
	return field;
}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:20,代码来源:SMFormHelper.java


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


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


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


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


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


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


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


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


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


示例19: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入依赖的package包/类
private void save() {
    try {
        binder.commit();
        module = HybridbpmUI.getDevelopmentAPI().saveModule(module);
        binder.setItemDataSource(module);
    } catch (FieldGroup.CommitException ex) {
        logger.log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:FormEditor.java


示例20: save

import com.vaadin.data.fieldgroup.FieldGroup; //导入依赖的package包/类
private void save() {
    try {
        binder.commit();
        Module = HybridbpmUI.getDevelopmentAPI().saveModule(Module);
        binder.setItemDataSource(Module);
    } catch (FieldGroup.CommitException ex) {
        logger.log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:ConnectorEditor.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Licences类代码示例发布时间:2022-05-21
下一篇:
Java RepaintArea类代码示例发布时间: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