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


Java Form.setFormFieldFactory方法代码示例

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


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

示例1: WkdXmlConfigDialog

import com.vaadin.ui.Form; //导入方法依赖的package包/类
public WkdXmlConfigDialog(WkdXmlConfig config) {
    form = new Form();
    addComponent(form);
    beanItem = new BeanItem<WkdXmlConfig>(config);
    form.setImmediate(true);
    form.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            Field f = super.createField(item, propertyId, uiContext);
            f.setRequired(true);
            f.setWidth(500,UNITS_PIXELS);
            return f;
        }
    });
    form.setItemDataSource(beanItem);
    form.focus();
}
 
开发者ID:lodms,项目名称:lodms-plugins,代码行数:18,代码来源:WkdXmlConfigDialog.java

示例2: build

import com.vaadin.ui.Form; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public Form build() {
	Form form = new Form();
	
	if (layout != null)
		form.setLayout(layout);
	if (formFieldFactory != null)
		form.setFormFieldFactory(formFieldFactory);
	if (visibleProperties != null)
		form.setVisibleItemProperties(visibleProperties);
	if (width != null)
		form.setWidth(width);
	if (height != null)
		form.setHeight(height);
	
	return form;
}
 
开发者ID:chelu,项目名称:jdal,代码行数:20,代码来源:ConfigurableFormBuilder.java

示例3: SPARQLUpdateTransformDialog

import com.vaadin.ui.Form; //导入方法依赖的package包/类
public SPARQLUpdateTransformDialog(SPARQLUpdateTransformConfig oldConfig) {
    this.config = oldConfig;
    queryForm = new Form();
    queryForm.setSizeFull();
    queryForm.setFormFieldFactory(new FormFieldFactory() {

        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            if (propertyId.equals("query")) {
                TextArea query = new TextArea("SPARQL Query");
                query.setSizeFull();
                query.setRows(25);
                query.addValidator(new AbstractStringValidator("Must be a valid UPDATE query!") {

                    @Override
                    protected boolean isValidString(String value) {
                        SPARQLParser parser = new SPARQLParser();
                        try {
                            ParsedUpdate parsed = parser.parseUpdate(value, null);
                        } catch (Exception ex) {
                            setErrorMessage(ex.getMessage());
                            return false;
                        }
                        return true;
                    }
                });
                return query;
            }
            return null;
        }
    });
    queryForm.setItemDataSource(new BeanItem<SPARQLUpdateTransformConfig>(config));
    addComponent(queryForm);
}
 
开发者ID:lodms,项目名称:lodms-plugins,代码行数:35,代码来源:SPARQLUpdateTransformDialog.java

示例4: createForm

import com.vaadin.ui.Form; //导入方法依赖的package包/类
private Form createForm() {
	Form form = new Form();
	form.setFormFieldFactory(this.formFieldFactory);
	return form;
}
 
开发者ID:frincon,项目名称:openeos,代码行数:6,代码来源:VaadinTabImpl.java

示例5: JobsStatusViewComponent

import com.vaadin.ui.Form; //导入方法依赖的package包/类
public JobsStatusViewComponent(URL appUrl) {

		VerticalLayout mainLayout = new VerticalLayout();
		mainLayout.setSpacing(true);
		mainLayout.setMargin(true);
		mainLayout.setWidth("100%");

		// Refresher will update UI as progress is made
		final Refresher refresher = new Refresher();
		refresher.setRefreshInterval(UPDATE_STATUS_INTERVAL);
		refresher.addListener(this);
		mainLayout.addComponent(refresher);

		mainLayout.addComponent(buildTableControls());

		form = new Form();
		form.setCaption("Selected Job");
		form.setWidth("420px");
		form.setFormFieldFactory(new ExpressZipFieldFactory());
		form.setVisible(true);
		form.setImmediate(true);

		table = new Table(null);
		table.addStyleName("expresszip");
		table.setWidth("100%");
		table.setSelectable(true);
		table.setImmediate(true);
		table.setNullSelectionAllowed(false);
		table.setPageLength(0);
		table.setHeight("250px");
		container = new BeanItemContainer<Job>(Job.class, Job.getJobQueue());
		container.addNestedContainerProperty("exportProps.jobName");
		container.addNestedContainerProperty("exportProps.userNotation");
		table.setContainerDataSource(container);

		table.setVisibleColumns(new String[] { "exportProps.jobName", "exportProps.userNotation", "status" });
		table.setColumnHeaders(new String[] { "Job Name", "User Name", "Status" });
		table.sort(new Object[] { "exportProps.jobName", "exportProps.userNotation" }, new boolean[] { true, true });
		table.setColumnExpandRatio("status", 0.8f);
		
		// use green bar to highlight selected row
		ExpressZipTreeTable.enableFirstColumnHighlighter(table);
		
		updateTableData();

		mainLayout.addComponent(table);
		mainLayout.setExpandRatio(table, 1.0f);

		mainLayout.addComponent(form);

		Link browseExports = new Link("Browse Archived Jobs", new ExternalResource(appUrl.getProtocol() + "://"
				+ appUrl.getAuthority() + "/exportdir/"));
		// Open the URL in a new window/tab
		browseExports.setTargetName("_blank");
		mainLayout.addComponent(browseExports);

		// setContent(mainLayout);
		setCompositionRoot(mainLayout);
	}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:60,代码来源:JobsStatusViewComponent.java


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