我已经搜索了GoogleCode,GWT ShowCase,GWT Developer Notes和Google Groups,以了解如何获取/设置CompositeCell的值.没有一个明确的例子可以解释如何在CellTable中使用它.
让我们盯着一些代码......首先是抽象类......
public abstract class ToggleableGrid<T> extends CellTable<T> {
private static final String DEFAULT_TABLE_WIDTH = "100%";
private static final DisplayMode DEFAULT_MODE = DisplayMode.VIEW;
protected void setDefaults() {
setWidth(DEFAULT_TABLE_WIDTH);
// Set the message to display when the table is empty.
setEmptyTableWidget(new Label(UiMessages.INSTANCE.no_results()));
// Add a selection model so we can select cells
final SelectionModel<T> selectionModel = new MultiSelectionModel<T>();
setSelectionModel(selectionModel, DefaultSelectionEventManager.<T> createDefaultManager());
}
public void setInput(List<T> content) {
setInput(content, DEFAULT_MODE);
}
public void setInput(List<T> content, DisplayMode mode) { …Run Code Online (Sandbox Code Playgroud)