use of org.apache.wicket.markup.html.form.CheckBoxMultipleChoice in project wicket by apache.
the class EnhancedPageView method addTreeControls.
private void addTreeControls() {
Form<Void> form = new Form<>("form");
add(form);
form.add(new CheckBox("showStateless", new PropertyModel<Boolean>(this, "showStatefulAndParentsOnly")));
form.add(new CheckBox("showBehaviors", new PropertyModel<Boolean>(this, "showBehaviors")));
form.add(new CheckBoxMultipleChoice<>("visibleColumns", new PropertyModel<List<IColumn<TreeNode, Void>>>(this, "visibleColumns"), allColumns).setSuffix(" "));
form.add(new AjaxFallbackButton("submit", form) {
private static final long serialVersionUID = 1L;
@Override
protected void onAfterSubmit(Optional<AjaxRequestTarget> target) {
target.ifPresent(t -> t.add(componentTree));
}
});
add(new AjaxFallbackLink<Void>("expandAll") {
private static final long serialVersionUID = 1L;
public void onClick(Optional<AjaxRequestTarget> targetOptional) {
expandState.expandAll();
targetOptional.ifPresent(target -> target.add(componentTree));
}
});
add(new AjaxFallbackLink<Void>("collapseAll") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(Optional<AjaxRequestTarget> targetOptional) {
expandState.collapseAll();
targetOptional.ifPresent(target -> target.add(componentTree));
}
});
}
Aggregations