Java 类com.vaadin.ui.renderers.ClickableRenderer.RendererClickListener 实例源码

项目:GridTree    文件:GridTree.java   
private void addExpandColumnRenderer(Column column) {
    final TreeNodeExpandButtonRenderer renderer=new TreeNodeExpandButtonRenderer(CellWrapper.class);
    renderer.addClickListener(new RendererClickListener() {
        @Override
        public void click(RendererClickEvent event) {
            final Object itemId=event.getItemId();
            final List<Object>changedItems=container.toogleCollapse(itemId);
            for(final Object it:changedItems) {
                final CellWrapper cw=(CellWrapper) container.getItem(it).getItemProperty(expandColumnPropertyId).getValue();
                cw.setIsExpanded(container.isItemExpanded(it));
            };
        }
    });
    column.setRenderer(renderer);
}