我有一个单元格表。我想在单元格表的一列中添加多个标签,并为每个标签分配一些工具提示。到目前为止我所尝试的 -
TextColumn<C> detailsColumn = new TextColumn<C>() {
@Override
public String getValue(C c) {
List<String[]> cList = c.getChngd();
if (cList == null || cList.size() == 0) {
return null;
}
Label lbl;
HorizontalPanel hpanel=new HorizontalPanel();
for (Iterator<String[]> itr =List.iterator(); itr.hasNext();) {
String[] detail = itr.next();
lbl=new Label();
lbl.setText(detail[0]);
lbl.addMouseOverHandler(new MouseOverHandler() {
@Override
public void onMouseOver(MouseOverEvent event) {
Widget source = (Widget)event.getSource();
source.setTitle("tooltip");
}
});
hpanel.add(lbl);
}
return hpanel.getElement().getInnerText();
}
};
它不工作。有相同的解决方案吗?