This documentation is for an old version of fiftyfive-wicket (2.0.9).


fiftyfive.wicket.js.locator
Interface JavaScriptDependencyLocator

All Known Implementing Classes:
DefaultJavaScriptDependencyLocator

public interface JavaScriptDependencyLocator

Locates JavaScript files and their dependencies. This is what is used internally by DomReadyTemplate, JavaScriptDependency and MergedJavaScriptBuilder; you should never need to use this API directly. To provide a custom implementation, call JavaScriptDependencySettings.setLocator().

Since:
2.0

Method Summary
 void findAssociatedScripts(Class<?> cls, DependencyCollection scripts)
          Locates a JavaScript file in the classpath with the same name and location as a given class, and adds it, along with of its dependencies, to the specified DependencyCollection.
 void findLibraryScripts(String libraryName, DependencyCollection scripts)
          Locates the JavaScript library with the given name and adds it, along with all of its dependencies, to the specified DependencyCollection.
 void findResourceScripts(Class<?> cls, String fileName, DependencyCollection scripts)
          Locates a JavaScript file in the classpath relative to a class, and adds it, along with of its dependencies, to the specified DependencyCollection.
 

Method Detail

findLibraryScripts

void findLibraryScripts(String libraryName,
                        DependencyCollection scripts)
Locates the JavaScript library with the given name and adds it, along with all of its dependencies, to the specified DependencyCollection. This will search the library paths that have been configured for the application.

Parameters:
libraryName - Name of the JavaScript library, like "jquery-ui". The name should not include the ".js" extension.
scripts - The library and all of its dependencies will be added to this collection in the order that they should appear in the HTML <head>.

findResourceScripts

void findResourceScripts(Class<?> cls,
                         String fileName,
                         DependencyCollection scripts)
Locates a JavaScript file in the classpath relative to a class, and adds it, along with of its dependencies, to the specified DependencyCollection.

Parameters:
cls - The JavaScript file will be located relative to this class.
fileName - Name of the JavaScript file as it appears in the classpath relative to the specified class, without the ".js" extension.
scripts - The script and all of its dependencies will be added to this collection in the order that they should appear in the HTML <head>.

findAssociatedScripts

void findAssociatedScripts(Class<?> cls,
                           DependencyCollection scripts)
Locates a JavaScript file in the classpath with the same name and location as a given class, and adds it, along with of its dependencies, to the specified DependencyCollection. If the given class has no JavaScript file, its superclass is searched, and so on up the class hierarchy.

Parameters:
cls - Specifies the name and location of the JavaScript file. For example, if the class is MyPanel.class, the JavaScript file that will be located will be MyPanel.js in the same classpath location. Superclasses will also be searched until a JS file can be found.
scripts - The script and all of its dependencies will be added to this collection in the order that they should appear in the HTML <head>.


Copyright © 2011 55 Minutes. All Rights Reserved.