如何为 vaadin 表的项目或单元格添加工具提示 [英] How to add tooltip for a item or cell of a vaadin table

查看:20
本文介绍了如何为 vaadin 表的项目或单元格添加工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到 vaadin 6.7.0 beta1 支持为表格的行/单元格添加工具提示.但是,我没有找到任何如何添加它的示例.有人可以提供一些样品吗?

I noticed that vaadin 6.7.0 beta1 supports to add tooltip for row/cell of a table. However, I did not find any example how to add it. Is there anybody who can provide some sample?

推荐答案

使用代码如下:

table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {                             
public String generateDescription(Component source, Object itemId, Object propertyId) {
    if(propertyId == null){
        return "Row description "+ itemId;
    } else if(propertyId == COLUMN1_PROPERTY_ID) {
        return "Cell description " + itemId +","+propertyId;
    }                                                                       
    return null;
}}

这篇关于如何为 vaadin 表的项目或单元格添加工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆