如何以编程方式获取有关CellTable标题的信息? [英] How do I programmatically get info about a CellTable's headers?

查看:158
本文介绍了如何以编程方式获取有关CellTable标题的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GWT 2.4。我有一个com.google.gwt.user.cellview.client.CellTable小部件,但是在构造小部件之后,我很难找出编程方式来获取String标头。我添加列数据像这样...

I'm using GWT 2.4. I have a com.google.gwt.user.cellview.client.CellTable widget, but I'm having trouble figuring out a programmatic way to get the String headers after the widget is constructed. I add column data like so ...

tableWidget.addColumn(column, header); 

其中,列是com.google.gwt.user.cellview.client.Column对象,标题是一个字符串。如何从列或单元表对象中获取标题?

where column is a com.google.gwt.user.cellview.client.Column object and header is a String. how can I get the header from either the column or cell table objects?

推荐答案

对于使用受保护的方法,您可以创建自定义类,如下所示:

For using protected method you can create a custom class, like this:

public class CustomCellTable extends CellTable {

    /* some code... */

    /* Method for access to header */
    public TableSectionElement getHeadElement() {
          return this.getTableHeadElement();
    }

    /* some code... */

}

这篇关于如何以编程方式获取有关CellTable标题的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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