Class ThemeFunctionLibrary

This a function library that can be used from the theme XSL-files. It provides easy access to current application, window, theme, webbrowser and session. The internal threadlocal state must be maintained by the webadapter in order go guarantee that it works.

Synopsis

VERSION@

Since

3.0

Inheritance Path.  java.lang.Object-> com.itmill.toolkit.terminal.web.ThemeFunctionLibrary

application()

Returns a reference to the application object associated with the session that the call came from.

browser()

Returns a reference to the browser object associated with the session that the call came from.

getCssLinksForHead()

Generate links for CSS files to be included in html head.

getFirstDayOfWeek()

Parameters

Number

of week day. 0 first day of week.

return

Name of week day in applications current locale.

Get name for week day.

getFormAction()

Parameters

return

Form action for the current window.

Get Form Action URL for the requested window.

This returns the action for the window main form. This action can be set through WebApplicationContect setWindowFormAction method..

getJavaScriptLinksForHead()

Generate links for JavaScript files to be included in html head.

getLocaleCountryId()

Parameters

return

language Country code of the current application locale.

See Also
Locale#getCountry()

Returns the country and region code for current application locale.

getLocaleLanguageId()

Parameters

return

language Language code for current application locale.

See Also
Locale#getLanguage()

Returns the language code for current application locale.

getMonth(int)

Parameters

Number

of month. 0 is January, 1 is February, and so on.

return

Name of month in applications current locale.

Get name for month.

getShortMonth(int)

Parameters

Number

of month. 0 is January, 1 is February, and so on.

return

Name of month in applications current locale.

Get short name for month.

getShortWeekday(int)

Parameters

Number

of week day. 0 sunday, 1 monday, ...

return

Name of week day in applications current locale.

Get name for week day.

getWindowTargetName()

Parameters

return

An unique ID for window target

Returns an unique target name for current window.

getWindowTargetName(Application, Window)

Parameters

windowName

Name of the window.

return

An unique ID for window target

Exceptions

IllegalStateException

If application for window is null.

Returns an unique target name for a given window name.

getWindowTargetName(String)

Parameters

return

An unique ID for window target

Exceptions

IllegalStateException

If application for window is null.

Returns an unique target name for current window.

probeClient()

Generate JavaScript for page that performs client-side combility checks.

resource(String)

Return an URI to the named resource.

resource(String, String)

Return an URI to the named resource from the named theme.

session()

Returns a reference to the current servlet http session object that is associated with the session that the call came from.

theme()

Return a reference to the current theme name that is associated with the session that the call came from.

window()

Returns a reference to the current window object associated with the session that the call came from.

windowScript()

Generate JavaScript for page header that handles window refreshing, opening and closing. Generates script that:

  • Requests that all windows that need repaint be reloaded

  • Sets the window name

  • Closes window if it is set to be closed