Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以在GWT celltable中添加列表框吗_Gwt - Fatal编程技术网

我可以在GWT celltable中添加列表框吗

我可以在GWT celltable中添加列表框吗,gwt,Gwt,是否可以在GWT CellTable中添加列表框 必须在所附的图片中做一些类似的事情 谢谢你看看这个, 看看这个, 是的,您可以通过将SelectionCell添加到CellTable中来实现 final Category[] categories = ContactDatabase.get().queryCategories(); List<String> categoryNames = new ArrayList<String>(); for (Ca

是否可以在GWT CellTable中添加列表框

必须在所附的图片中做一些类似的事情

谢谢你看看这个, 看看这个,

是的,您可以通过将SelectionCell添加到CellTable中来实现

final Category[] categories = ContactDatabase.get().queryCategories();
    List<String> categoryNames = new ArrayList<String>();
    for (Category category : categories) {
      categoryNames.add(category.getDisplayName());
    }
    SelectionCell categoryCell = new SelectionCell(categoryNames);
    Column<ContactInfo, String> categoryColumn = new Column<ContactInfo, String>(
        categoryCell) {
      @Override
      public String getValue(ContactInfo object) {
        return object.getCategory().getDisplayName();
      }
    };
    cellTable.addColumn(categoryColumn, constants.cwCellTableColumnCategory());
    categoryColumn.setFieldUpdater(new FieldUpdater<ContactInfo, String>() {
      public void update(int index, ContactInfo object, String value) {
        for (Category category : categories) {
          if (category.getDisplayName().equals(value)) {
            object.setCategory(category);
          }
        }
        ContactDatabase.get().refreshDisplays();
      }
    });
    cellTable.setColumnWidth(categoryColumn, 130, Unit.PX);
final Category[]categories=ContactDatabase.get().queryCategories();
List categoryNames=new ArrayList();
用于(类别:类别){
添加(category.getDisplayName());
}
SelectionCell categoryCell=新的SelectionCell(categoryNames);
列类别Column=新列(
分类细胞){
@凌驾
公共字符串getValue(ContactInfo对象){
返回object.getCategory().getDisplayName();
}
};
addColumn(categoryColumn,constants.cwcelltableColumnCompt());
categoryColumn.setFieldUpdater(新的FieldUpdater(){
公共无效更新(int索引、ContactInfo对象、字符串值){
用于(类别:类别){
if(category.getDisplayName().equals(value)){
object.setCategory(类别);
}
}
ContactDatabase.get().refreshDisplays();
}
});
cellTable.setColumnWidth(categoryColumn,130,Unit.PX);

是,您可以通过将SelectionCell添加到CellTable中来实现

final Category[] categories = ContactDatabase.get().queryCategories();
    List<String> categoryNames = new ArrayList<String>();
    for (Category category : categories) {
      categoryNames.add(category.getDisplayName());
    }
    SelectionCell categoryCell = new SelectionCell(categoryNames);
    Column<ContactInfo, String> categoryColumn = new Column<ContactInfo, String>(
        categoryCell) {
      @Override
      public String getValue(ContactInfo object) {
        return object.getCategory().getDisplayName();
      }
    };
    cellTable.addColumn(categoryColumn, constants.cwCellTableColumnCategory());
    categoryColumn.setFieldUpdater(new FieldUpdater<ContactInfo, String>() {
      public void update(int index, ContactInfo object, String value) {
        for (Category category : categories) {
          if (category.getDisplayName().equals(value)) {
            object.setCategory(category);
          }
        }
        ContactDatabase.get().refreshDisplays();
      }
    });
    cellTable.setColumnWidth(categoryColumn, 130, Unit.PX);
final Category[]categories=ContactDatabase.get().queryCategories();
List categoryNames=new ArrayList();
用于(类别:类别){
添加(category.getDisplayName());
}
SelectionCell categoryCell=新的SelectionCell(categoryNames);
列类别Column=新列(
分类细胞){
@凌驾
公共字符串getValue(ContactInfo对象){
返回object.getCategory().getDisplayName();
}
};
addColumn(categoryColumn,constants.cwcelltableColumnCompt());
categoryColumn.setFieldUpdater(新的FieldUpdater(){
公共无效更新(int索引、ContactInfo对象、字符串值){
用于(类别:类别){
if(category.getDisplayName().equals(value)){
object.setCategory(类别);
}
}
ContactDatabase.get().refreshDisplays();
}
});
cellTable.setColumnWidth(categoryColumn,130,Unit.PX);