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

de.agilecoders.wicket.markup.html.references.BootstrapJavaScriptReference Maven / Gradle / Ivy

package de.agilecoders.wicket.markup.html.references;

import com.google.common.collect.Lists;
import org.apache.wicket.Application;
import org.apache.wicket.markup.head.HeaderItem;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.request.resource.JavaScriptResourceReference;

import java.util.List;

/**
 * TODO: document
 *
 * @author miha
 * @version 1.0
 */
public class BootstrapJavaScriptReference extends JavaScriptResourceReference {
    private static final long serialVersionUID = 1L;

    /**
     * Singleton instance of this reference
     */
    private static final BootstrapJavaScriptReference INSTANCE = new BootstrapJavaScriptReference();


    /**
     * Normally you should not use this method, but use
     * {@link de.agilecoders.wicket.settings.IBootstrapSettings#getJsResourceReference()} to prevent version conflicts.
     *
     * @return the single instance of the resource reference
     */
    public static BootstrapJavaScriptReference get() {
        return INSTANCE;
    }


    /**
     * Private constructor.
     */
    private BootstrapJavaScriptReference() {
        super(BootstrapJavaScriptReference.class, "js/bootstrap.js");
    }

    @Override
    public Iterable getDependencies() {
        final List dependencies = Lists.newArrayList(super.getDependencies());
        dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference()));

        return dependencies;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy