Example usage for org.apache.wicket MarkupContainer size

List of usage examples for org.apache.wicket MarkupContainer size

Introduction

In this page you can find the example usage for org.apache.wicket MarkupContainer size.

Prototype

public int size() 

Source Link

Document

Get the number of children in this container.

Usage

From source file:com.aplombee.RepeaterUtil.java

License:Apache License

/**
 * {@inheritDoc}//from w w w  .  j  a  va  2  s .c o  m
 */
@Override
public final void parentNotSuitable(IQuickView quickView) {
    Args.notNull(quickView, "quickview");
    if (!quickView.getReuseStrategy().isAddItemsSupported()) {
        return;
    }
    MarkupContainer parent = quickView.getParent();
    if (parent == null) {
        throw new QuickViewNotAddedToParentException("add quickview to a markupcontainer");
    }
    if (parent instanceof Page) {
        throw new QuickViewNotAddedToParentException("add quickview to a markupcontainer");
    }
    if (parent.size() > 1) {
        throw new ParentNotUnaryException(
                "the markupcontainer to which quickview is attached should have quickview as its only child");
    }
}

From source file:org.hippoecm.frontend.dialog.AbstractDialogTest.java

License:Apache License

@Test
public void dialogIsClosedAfterSuccessfulSubmit() {
    tester.runInAjax(home, new Runnable() {

        @Override/*from www . java2  s  .c  o  m*/
        public void run() {
            IDialogService dialogService = context.getService(IDialogService.class.getName(),
                    IDialogService.class);
            dialogService.show(new Dialog());
        }

    });

    tester.executeAjaxEvent(home.get("dialog:content:form:buttons:0:button"), "onclick");
    MarkupContainer content = (MarkupContainer) home.get("dialog:content");
    assertEquals(0, content.size());
}