Example usage for org.apache.wicket.util.value IValueMap getAsBoolean

List of usage examples for org.apache.wicket.util.value IValueMap getAsBoolean

Introduction

In this page you can find the example usage for org.apache.wicket.util.value IValueMap getAsBoolean.

Prototype

boolean getAsBoolean(String key, boolean defaultValue);

Source Link

Document

Retrieves a boolean value by key.

Usage

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

License:Apache License

private void internalShow(Dialog dialog) {
    this.dialog = dialog;
    dialog.setDialogService(this);
    setTitle(new EscapeHtmlStringModel(new StringWithoutLineBreaksModel(dialog.getTitle())));
    setContent(dialog.getComponent());//from   w w  w. j  ava2s  .co  m
    setWindowClosedCallback(new Callback(dialog));

    IValueMap properties = dialog.getProperties();

    if (properties.containsKey("height") && properties.getString("height").equals("auto")) {
        setUseInitialHeight(false);
    } else {
        setUseInitialHeight(true);
        setInitialHeight(properties.getInt("height", 455));
    }

    setInitialWidth(properties.getInt("width", 850));
    setResizable(properties.getAsBoolean("resizable", false));

    String cssClasses = "hippo-dialog";
    if (isResizable()) {
        cssClasses += " hippo-dialog-resizable";
    }

    final String customCssClass = properties.getString("css-class-name", null);
    if (StringUtils.isNotEmpty(customCssClass)) {
        cssClasses += " " + customCssClass;
    }
    setCssClassName(cssClasses);

    AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
    if (target != null) {
        show(target);
    }
}