|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openfaces.util.Resources
public class Resources
Field Summary | |
---|---|
static java.lang.String |
AJAX_UTIL_JS_PATH
|
static java.lang.String |
HEADER_JS_LIBRARIES
|
static java.lang.String |
JSON_JS_PATH
|
static java.lang.String |
LIBRARY_NAME
|
static java.lang.String |
POSTPONE_JS_LINK_RENDERING
|
static java.lang.String |
RENDERED_JS_LINKS
|
static java.lang.String |
UTIL_JS_PATH
|
Method Summary | |
---|---|
static void |
addHeaderInitScript(javax.faces.context.FacesContext context,
Script script)
|
static void |
addHeaderResource(javax.faces.context.FacesContext context,
java.lang.String resourceName,
java.lang.String library)
|
static java.lang.String |
getAjaxUtilJsURL(javax.faces.context.FacesContext context)
Return URL of ajaxUtil.js file. |
static java.lang.String |
getApplicationURL(javax.faces.context.FacesContext context,
java.lang.String resourcePath)
Get path to application resource according to context and resource path |
static java.lang.String |
getFiltersJsURL(javax.faces.context.FacesContext context)
|
static java.lang.String |
getInternalURL(javax.faces.context.FacesContext context,
java.lang.String resourcePath)
|
static java.lang.String |
getJsonJsURL(javax.faces.context.FacesContext context)
Return URL of json javascript file |
static JSONObject |
getNumberFormatSettings(java.util.Locale locale)
|
static java.lang.String |
getPackageName(java.lang.Class aClass)
Return full package name for Class |
static java.util.List<java.lang.String> |
getRegisteredJsLibraries()
|
static java.util.List<java.lang.String> |
getRegisteredJsLibraries(java.util.Map<java.lang.String,java.lang.Object> requestMap)
|
static java.util.List<java.lang.String> |
getRenderedJsLinks(javax.faces.context.FacesContext context)
Return list of already rendered javascript links |
static java.lang.String |
getURL(javax.faces.context.FacesContext context,
java.lang.String userSpecifiedUrl,
java.lang.String defaultResourceFileName)
This method returns the URL string ready for rendering into HTML based on the URL specified by the user. |
static java.lang.String |
getURL(javax.faces.context.FacesContext context,
java.lang.String userSpecifiedUrl,
java.lang.String defaultResourceFileName,
boolean prependContextPath)
|
static java.lang.String |
getUtilJsURL(javax.faces.context.FacesContext context)
Return URL of util.js file |
static java.lang.String |
getVersionString()
Return version of OpenFaces |
static void |
includeJQuery()
|
static void |
includeJQuery(javax.faces.context.FacesContext context)
|
static void |
registerJavascriptLibrary(javax.faces.context.FacesContext context,
java.lang.String jsFileUrl)
Register javascript library to future adding to response |
static void |
renderJSLinkIfNeeded(javax.faces.context.FacesContext context,
java.lang.String jsFile)
Render javascript file link, if not rendered early |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HEADER_JS_LIBRARIES
public static final java.lang.String RENDERED_JS_LINKS
public static final java.lang.String POSTPONE_JS_LINK_RENDERING
public static final java.lang.String LIBRARY_NAME
public static final java.lang.String UTIL_JS_PATH
public static final java.lang.String JSON_JS_PATH
public static final java.lang.String AJAX_UTIL_JS_PATH
Method Detail |
---|
public static java.lang.String getURL(javax.faces.context.FacesContext context, java.lang.String userSpecifiedUrl, java.lang.String defaultResourceFileName)
userSpecifiedUrl
- optional resource url as specified by the user. This can be a relative URL, or an absolute URLdefaultResourceFileName
- file name for a resource which should be provided if userSpecifiedUrl is null or empty string
public static java.lang.String getURL(javax.faces.context.FacesContext context, java.lang.String userSpecifiedUrl, java.lang.String defaultResourceFileName, boolean prependContextPath)
userSpecifiedUrl
- optional resource url as specified by the user. This can be a relative URL, or an absolute URLdefaultResourceFileName
- file name for a resource which should be provided if userSpecifiedUrl is null (or empty string).
Empty string is also considered as signal for returning the default resource here because null
is auto-converted to an empty string when passed through a string bindingprependContextPath
- use true here if you render the attribute yourself, and false if you use pass this URL to HtmlGraphicImage or similar componentpublic static java.lang.String getApplicationURL(javax.faces.context.FacesContext context, java.lang.String resourcePath)
context
- faces context provided by applicationresourcePath
- path to resource - either absolute (starting with a slash) in the scope of application context,
or relative to the current page
src
or href
attribute's value.public static java.lang.String getInternalURL(javax.faces.context.FacesContext context, java.lang.String resourcePath)
context
- Current FacesContextresourcePath
- Path to the resource file
public static java.lang.String getVersionString()
public static JSONObject getNumberFormatSettings(java.util.Locale locale) throws java.io.IOException, JSONException
java.io.IOException
JSONException
public static java.lang.String getUtilJsURL(javax.faces.context.FacesContext context)
context
- FacesContext
for the current request
public static java.lang.String getFiltersJsURL(javax.faces.context.FacesContext context)
public static java.lang.String getAjaxUtilJsURL(javax.faces.context.FacesContext context)
context
- FacesContext
for the current request
public static java.lang.String getJsonJsURL(javax.faces.context.FacesContext context)
context
- FacesContext
for the current request
public static java.lang.String getPackageName(java.lang.Class aClass)
aClass
- The Class object
public static void registerJavascriptLibrary(javax.faces.context.FacesContext context, java.lang.String jsFileUrl)
context
- FacesContext
for the current requestjsFileUrl
- Url for the javascript filepublic static java.util.List<java.lang.String> getRegisteredJsLibraries()
public static java.util.List<java.lang.String> getRegisteredJsLibraries(java.util.Map<java.lang.String,java.lang.Object> requestMap)
public static void renderJSLinkIfNeeded(javax.faces.context.FacesContext context, java.lang.String jsFile) throws java.io.IOException
context
- FacesContext
for the current requestjsFile
- Javascript file to include
java.io.IOException
- if an input/output error occurspublic static java.util.List<java.lang.String> getRenderedJsLinks(javax.faces.context.FacesContext context)
context
- FacesContext
for the current request
public static void includeJQuery()
public static void includeJQuery(javax.faces.context.FacesContext context) throws java.io.IOException
java.io.IOException
public static void addHeaderResource(javax.faces.context.FacesContext context, java.lang.String resourceName, java.lang.String library)
public static void addHeaderInitScript(javax.faces.context.FacesContext context, Script script)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |