Search in sources :

Example 1 with HeaderItem

use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.

the class ConcatResourceBundleReference method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    Set<HeaderItem> ret = new LinkedHashSet<>();
    for (HeaderItem curProvided : providedResources) {
        for (HeaderItem curDependency : curProvided.getDependencies()) ret.add(curDependency);
    }
    for (HeaderItem curProvided : providedResources) {
        ret.remove(curProvided);
    }
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.addAll(ret);
    return dependencies;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) HeaderItem(org.apache.wicket.markup.head.HeaderItem) IReferenceHeaderItem(org.apache.wicket.markup.head.IReferenceHeaderItem)

Example 2 with HeaderItem

use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.

the class JQueryPluginResourceReference method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    final ResourceReference backingLibraryReference;
    if (Application.exists()) {
        backingLibraryReference = Application.get().getJavaScriptLibrarySettings().getJQueryReference();
    } else {
        backingLibraryReference = DynamicJQueryResourceReference.get();
    }
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.add(JavaScriptHeaderItem.forReference(backingLibraryReference));
    return dependencies;
}
Also used : JavaScriptResourceReference(org.apache.wicket.request.resource.JavaScriptResourceReference) ResourceReference(org.apache.wicket.request.resource.ResourceReference) HeaderItem(org.apache.wicket.markup.head.HeaderItem) JavaScriptHeaderItem(org.apache.wicket.markup.head.JavaScriptHeaderItem)

Example 3 with HeaderItem

use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.

the class FilteredHeaderItem method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    List<FilteredHeaderItem> ret = new ArrayList<>();
    for (HeaderItem curDependency : getWrapped().getDependencies()) {
        ret.add(wrap(curDependency));
    }
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.addAll(ret);
    return dependencies;
}
Also used : ArrayList(java.util.ArrayList) HeaderItem(org.apache.wicket.markup.head.HeaderItem) IWrappedHeaderItem(org.apache.wicket.markup.head.IWrappedHeaderItem)

Example 4 with HeaderItem

use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.

the class WicketAjaxDebugJQueryResourceReference method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    final ResourceReference wicketAjaxReference;
    if (Application.exists()) {
        wicketAjaxReference = Application.get().getJavaScriptLibrarySettings().getWicketAjaxReference();
    } else {
        wicketAjaxReference = WicketAjaxJQueryResourceReference.get();
    }
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.add(JavaScriptHeaderItem.forReference(wicketAjaxReference));
    return dependencies;
}
Also used : JavaScriptResourceReference(org.apache.wicket.request.resource.JavaScriptResourceReference) ResourceReference(org.apache.wicket.request.resource.ResourceReference) HeaderItem(org.apache.wicket.markup.head.HeaderItem) JavaScriptHeaderItem(org.apache.wicket.markup.head.JavaScriptHeaderItem)

Example 5 with HeaderItem

use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.

the class WicketAjaxJQueryResourceReference method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    final ResourceReference jqueryReference;
    if (Application.exists()) {
        jqueryReference = Application.get().getJavaScriptLibrarySettings().getJQueryReference();
    } else {
        jqueryReference = JQueryResourceReference.getV2();
    }
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.add(JavaScriptHeaderItem.forReference(jqueryReference));
    return dependencies;
}
Also used : JavaScriptResourceReference(org.apache.wicket.request.resource.JavaScriptResourceReference) JQueryResourceReference(org.apache.wicket.resource.JQueryResourceReference) ResourceReference(org.apache.wicket.request.resource.ResourceReference) HeaderItem(org.apache.wicket.markup.head.HeaderItem) JavaScriptHeaderItem(org.apache.wicket.markup.head.JavaScriptHeaderItem)

Aggregations

HeaderItem (org.apache.wicket.markup.head.HeaderItem)22 PriorityHeaderItem (org.apache.wicket.markup.head.PriorityHeaderItem)10 Test (org.junit.Test)10 JavaScriptHeaderItem (org.apache.wicket.markup.head.JavaScriptHeaderItem)7 JavaScriptResourceReference (org.apache.wicket.request.resource.JavaScriptResourceReference)6 ResourceReference (org.apache.wicket.request.resource.ResourceReference)5 ArrayList (java.util.ArrayList)4 LinkedHashSet (java.util.LinkedHashSet)2 CssHeaderItem (org.apache.wicket.markup.head.CssHeaderItem)2 IHeaderResponse (org.apache.wicket.markup.head.IHeaderResponse)2 WicketAjaxJQueryResourceReference (org.apache.wicket.ajax.WicketAjaxJQueryResourceReference)1 IReferenceHeaderItem (org.apache.wicket.markup.head.IReferenceHeaderItem)1 IWrappedHeaderItem (org.apache.wicket.markup.head.IWrappedHeaderItem)1 JavaScriptReferenceHeaderItem (org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem)1 ResourceAggregator (org.apache.wicket.markup.head.ResourceAggregator)1 HeaderResponse (org.apache.wicket.markup.head.internal.HeaderResponse)1 DecoratingHeaderResponse (org.apache.wicket.markup.html.DecoratingHeaderResponse)1 XmlPullParser (org.apache.wicket.markup.parser.XmlPullParser)1 XmlTag (org.apache.wicket.markup.parser.XmlTag)1 PackageResourceReference (org.apache.wicket.request.resource.PackageResourceReference)1