java.lang.Object
org.apache.wicket.markup.head.HeaderItem
org.apache.wicket.markup.head.AbstractCspHeaderItem
org.apache.wicket.markup.head.JavaScriptHeaderItem
- All Implemented Interfaces:
Serializable
,IClusterable
- Direct Known Subclasses:
AbstractJavaScriptReferenceHeaderItem
,JavaScriptContentHeaderItem
Base class for all
HeaderItem
s that represent javascripts. This class mainly contains
factory methods.- Author:
- papegaaij
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
forReference
(ResourceReference reference) Creates aJavaScriptReferenceHeaderItem
for the given reference.forReference
(ResourceReference reference, String id) Creates aJavaScriptReferenceHeaderItem
for the given reference.forReference
(ResourceReference reference, PageParameters pageParameters, String id) Creates aJavaScriptReferenceHeaderItem
for the given reference.static JavaScriptContentHeaderItem
forScript
(CharSequence javascript, String id) Creates aJavaScriptContentHeaderItem
for the given content.Creates aJavaScriptUrlReferenceHeaderItem
for the given url.Creates aJavaScriptUrlReferenceHeaderItem
for the given url.getId()
int
hashCode()
Sets the markup id for this header itemMethods inherited from class org.apache.wicket.markup.head.AbstractCspHeaderItem
getNonce, setNonce
Methods inherited from class org.apache.wicket.markup.head.HeaderItem
getDependencies, getProvidedResources, getRenderTokens, render
-
Constructor Details
-
JavaScriptHeaderItem
public JavaScriptHeaderItem()
-
-
Method Details
-
getId
- Returns:
- unique id for the javascript element.
-
setId
Sets the markup id for this header item- Parameters:
markupId
- the markup id- Returns:
this
object, for method chaining
-
forReference
public static JavaScriptReferenceHeaderItem forReference(ResourceReference reference, PageParameters pageParameters, String id) Creates aJavaScriptReferenceHeaderItem
for the given reference.- Parameters:
reference
- resource reference pointing to the javascript resourcepageParameters
- the parameters for this Javascript resource referenceid
- 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
Creates aJavaScriptReferenceHeaderItem
for the given reference.- Parameters:
reference
- resource reference pointing to the JavaScript resourceid
- 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
Creates aJavaScriptReferenceHeaderItem
for the given reference.- Parameters:
reference
- resource reference pointing to the JavaScript resource- Returns:
- A newly created
JavaScriptReferenceHeaderItem
for the given reference.
-
forScript
Creates aJavaScriptContentHeaderItem
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.
-
forUrl
Creates aJavaScriptUrlReferenceHeaderItem
for the given url.- Parameters:
url
- context-relative url of the the javascript resource- Returns:
- A newly created
JavaScriptUrlReferenceHeaderItem
for the given url.
-
forUrl
Creates aJavaScriptUrlReferenceHeaderItem
for the given url.- Parameters:
url
- context-relative url of the the javascript resourceid
- id that will be used to filter duplicate reference (it's still filtered by URL too)- Returns:
- A newly created
JavaScriptUrlReferenceHeaderItem
for the given url.
-
equals
-
hashCode
-