List of usage examples for org.apache.wicket.extensions.markup.html.repeater.data.table DataTable getTopToolbars
public final ToolbarsContainer getTopToolbars()
From source file:com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn.java
License:Apache License
public static CheckBoxPanel findCheckBoxColumnHeader(DataTable table) { WebMarkupContainer topToolbars = table.getTopToolbars(); ComponentHierarchyIterator iterator = topToolbars.visitChildren(TableHeadersToolbar.class); if (!iterator.hasNext()) { return null; }/* ww w .ja v a 2 s. co m*/ TableHeadersToolbar toolbar = (TableHeadersToolbar) iterator.next(); // simple attempt to find checkbox which is header for our column // todo: this search will fail if there are more checkbox header columns (which is not supported now, // because Selectable.F_SELECTED is hardcoded all over the place... iterator = toolbar.visitChildren(CheckBoxPanel.class); while (iterator.hasNext()) { Component c = iterator.next(); if (!c.getOutputMarkupId()) { continue; } return (CheckBoxPanel) c; } return null; }