Class Theme

This class provides an interface to the meta-information regarding a particular theme. This entails for instanace the inheritance tree of the various xsl-template files, the different requirments that the theme imposes on the client browser, etc.

The WebAdapter uses themes to convert the UIDL description into client representation, typically HTML or XHTML. A theme consists of set of XSL template files which are used to perform XSL transform.

XSL files are divided into sets, which can have requirements. A file set is included in transformation only if the given requirements are met. Following requirements are supported:

  • User-Agent HTTP header substring matching

  • Markup language version

  • JavaScript version

Additionally following boolean operators may be applied to above requirements:

  • NOT

  • AND

  • OR

The requirements are introduced in XML description file. See example below.

The theme description is XML data, and it can be loaded from file or stream. The default filename is specified by Theme.DESCRIPTIONFILE .

Synopsis

VERSION@

Since

3.0

Inheritance Path.  java.lang.Object-> org.xml.sax.helpers.DefaultHandler-> com.itmill.toolkit.terminal.web.Theme

Theme(File)

Parameters

descriptionFile

Description file

Exceptions

FileNotFoundException

Thrown if the given file is not found.

Creates a new instance using XML description file. Instantiate new theme, by loading the description from given File.

Theme(InputStream)

Parameters

descriptionStream

XML input to parse

Creates a new instance using XML description stream. Instantiate new theme, by loading the description from given InputSource.

DESCRIPTIONFILE

Default description file name.

characters(char[], int, int)

See Also
org.xml.sax.ContentHandler.characters

Parse character data in XML stream.

endElement(String, String, String)

See Also
org.xml.sax.ContentHandler.endElement

Parse end tag in XML stream.

getAuthor()

Parameters

return

Author of the theme.

Returns the author of this theme.

getDescription()

Get theme description

getFileNames()

Parameters

return

List of filenames belonging to this theme.

Get list of all files in this theme.

getFileNames(WebBrowser, String)

Parameters

return

list of filenames in this theme supporting the given terminal.

Get list of file names matching WebBrowserType.

getName()

Parameters

return

Name of the theme.

Returns the name of this theme.

getParent()

Returns the name of the parent theme.

getPreferredMode(WebBrowser, ThemeSource)

Get the preferred operating mode supported by this theme for given terminal.

startElement(String, String, String, Attributes)

See Also
org.xml.sax.ContentHandler.startElement

Parse start tag in XML stream.

supportsMode(String, WebBrowser, ThemeSource)

Tests if this theme suppors given mode

toString()

See Also
java.lang.Object.toString

String representation of Theme object. Used for debugging purposes only.