|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.itmill.toolkit.terminal.web.Theme
public 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:
The theme description is XML data, and it can be loaded from file or stream.
The default filename is specified by Theme.DESCRIPTIONFILE.
| Nested Class Summary | |
|---|---|
class |
Theme.AgentRequirement
HTTP user agent requirement This requirements is used to ensure that the User-Agent string provided in HTTP request headers contains given substring. |
class |
Theme.AndRequirement
Logical AND requirement. |
class |
Theme.Author
Author information class. |
class |
Theme.File
Theme XSL file description Description of a single XSL file included a theme. |
class |
Theme.Fileset
A recursive set of files sharing the same requirements. |
class |
Theme.JavaScriptRequirement
Javascript version requirement This requirement is used to ensure a certain level of JavaScript version support. |
class |
Theme.MarkupLanguageRequirement
Markup language version requirement. |
class |
Theme.NotRequirement
Logical NOT requirement. |
class |
Theme.OrRequirement
Logical OR requirement. |
static interface |
Theme.Requirement
Generic requirement. |
static interface |
Theme.RequirementCollection
Generic requirement collection interface. |
| Field Summary | |
|---|---|
static String |
DESCRIPTIONFILE
Default description file name. |
static String |
MESSAGE_CONFIGURE_HELP
|
static String |
MODE_AJAX
|
static String |
MODE_FALLBACK
|
static String |
MODE_HTML
|
| Constructor Summary | |
|---|---|
Theme(File descriptionFile)
Creates a new instance using XML description file. |
|
Theme(InputStream descriptionStream)
Creates a new instance using XML description stream. |
|
| Method Summary | |
|---|---|
void |
characters(char[] data,
int start,
int length)
Parses the character data in XML stream. |
void |
endElement(String namespaceURI,
String localName,
String qName)
Parses the end tag in XML stream. |
Theme.Author |
getAuthor()
Gets the author of this theme. |
String |
getDescription()
Gets the theme description. |
List |
getFileNames()
Gets the list of all files in this theme. |
List |
getFileNames(WebBrowser terminal,
String mode)
Gets the list of file names matching WebBrowserType. |
String |
getName()
Gets the name of this theme. |
String |
getParent()
Gets the name of the parent theme. |
String |
getPreferredMode(WebBrowser terminal,
ThemeSource themeSource)
Gets the preferred operating mode supported by this theme for given terminal. |
void |
startElement(String uri,
String local,
String qName,
Attributes atts)
Parses start tag in XML stream. |
boolean |
supportsMode(String mode,
WebBrowser terminal,
ThemeSource themeSource)
Tests if this theme suppors given mode. |
String |
toString()
String representation of Theme object. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DESCRIPTIONFILE
public static final String MODE_AJAX
public static final String MODE_HTML
public static final String MODE_FALLBACK
public static final String MESSAGE_CONFIGURE_HELP
| Constructor Detail |
|---|
public Theme(File descriptionFile)
throws FileNotFoundException
descriptionFile - the Description file.
FileNotFoundException - Thrown if the given file is not found.public Theme(InputStream descriptionStream)
descriptionStream - the XML input to parse| Method Detail |
|---|
public String getPreferredMode(WebBrowser terminal,
ThemeSource themeSource)
terminal - the type of the web browser.themeSource -
public boolean supportsMode(String mode,
WebBrowser terminal,
ThemeSource themeSource)
mode - terminal - the type of the web browser.themeSource -
public void startElement(String uri,
String local,
String qName,
Attributes atts)
startElement in interface ContentHandlerstartElement in class DefaultHandlerContentHandler.startElement(java.lang.String,
java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionContentHandler.endElement(String, String, String)
public void characters(char[] data,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerContentHandler.characters(char[], int, int)public List getFileNames()
public List getFileNames(WebBrowser terminal,
String mode)
terminal - the type of the web browser.mode -
public String toString()
toString in class ObjectObject.toString()public Theme.Author getAuthor()
public String getName()
public String getParent()
public String getDescription()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||