本文整理汇总了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();
}
示例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;
}
示例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);
}
示例4: createForm
import com.vaadin.ui.Form; //导入方法依赖的package包/类
private Form createForm() {
Form form = new Form();
form.setFormFieldFactory(this.formFieldFactory);
return form;
}
示例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);
}