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