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


Java ItemDescriptionGenerator类代码示例

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


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

示例1: addTooltTipToSelectedTable

import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; //导入依赖的package包/类
private void addTooltTipToSelectedTable() {

        selectedTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
            private static final long serialVersionUID = 99432397408575324L;

            @Override
            public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
                final Item item = selectedTable.getItem(itemId);
                final String description = (String) (item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue());
                if (DIST_TYPE_NAME.equals(propertyId) && HawkbitCommonUtil.trimAndNullIfEmpty(description) != null) {
                    return i18n.getMessage("label.description") + description;
                } else if (DIST_TYPE_MANDATORY.equals(propertyId)) {
                    return i18n.getMessage("tooltip.check.for.mandatory");
                }
                return null;
            }
        });
    }
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:CreateUpdateDistSetTypeLayout.java

示例2: addTooltip

import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; //导入依赖的package包/类
private void addTooltip() {

        sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
            private static final long serialVersionUID = 1L;

            @Override
            public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
                final Item item = sourceTable.getItem(itemId);
                final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue();
                if (DIST_TYPE_NAME.equals(propertyId) && HawkbitCommonUtil.trimAndNullIfEmpty(description) != null) {
                    return i18n.getMessage("label.description") + description;
                }
                return null;
            }
        });
    }
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:CreateUpdateDistSetTypeLayout.java

示例3: applyI18N

import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; //导入依赖的package包/类
public void applyI18N(Component component, Locale locale) {
	super.applyI18N(component, locale);
	Table table = ((Table) component);
	table.setColumnHeaders(getHeaders (locale));

	Object [] visibleColumns = table.getVisibleColumns();

	for (Object propertyId : visibleColumns) {
		table.setColumnFooter(propertyId, getColumnFooter(locale, propertyId));
	}

	ItemDescriptionGenerator descriptionGenerator = table.getItemDescriptionGenerator();

	if (descriptionGenerator != null && descriptionGenerator instanceof I18NItemDescriptionGenerator) {
		I18NItemDescriptionGenerator generator = (I18NItemDescriptionGenerator) descriptionGenerator;

		if (generator.getLocale() != locale) {
			table.setItemDescriptionGenerator(null);
			generator.setLocale(locale);
			table.setItemDescriptionGenerator(generator);
		}
	}
}
 
开发者ID:lkumarjain,项目名称:jain-I18n,代码行数:24,代码来源:I18NTableHandler.java

示例4: ExpressZipTreeTable

import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; //导入依赖的package包/类
public ExpressZipTreeTable() {
	super();
	addStyleName("expresszip");

	setSizeFull();

	// turn off column reordering and collapsing
	setColumnReorderingAllowed(false);
	setPageLength(0); // turn off paging

	setMultiSelect(true);
	setImmediate(true);
	setMultiSelectMode(MultiSelectMode.DEFAULT);
	setSelectable(true);

	setItemDescriptionGenerator(new ItemDescriptionGenerator() {
		
		@Override
		public String generateDescription(Component source, Object itemId, Object propertyId) {
			String tooltip = "";
			if(null != propertyId && propertyId.equals(LAYER) && itemId instanceof ExpressZipLayer) {
				ExpressZipLayer l = (ExpressZipLayer)itemId;
				Set<String> projs = l.getSupportedProjections();
				tooltip = "<p>Click to view layer boundary. Right-click for options.</p><h2>" + l.getName() + "</h2><ul>";
				Iterator<String> iter = projs.iterator();
				while(iter.hasNext()) {
					tooltip += "<li>" + iter.next() + "</li>";
				}
				tooltip += "</ul>";
			}
 				return tooltip;
		}
	});

	enableFirstColumnHighlighter(this);
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:37,代码来源:ExpressZipTreeTable.java


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