Package com.vaadin.client
Class DependencyLoader
- java.lang.Object
-
- com.vaadin.client.DependencyLoader
-
public class DependencyLoader extends Object
Handles loading of dependencies (stylesheets and scripts) in the application.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description DependencyLoader(Registry registry)Creates a new instance connected to the given registry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidloadDependencies(JsMap<LoadMode,elemental.json.JsonArray> clientDependencies)Triggers loading of the given dependencies.voidrequireHtmlImportsReady()Prevents eager dependencies from being considered as loaded untilHTMLImports.whenReadyhas been run.static voidrunWhenEagerDependenciesLoaded(Command command)Adds a command to be run when all eager dependencies have finished loading.
-
-
-
Constructor Detail
-
DependencyLoader
public DependencyLoader(Registry registry)
Creates a new instance connected to the given registry.- Parameters:
registry- the global registry
-
-
Method Detail
-
runWhenEagerDependenciesLoaded
public static void runWhenEagerDependenciesLoaded(Command command)
Adds a command to be run when all eager dependencies have finished loading.If no eager dependencies are currently being loaded, runs the command immediately.
- Parameters:
command- the command to run when eager dependencies have been loaded- See Also:
startEagerDependencyLoading(),endEagerDependencyLoading()
-
loadDependencies
public void loadDependencies(JsMap<LoadMode,elemental.json.JsonArray> clientDependencies)
Triggers loading of the given dependencies.- Parameters:
clientDependencies- the map of the dependencies to load, divided into groups by load mode, notnull.
-
requireHtmlImportsReady
public void requireHtmlImportsReady()
Prevents eager dependencies from being considered as loaded untilHTMLImports.whenReadyhas been run.
-
-