Search in sources :

Example 1 with AbstractDialog

use of com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog in project openmeetings by apache.

the class AbstractWicketTester method getButtonBehavior.

public static <T extends Serializable> ButtonAjaxBehavior getButtonBehavior(WicketTester tester, String path, String name) {
    Args.notNull(path, "path");
    Args.notNull(name, "name");
    @SuppressWarnings("unchecked") AbstractDialog<T> dialog = (AbstractDialog<T>) tester.getComponentFromLastRenderedPage(path);
    List<ButtonAjaxBehavior> bl = dialog.getBehaviors(ButtonAjaxBehavior.class);
    for (ButtonAjaxBehavior bb : bl) {
        if (name.equals(bb.getButton().getName())) {
            return bb;
        }
    }
    fail(String.format("Button '%s' not found for dialog '%s'", name, path));
    return null;
}
Also used : AbstractDialog(com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog) ButtonAjaxBehavior(com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior)

Aggregations

AbstractDialog (com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog)1 ButtonAjaxBehavior (com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior)1