Example usage for org.apache.wicket MarkupContainer getBehaviors

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

Introduction

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

Prototype

public final List<? extends Behavior> getBehaviors() 

Source Link

Document

Gets the currently coupled Behavior s as a unmodifiable list.

Usage

From source file:org.geoserver.web.demo.MapPreviewPageTest.java

License:Open Source License

private void assertMaxFeaturesInData(DataView data, int maxFeatures) {
    for (Iterator it = data.iterator(); it.hasNext();) {
        MarkupContainer c = (MarkupContainer) it.next();
        MarkupContainer list = (MarkupContainer) c.get("itemProperties:4:component:menu");
        for (Iterator<IBehavior> itBehaviors = list.getBehaviors().iterator(); itBehaviors.hasNext();) {
            IBehavior b = (IBehavior) (itBehaviors.next());
            if (b instanceof AttributeModifier) {
                AttributeModifier am = (AttributeModifier) b;
                String url = am.toString();
                if (maxFeatures > 0) {
                    assertTrue(url.contains("&maxFeatures=" + maxFeatures));
                } else {
                    assertTrue(!url.contains("&maxFeatures="));
                }// w w  w  . j  a  v a2 s .c om
            }

        }
    }
}

From source file:org.hippoecm.frontend.plugins.yui.layout.ExpandCollapseLink.java

License:Apache License

private boolean hasExpandableParent() {
    if (hasExpandableParent == null) {
        hasExpandableParent = false;//  w w w. j  av  a 2  s . c om
        MarkupContainer parent = getParent();
        while (parent != null) {
            for (Behavior behavior : parent.getBehaviors()) {
                if (behavior instanceof WireframeBehavior) {
                    WireframeBehavior wireframe = (WireframeBehavior) behavior;
                    if (wireframe.hasExpandableUnit()) {
                        hasExpandableParent = true;
                        break;
                    }
                }
            }
            parent = parent.getParent();
        }
    }
    return hasExpandableParent;
}