All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wicketstuff.datatables.themes.BootstrapTheme Maven / Gradle / Ivy

There is a newer version: 10.3.0
Show newest version
package org.wicketstuff.datatables.themes;

import de.agilecoders.wicket.webjars.request.resource.WebjarsCssResourceReference;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.wicketstuff.datatables.options.Options;
import org.wicketstuff.datatables.res.DataTablesBootstrapCssReference;
import org.wicketstuff.datatables.res.DataTablesBootstrapJsReference;
import org.wicketstuff.datatables.res.DataTablesScrollerJsReference;
import org.wicketstuff.datatables.res.DataTablesSelectJsReference;

/**
 *
 */
public class BootstrapTheme extends Behavior {

    public BootstrapTheme(Options options) {
        options.style(Options.Style.bootstrap);
    }

    @Override
    public void onComponentTag(Component component, ComponentTag tag) {
        super.onComponentTag(component, tag);

        tag.append("class", "table table-striped table-bordered", " ");
    }

    @Override
    public void renderHead(Component component, IHeaderResponse response) {
        super.renderHead(component, response);

        response.render(CssHeaderItem.forReference(new WebjarsCssResourceReference("/bootstrap/current/css/bootstrap.css")));
        response.render(CssHeaderItem.forReference(new DataTablesBootstrapCssReference()));
        response.render(JavaScriptHeaderItem.forReference(new DataTablesBootstrapJsReference()));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy