Search in sources :

Example 1 with NoRecordsToolbar

use of org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar in project wicket by apache.

the class TableTreePage method createTree.

@Override
protected AbstractTree<Foo> createTree(FooProvider provider, IModel<Set<Foo>> state) {
    List<IColumn<Foo, String>> columns = createColumns();
    final TableTree<Foo, String> tree = new TableTree<Foo, String>("tree", columns, provider, Integer.MAX_VALUE, state) {

        private static final long serialVersionUID = 1L;

        @Override
        protected Component newContentComponent(String id, IModel<Foo> model) {
            return TableTreePage.this.newContentComponent(id, model);
        }

        @Override
        protected Item<Foo> newRowItem(String id, int index, IModel<Foo> model) {
            return new OddEvenItem<>(id, index, model);
        }
    };
    tree.getTable().addTopToolbar(new HeadersToolbar<>(tree.getTable(), null));
    tree.getTable().addBottomToolbar(new NoRecordsToolbar(tree.getTable()));
    return tree;
}
Also used : IModel(org.apache.wicket.model.IModel) NoRecordsToolbar(org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) OddEvenItem(org.apache.wicket.markup.repeater.OddEvenItem) TableTree(org.apache.wicket.extensions.markup.html.repeater.tree.TableTree)

Aggregations

IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 NoRecordsToolbar (org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar)1 TableTree (org.apache.wicket.extensions.markup.html.repeater.tree.TableTree)1 OddEvenItem (org.apache.wicket.markup.repeater.OddEvenItem)1 IModel (org.apache.wicket.model.IModel)1