org.eclipse.rwt.resources
Interface IResource
- public interface IResource
Implementations of this interface represent an existing resource - local
or external.
-
Since:
- 1.0
getLoader
public
ClassLoader getLoader()
- Specifies the classloader that has access to the resource
that should be loaded. If there is no special classloader you
want to use just return the one of your implementation:
ClassLoader getLoader() {
return this.getClass().getClassLoader();
}
-
-
Returns:
- the classloader to use
getLocation
public
String getLocation()
- Returns the location of the resource. This can be a path to a file
within the bundles classpath or a URI for an external resource.
-
-
Returns:
- the location of the resource
-
See Also:
-
isExternal()
getCharset
public
String getCharset()
- Specifies the charset to use for this resource.
-
-
Returns:
- the charset to use
-
See Also:
-
HTML
getOptions
public
IResourceManager.RegisterOptions getOptions()
- Specifies in which way the resource is delivered. This is interesting
for javascript libraries to compress and version them before sending
them to the client. If this resource is not an javascript library use
RegisterOptions#NONE
. If you want RAP to compress the file
use RegisterOptions#COMPRESS
and to version it use
RegisterOptions#VERSION
.
If you want to combine versioning and compression you can return
RegisterOptions#VERSION_AND_COMPRESS
as value.
-
-
Returns:
- an instance of
RegisterOptions
-
See Also:
-
IResourceManager.RegisterOptions
isJSLibrary
public boolean isJSLibrary()
- Decides whether the resource is a javascript library and thus handled
a bit different than other resources. This is also needed if you plan to
have external, compressed and versioned javascript libraries.
-
-
Returns:
- whether this resource is a javascript library
-
See Also:
-
IResourceManager.RegisterOptions
,
isExternal()
,
getOptions()
isExternal
public boolean isExternal()
- Decides whether the resource is external or not. If the resource
is a javascript library and not external it will be transmitted
immediately with all the other resources. In the case of an external
javascript library it will be included in the generated page with
a <script> tag.
-
-
Returns:
- whether the resource is located externally
Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2008. All rights reserved.