|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.terminal.gwt.client.ResourceLoader
public class ResourceLoader
ResourceLoader lets you dynamically include external scripts and styles on the page and lets you know when the resource has been loaded. You can also preload resources, allowing them to get cached by the browser without being evaluated. This enables downloading multiple resources at once while still controlling in which order e.g. scripts are executed.
Nested Class Summary | |
---|---|
static class |
ResourceLoader.ResourceLoadEvent
Event fired when a resource has been loaded. |
static interface |
ResourceLoader.ResourceLoadListener
Event listener that gets notified when a resource has been loaded |
Constructor Summary | |
---|---|
protected |
ResourceLoader()
Creates a new resource loader. |
Method Summary | |
---|---|
static ResourceLoader |
get()
Returns the default ResourceLoader |
void |
loadScript(String scriptUrl,
ResourceLoader.ResourceLoadListener resourceLoadListener)
Load a script and notify a listener when the script is loaded. |
void |
loadStylesheet(String stylesheetUrl,
ResourceLoader.ResourceLoadListener resourceLoadListener)
Load a stylesheet and notify a listener when the stylesheet is loaded. |
void |
preloadResource(String url,
ResourceLoader.ResourceLoadListener resourceLoadListener)
Download a resource and notify a listener when the resource is loaded without attempting to interpret the resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ResourceLoader()
get()
to get an
instance.
Method Detail |
---|
public static ResourceLoader get()
public void loadScript(String scriptUrl, ResourceLoader.ResourceLoadListener resourceLoadListener)
scriptUrl
- the url of the script to loadresourceLoadListener
- the listener that will get notified when the script is loadedpublic void preloadResource(String url, ResourceLoader.ResourceLoadListener resourceLoadListener)
url
- the url of the resource to preloadresourceLoadListener
- the listener that will get notified when the resource is
preloadedpublic void loadStylesheet(String stylesheetUrl, ResourceLoader.ResourceLoadListener resourceLoadListener)
stylesheetUrl
- the url of the stylesheet to loadresourceLoadListener
- the listener that will get notified when the stylesheet is
loaded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |