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

Java DefaultFieldFactory类代码示例

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

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



DefaultFieldFactory类属于com.vaadin.ui包,在下文中一共展示了DefaultFieldFactory类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createFieldByPropertyType

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
private Field createFieldByPropertyType(Class<?> type) {
	final IClassDefinition classDefinition = dictionaryService.getClassDefinition(type.getName());
	if (classDefinition != null) {
		LOG.debug("Found field with dictionary in dictionary service for class {}, create new Select", type.getName());
		Select select = new EntitySelect(new EntitySelectIdProvider() {

			@Override
			public Object getId(Object entityObject) {
				return classDefinition.getId(entityObject);
			}
		});
		select.setItemCaptionMode(Select.ITEM_CAPTION_MODE_ITEM);
		select.setContainerDataSource(containerFactory.createContainer(classDefinition.getClassDefined().getName()));
		return select;
	}
	return DefaultFieldFactory.createFieldByPropertyType(type);
}
 
开发者ID:frincon,项目名称:openeos,代码行数:18,代码来源:DefaultVaadinFieldFactory.java


示例2: WkdXmlConfigDialog

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的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


示例3: createField

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) {
	P property = (P) propertyId;

	// check read-only property
	if (requireDataSource().getConfiguration().isPropertyReadOnly(property)) {
		return null;
	}

	// check editable and custom editor
	PropertyColumn<T, P> propertyColumn = getPropertyColumn(property);
	if (propertyColumn != null) {
		if (!propertyColumn.isEditable()) {
			return null;
		}

		if (propertyColumn.getEditor().isPresent()) {
			return propertyColumn.getEditor().get();
		}
	}

	// check PropertyRenderer or use DefaultFieldFactory
	return renderField(property)
			.orElse(DefaultFieldFactory.get().createField(container, itemId, propertyId, uiContext));

}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:28,代码来源:DefaultItemListing.java


示例4: createField

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
/**
 * In this implementation, {@link com.vaadin.ui.ComboBox}es are distinguished
 * from other Fields.
 *
 * ComboBoxes get their own {@link SearchPatternComboBox};
 * other fields are rendered using a {@link SearchPatternTextField}.
 */
public SearchPatternField<?,?> createField(Object propertyId, Class<?> propertyType) {

    SearchPatternField f ;
    if (java.lang.Enum.class.isAssignableFrom(propertyType)) {
        f = new SearchPatternComboBox(propertyId, (Class<java.lang.Enum>)propertyType);
    } else {
        f = new SearchPatternTextField(propertyId, propertyType);
    }
    f.setCaption(DefaultFieldFactory.createCaptionByPropertyId(propertyId));
    return f;
}
 
开发者ID:tyl,项目名称:field-binder,代码行数:19,代码来源:DefaultSearchFieldFactory.java


示例5: VirtuosoLoaderConfigDialog

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
public VirtuosoLoaderConfigDialog(VirtuosoLoaderConfig configuration) {
    config = configuration;
    form.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            if ("graph".equals(propertyId)) {
                Field f = super.createField(item, propertyId, uiContext);
                f.setVisible(config.getGraphSource().equals(VirtuosoLoaderConfig.GRAPHSOURCE_CUSTOM));

            } else if ("graphSource".equals(propertyId)) {
                Select selector = new Select("Graph");
                selector.addItem(VirtuosoLoaderConfig.GRAPHSOURCE_CKANURI);
                selector.addItem(VirtuosoLoaderConfig.GRAPHSOURCE_ODSURI);
                selector.addItem(VirtuosoLoaderConfig.GRAPHSOURCE_CUSTOM);
                selector.addListener(new Property.ValueChangeListener() {
                    @Override
                    public void valueChange(Property.ValueChangeEvent event) {
                        Field graph = form.getField("graph");
                        if (event.getProperty().getValue() == null || graph == null)
                            return;
                        else {
                            boolean isCustom = event.getProperty().getValue().equals(VirtuosoLoaderConfig.GRAPHSOURCE_CUSTOM);
                            graph.setVisible(isCustom);
                            graph.setRequired(isCustom);
                        }
                    }
                });
                selector.setImmediate(true);
                return selector;
            }
            return super.createField(item, propertyId, uiContext);
        }
    });
    form.setItemDataSource(new BeanItem<VirtuosoLoaderConfig>(this.config));
    form.setVisibleItemProperties(new String[]{"host", "port", "userName", "password", "versioned", "graphSource", "graph"});
    addComponent(form);
}
 
开发者ID:nvdk,项目名称:ods-lodms-plugins,代码行数:38,代码来源:VirtuosoLoaderConfigDialog.java


示例6: ODSCSVExtractorDialog

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
public ODSCSVExtractorDialog(ODSCSVExtractorConfig config) {
    this.config = config;
    form.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            TextField f = new TextField();
            f.setCaption(createCaptionByPropertyId(propertyId));
            f.setImmediate(true);
            f.setWidth(350, VerticalLayout.UNITS_PIXELS);
            f.addValidator(new AbstractStringValidator(null) {
                @Override
                protected boolean isValidString(String value) {
                    if (value.isEmpty())
                        return true;
                    try {
                        URL u = new URL(value);
                        return true;
                    } catch (Exception ex) {
                        setErrorMessage("Invalid Url: " + ex.getMessage());
                        return false;
                    }
                }
            });
            return f;
        }
    });
    form.setVisibleItemProperties(new String[]{"catalogCsv", "recordCsv", "datasetCsv", "distributionCsv", "agentCsv", "licenseCsv"});
    form.setItemDataSource(new BeanItem<ODSCSVExtractorConfig>(this.config));
    addComponent(form);
}
 
开发者ID:nvdk,项目名称:ods-lodms-plugins,代码行数:31,代码来源:ODSCSVExtractorDialog.java


示例7: createCaptionByPropertyId

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
private String createCaptionByPropertyId(Object propertyId) {
	return DefaultFieldFactory.createCaptionByPropertyId(propertyId);
}
 
开发者ID:frincon,项目名称:openeos,代码行数:4,代码来源:DefaultVaadinFieldFactory.java


示例8: initEditor

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
private void initEditor() {
    ruleEditor.addComponent(removeButton);
    ruleFields.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            if ("sparqlQuery".equals(propertyId)) {
                TextArea sparqlQuery = new TextArea();
                sparqlQuery.setCaption(createCaptionByPropertyId(propertyId));
                sparqlQuery.setImmediate(true);
                sparqlQuery.setRows(10);
                sparqlQuery.setColumns(30);
                sparqlQuery.addValidator(new AbstractStringValidator("invalid sparql query") {
                    @Override
                    protected boolean isValidString(String value) {
                        SPARQLParser parser = new SPARQLParser();
                        try {
                            ParsedUpdate parsed = parser.parseUpdate(value, null);
                        } catch (Exception ex) {

                            return false;
                        }
                        return true;
                    }
                });
                return sparqlQuery;
            }
            if ("severity".equals(propertyId)) {
                Select s = new Select();
                s.setCaption(createCaptionByPropertyId(propertyId));
                s.addItem(ValidationRule.SEVERITY_ERROR);
                s.addItem(ValidationRule.SEVERITY_WARN);
                return s;
            }

            TextField f = new TextField();
            f.setCaption(createCaptionByPropertyId(propertyId));
            f.setWidth("300px");
            return f;

        }
    });
    ruleFields.setVisibleItemProperties(new String[]{"description", "sparqlQuery"});
    ruleEditor.addComponent(ruleFields);
}
 
开发者ID:nvdk,项目名称:ods-lodms-plugins,代码行数:45,代码来源:OdsValidatorDialog.java


示例9: TranslatorDialog

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
public TranslatorDialog(TranslatorConfig tConfig) {
  config = tConfig;
  urlList.addAll(config.DEFAULT_PREDICATES);

  form.setFormFieldFactory(new DefaultFieldFactory() {
    @Override
    public Field createField(Item item, Object propertyId, Component uiContext) {
      if ("predicates".equals(propertyId)) {
        ListSelect box = new ListSelect("predicates to translate");
        box.setMultiSelect(true);
        box.setContainerDataSource(urlList);
        box.setValue(config.getPredicates());
        box.setRows(3);
        box.setNewItemsAllowed(true);
        for (URI predicate : config.getPredicates())
          box.addItem(predicate.stringValue());
        return box;
      } else if ("translationCache".equals("propertyId")) {
        TextField uriField = new TextField("Translation Cache Graph");
        uriField.setWidth(350, VerticalLayout.UNITS_PIXELS);
        uriField.setDescription("Graph URI were translations are stored");
        uriField.setImmediate(true);
        uriField.addValidator(new AbstractStringValidator(null) {
          @Override
          protected boolean isValidString(String value) {
            try {
              new URIImpl(value);
              return true;
            } catch (Exception ex) {
              setErrorMessage("Invalid graph URI: " + ex.getMessage());
              return false;
            }
          }
        });
        return uriField;
      } else
        return super.createField(item, propertyId, uiContext);
    }
  });
  form.setItemDataSource(new BeanItem<TranslatorConfig>(this.config));
  form.setVisibleItemProperties(new String[]{"providerClientID", "providerClientSecret", "predicates", "translationCache"});
  addComponent(form);
}
 
开发者ID:nvdk,项目名称:ods-lodms-plugins,代码行数:44,代码来源:TranslatorDialog.java


示例10: getFieldCaption

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
/**
 * Returns the field caption for the specified property. Gets the error string from properties file.
 * @param propertyId property name.
 * @param type property type.
 * @return field caption.
 */
public static String getFieldCaption(Object propertyId, Class<?> type) {
	String typeName = type.getSimpleName();
	String nameFromFile = Utils.getPropertyLabel(typeName, propertyId);
	return nameFromFile.isEmpty() ? DefaultFieldFactory.createCaptionByPropertyId(propertyId) : nameFromFile;
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:12,代码来源:DefaultCrudFieldFactory.java


示例11: CrudComponent

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
/**
 * Creates a new instance using the specified DefaultFieldFactory.
 * @param type Entity type.
 * @param fieldFactory DefaultFieldFactory to use.
 */
public CrudComponent(Class<T> type, DefaultFieldFactory fieldFactory) {
	this(type, null, fieldFactory, null, null, true, true, true, true, true, false, false, false, 0);
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:9,代码来源:CrudComponent.java


示例12: setFieldFactory

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
/**
 * Use a custom FieldFactory.
 * @param fieldFactory FieldFactory to use.
 * @return
 */
public CrudBuilder<T> setFieldFactory(DefaultFieldFactory fieldFactory) {
	this.fieldFactory = fieldFactory;
	return this;
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:10,代码来源:CrudBuilder.java


示例13: EmbeddedCrudComponent

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
/**
 * @param type Entity type.
 * @param fieldFactory DefaultFieldFactory to use.
 * @param container EntitySetContainer to use.
 */
public EmbeddedCrudComponent(Class<T> type, DefaultFieldFactory fieldFactory, EntitySetContainer<T> container) {
	super(type, container, fieldFactory, null, null, false, true, true, true, true, true, true, false, 0);
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:9,代码来源:EmbeddedCrudComponent.java


示例14: getPropertyLabel

import com.vaadin.ui.DefaultFieldFactory; //导入依赖的package包/类
/**
 * 
 * @param typeName
 * @param propertyId
 * @return The corresponding label for the property and type specified.
 */
public static String getPropertyLabel(String typeName, Object propertyId) {
	typeName = typeName.substring(0, 1).toLowerCase() + typeName.substring(1, typeName.length());
	return getProperty("ui." + typeName + "." + propertyId, DefaultFieldFactory.createCaptionByPropertyId(propertyId));
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:11,代码来源:Utils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java JsonParser类代码示例发布时间:2022-05-22
下一篇:
Java CacheRemove类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap