我在 java gwt 中实现了一个 CellTree 结构,当单击单元格包含的小箭头时,它会打开它的子节点。仅单击单元格本身而不是明确地单击箭头时,是否也可以打开子树?
public class SomeCellTree extends Composite {
private SelectionModel selectionModel;
private CellTree cellTree;
private class SomeTreeViewModel implements TreeViewModel {
@Override
public <T> NodeInfo<?> getNodeInfo(T value) {
...
}
@Override
public boolean isLeaf(Object value) {
...
}
}
public SomeCellTree(...) {
this.selectionModel = new SingleSelectionModel();
this.selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
...
}
});
cellTree = new CellTree(new SomeTreeViewModel(),null,RESOURCES);
initWidget(cellTree);
}
}