Search in sources :

Example 1 with TableHeadersToolbar

use of com.evolveum.midpoint.web.component.data.TableHeadersToolbar in project midpoint by Evolveum.

the class CheckBoxHeaderColumn method findCheckBoxColumnHeader.

public static CheckBoxPanel findCheckBoxColumnHeader(DataTable table) {
    WebMarkupContainer topToolbars = table.getTopToolbars();
    ComponentHierarchyIterator iterator = topToolbars.visitChildren(TableHeadersToolbar.class);
    if (!iterator.hasNext()) {
        return null;
    }
    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;
}
Also used : ComponentHierarchyIterator(org.apache.wicket.util.iterator.ComponentHierarchyIterator) TableHeadersToolbar(com.evolveum.midpoint.web.component.data.TableHeadersToolbar) Component(org.apache.wicket.Component) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

TableHeadersToolbar (com.evolveum.midpoint.web.component.data.TableHeadersToolbar)1 Component (org.apache.wicket.Component)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 ComponentHierarchyIterator (org.apache.wicket.util.iterator.ComponentHierarchyIterator)1