Class FileLoader
You can also use the FileLoader to start loading the core SmartClient runtime in the background while your users are interacting with a non-SmartGWT login page or landing page, to reduce application load time for first-time users who have not yet cached these files.
To do this, load the ISC_FileLoader.js file in your plain HTML login or landing page, and call isc.FileLoader.cacheISC(). Refer to the <a href=https://www.smartclient.com/smartclient-release/isomorphic/system/reference/?id=object..FileLoader>SmartClient Reference for FileLoader for details of how to get this right (setting path to the files to load, etc), and also to learn about other features of the FileLoader that can help you cache other resources.
Note that an alternative approach is to use <script> tags with the defer
attribute to load all the files of the SmartClient runtime into the current page, without
blocking rendering of plain HTML content such as a login form.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
cacheEdgeImages
(String skinImgDir, String baseURL) Caches a set of edge images derived from a base image.static void
cacheEdgeImages
(String skinImgDir, String[] baseURLs, String[] edges) Caches a set of edge images derived from a base image.static void
cacheEdgeImages
(String skinImgDir, String baseURL, String edges) Caches a set of edge images derived from a base image.static void
cacheEdgeImages
(String skinImgDir, String baseURL, String[] edges) Caches a set of edge images derived from a base image.static void
Cache a list of imagesstatic void
Cache a list of imagesstatic void
cacheImgStates
(String skinImgDir, String[] baseImageURLs, String[] states) Caches a set of state images derived from a base image.static void
cacheImgStates
(String skinImgDir, String baseImageURL, String states) Caches a set of state images derived from a base image.static void
cacheStretchImgStates
(String skinImgDir, String[] baseURLs, String[] states) Caches a set of state stretch images derived from a base image.static void
cacheStretchImgStates
(String skinImgDir, String baseURL, String states) Caches a set of state stretch images derived from a base image.static void
cacheStretchImgStates
(String skinImgDir, String baseURL, String[] states) Caches a set of state stretch images derived from a base image.static String
Return the skin dir.
-
Constructor Details
-
FileLoader
public FileLoader()
-
-
Method Details
-
getSkinDir
Return the skin dir.- Returns:
- the skin dir
-
cacheImgs
Cache a list of images- Parameters:
skinImgDir
- the skinImgDirbaseImageURLs
- a list of base urls
-
cacheImg
Cache a list of images- Parameters:
skinImgDir
- the skinImgDirbaseImageURL
- the base urls
-
cacheImgStates
Caches a set of state images derived from a base image. This is useful for caching a set of images for a single component. For example this code:
FileLoader.cacheImgStates("TreeGrid/opener.png","closed,opening,opened"); Will cause the following images to be cached: /isomorphic/skins/[skin]/images/TreeGrid/opener_closed.png /isomorphic/skins/[skin]/images/TreeGrid/opener_opening.png /isomorphic/skins/[skin]/images/TreeGrid/opener_opened.png- Parameters:
skinImgDir
- the skinImgDirbaseImageURL
- the base image pathstates
- a list of states to load.
-
cacheImgStates
Caches a set of state images derived from a base image. This is useful for caching a set of images for a single component. For example this code:
FileLoader.cacheImgStates("TreeGrid/opener.png","closed,opening,opened"); Will cause the following images to be cached: /isomorphic/skins/[skin]/images/TreeGrid/opener_closed.png /isomorphic/skins/[skin]/images/TreeGrid/opener_opening.png /isomorphic/skins/[skin]/images/TreeGrid/opener_opened.png- Parameters:
skinImgDir
- the skinImgDirbaseImageURLs
- the base image pathsstates
- a list of states to load.
-
cacheEdgeImages
Caches a set of edge images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURL
- the base url
-
cacheEdgeImages
Caches a set of edge images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURL
- the base urledges
- List of edges to load.
-
cacheEdgeImages
Caches a set of edge images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURL
- the base urledges
- List of edges to load.
-
cacheEdgeImages
Caches a set of edge images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURLs
- list of base urlsedges
- List of edges to load.
-
cacheStretchImgStates
Caches a set of state stretch images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURL
- base image URL from which stateful names are to be derivedstates
- List of states to load.
-
cacheStretchImgStates
Caches a set of state stretch images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURL
- base image URL from which stateful names are to be derivedstates
- List of states to load.
-
cacheStretchImgStates
Caches a set of state stretch images derived from a base image.- Parameters:
skinImgDir
- the skinImgDirbaseURLs
- List of base image URLs from which stateful names are to be derivedstates
- List of states to load.
-