codetroopers.wicket.web.parsley.javascript.ParsleyExtendJsReference Maven / Gradle / Ivy
package codetroopers.wicket.web.parsley.javascript;
import org.apache.wicket.markup.head.HeaderItem;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem;
import org.apache.wicket.resource.JQueryPluginResourceReference;
import java.util.ArrayList;
/**
* Base parsley javascript reference
*
* @author cgatay
*/
public class ParsleyExtendJsReference extends JQueryPluginResourceReference {
public ParsleyExtendJsReference() {
super(ParsleyExtendJsReference.class, "parsley.extend.min.js");
}
@Override
public Iterable extends HeaderItem> getDependencies() {
final JavaScriptReferenceHeaderItem parsleyJsReference = JavaScriptHeaderItem.forReference(new ParsleyJsReference());
final Iterable extends HeaderItem> parentDependencies = super.getDependencies();
final ArrayList headerItems = new ArrayList();
for (HeaderItem parentDependency : parentDependencies) {
headerItems.add(parentDependency);
}
headerItems.add(parsleyJsReference);
return headerItems;
}
}