Class JavaScriptHeaderItem

    • Constructor Detail

      • JavaScriptHeaderItem

        protected JavaScriptHeaderItem​(java.lang.String condition)
    • Method Detail

      • getId

        public java.lang.String getId()
        Returns:
        unique id for the javascript element.
      • setId

        public JavaScriptHeaderItem setId​(java.lang.String markupId)
        Sets the markup id for this header item
        Parameters:
        markupId - the markup id
        Returns:
        this object, for method chaining
      • getCondition

        public java.lang.String getCondition()
        Returns:
        the condition to use for Internet Explorer conditional comments. E.g. "IE 7".
      • forReference

        public static JavaScriptReferenceHeaderItem forReference​(ResourceReference reference,
                                                                 org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
                                                                 java.lang.String id)
        Creates a JavaScriptReferenceHeaderItem for the given reference.
        Parameters:
        reference - resource reference pointing to the javascript resource
        pageParameters - the parameters for this Javascript resource reference
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        Returns:
        A newly created JavaScriptReferenceHeaderItem for the given reference.
      • forReference

        public static JavaScriptReferenceHeaderItem forReference​(ResourceReference reference,
                                                                 org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
                                                                 java.lang.String id,
                                                                 boolean defer)
        Creates a JavaScriptReferenceHeaderItem for the given reference.
        Parameters:
        reference - resource reference pointing to the javascript resource
        pageParameters - the parameters for this Javascript resource reference
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        Returns:
        A newly created JavaScriptReferenceHeaderItem for the given reference.
      • forReference

        public static JavaScriptReferenceHeaderItem forReference​(ResourceReference reference,
                                                                 java.lang.String id,
                                                                 boolean defer)
        Creates a JavaScriptReferenceHeaderItem for the given reference.
        Parameters:
        reference - resource reference pointing to the JavaScript resource
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        Returns:
        A newly created JavaScriptReferenceHeaderItem for the given reference.
      • forReference

        public static JavaScriptReferenceHeaderItem forReference​(ResourceReference reference,
                                                                 org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
                                                                 java.lang.String id,
                                                                 boolean defer,
                                                                 java.lang.String charset)
        Creates a JavaScriptReferenceHeaderItem for the given reference.
        Parameters:
        reference - resource reference pointing to the javascript resource
        pageParameters - the parameters for this Javascript resource reference
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        charset - a non null value specifies the charset attribute of the script tag
        Returns:
        A newly created JavaScriptReferenceHeaderItem for the given reference.
      • forReference

        public static JavaScriptReferenceHeaderItem forReference​(ResourceReference reference,
                                                                 org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
                                                                 java.lang.String id,
                                                                 boolean defer,
                                                                 java.lang.String charset,
                                                                 java.lang.String condition)
        Creates a JavaScriptReferenceHeaderItem for the given reference.
        Parameters:
        reference - resource reference pointing to the javascript resource
        pageParameters - the parameters for this Javascript resource reference
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        charset - a non null value specifies the charset attribute of the script tag
        condition - the condition to use for Internet Explorer conditional comments. E.g. "IE 7".
        Returns:
        A newly created JavaScriptReferenceHeaderItem for the given reference.
      • forScript

        public static JavaScriptContentHeaderItem forScript​(java.lang.CharSequence javascript,
                                                            java.lang.String id)
        Creates a JavaScriptContentHeaderItem for the given content.
        Parameters:
        javascript - javascript content to be rendered.
        id - unique id for the javascript element. This can be null, however in that case the ajax header contribution can't detect duplicate script fragments.
        Returns:
        A newly created JavaScriptContentHeaderItem for the given content.
      • forScript

        public static JavaScriptContentHeaderItem forScript​(java.lang.CharSequence javascript,
                                                            java.lang.String id,
                                                            java.lang.String condition)
        Creates a JavaScriptContentHeaderItem for the given content.
        Parameters:
        javascript - javascript content to be rendered.
        id - unique id for the javascript element. This can be null, however in that case the ajax header contribution can't detect duplicate script fragments.
        condition - the condition to use for Internet Explorer conditional comments. E.g. "IE 7".
        Returns:
        A newly created JavaScriptContentHeaderItem for the given content.
      • forUrl

        public static JavaScriptUrlReferenceHeaderItem forUrl​(java.lang.String url,
                                                              java.lang.String id,
                                                              boolean defer)
        Creates a JavaScriptUrlReferenceHeaderItem for the given url.
        Parameters:
        url - context-relative url of the the javascript resource
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        Returns:
        A newly created JavaScriptUrlReferenceHeaderItem for the given url.
      • forUrl

        public static JavaScriptUrlReferenceHeaderItem forUrl​(java.lang.String url,
                                                              java.lang.String id,
                                                              boolean defer,
                                                              java.lang.String charset)
        Creates a JavaScriptUrlReferenceHeaderItem for the given url.
        Parameters:
        url - context-relative url of the the javascript resource
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        charset - a non null value specifies the charset attribute of the script tag
        Returns:
        A newly created JavaScriptUrlReferenceHeaderItem for the given url.
      • forUrl

        public static JavaScriptUrlReferenceHeaderItem forUrl​(java.lang.String url,
                                                              java.lang.String id,
                                                              boolean defer,
                                                              java.lang.String charset,
                                                              java.lang.String condition)
        Creates a JavaScriptUrlReferenceHeaderItem for the given url.
        Parameters:
        url - context-relative url of the the javascript resource
        id - id that will be used to filter duplicate reference (it's still filtered by URL too)
        defer - specifies that the execution of a script should be deferred (delayed) until after the page has been loaded.
        charset - a non null value specifies the charset attribute of the script tag
        Returns:
        A newly created JavaScriptUrlReferenceHeaderItem for the given url.
      • internalRenderJavaScriptReference

        protected final void internalRenderJavaScriptReference​(org.apache.wicket.request.Response response,
                                                               java.lang.String url,
                                                               java.lang.String id,
                                                               boolean defer,
                                                               java.lang.String charset,
                                                               java.lang.String condition,
                                                               boolean async)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object