org.norther.tammi.spray.template.skin
Interface Skin

All Known Implementing Classes:
DefaultSkin, SkinTool, UnmodifiableSkin

public interface Skin

An interface to template skins.

Version:
$Id: Skin.java,v 1.25 2010-03-04 09:48:20 cvsimp Exp $
Author:
Ilkka Priha

Nested Class Summary
static class Skin.Orientation
          The orientation.
 
Field Summary
static String BODY_ALINK
          The body alink attribute.
static String BODY_BACKGROUND
          The body background attribute.
static String BODY_BGCOLOR
          The body bgcolor attribute.
static String BODY_LINK
          The body link attribute.
static String BODY_TEXT
          The body text attribute.
static String BODY_VLINK
          The body vlink attribute.
static String HTML_XMLNS
          XMLNS html attribute.
static String META_AUTHOR
          The meta author attribute.
static String META_DESCRIPTION
          The meta description attribute.
static String META_GENERATOR
          The meta generator attribute.
static String META_KEYWORDS
          The meta keywords attribute.
static String META_REVISED
          The meta revised attribute.
static String PAGE_ID
          The page id attribute.
 
Method Summary
 void addBodyAttribute(String name, String value)
          Adds a body attribute.
 void addBodyScript(String url, boolean... localized)
          Adds a body script.
 void addHeadScript(String url, boolean... localized)
          Adds a head script.
 void addStyleSheet(String url, boolean... localized)
          Adds a style sheet.
 void appendInlineBodyScript(String script)
          Appends an inline body script.
 void appendInlineStyleSheet(String style)
          Appends an inline style sheet.
 void clearAttributes()
          Clears all page attributes.
 void clearBodyAttributes()
          Clears all body attributes.
 void clearBodyScripts()
          Clears the body scripts.
 void clearHeadScripts()
          Clears the head scripts.
 void clearInlineBodyScript()
          Clears the inline body script.
 void clearInlineStyleSheet()
          Clears the inline style sheet.
 void clearMetaElements()
          Clears all meta elements.
 void clearPluginAttributes()
          Clears all plugin attributes.
 void clearStyleSheets()
          Clears the style sheets.
 Boolean containsAttribute(String name)
          Checks whether a page attribute is set.
 Boolean containsBodyAttribute(String name)
          Checks whether a body attribute is set.
 Boolean containsBodyScript(String url)
          Checks whether a body script is contained.
 Boolean containsHeadScript(String url)
          Checks whether a head script is contained.
 Boolean containsMetaElement(String name)
          Checks whether a meta element is set.
 Boolean containsPluginAttribute(String name)
          Checks whether a plugin attribute is set.
 Boolean containsStyleSheet(String url)
          Checks whether a style sheet is contained.
 Object getAttribute(String name)
          Gets a page attribute.
 String getBaseName()
          Gets the base name for localized resources.
 String getBodyAttribute(String name)
          Gets a body attribute.
 Collection<String> getBodyScripts()
          Gets the body scripts.
 String getDocType()
          Gets the doctype.
 Collection<String> getHeadScripts()
          Gets the head scripts.
 String getInlineBodyScript()
          Gets the inline body script.
 String getInlineStyleSheet()
          Gets the inline style sheet.
 String getLabel()
          Gets the label.
 String getLink()
          Gets the link.
 Boolean getLocalized()
          Checks whether labels and URLs are localized.
 String getLogo()
          Gets the logo.
 String getMetaElement(String name)
          Gets a meta element.
 String getName()
          Gets the name.
 Skin.Orientation getOrientation()
          Gets the orientation.
 String getPluginAttribute(String name)
          Gets a plugin attribute.
 String getShortcutIcon()
          Gets the shortcut icon.
 Collection<String> getStyleSheets()
          Gets the style sheets.
 String getSubtitle()
          Gets the subtitle.
 String getTheme()
          Gets the form theme.
 String getTitle()
          Gets the title.
 String getXMLNs()
          Gets the XML namespace.
 boolean mergeAttributes(ConcurrentMap<String,Object> map)
          Merges page attributes to the specified map.
 boolean mergeBodyAttributes(ConcurrentMap<String,String> map)
          Merges body attributes to the specified map.
 boolean mergeBodyScripts(OrderedMap<String,Boolean> map, int... index)
          Merges body scripts to the specified map.
 boolean mergeHeadScripts(OrderedMap<String,Boolean> map, int... index)
          Merges head scripts to the specified map.
 boolean mergeInlineBodyScript(StringBuilder builder, int... index)
          Merges the inline body script to the specified buffer.
 boolean mergeInlineStyleSheet(StringBuilder builder, int... index)
          Merges the inline style sheet to the specified buffer.
 boolean mergeMetaElements(ConcurrentMap<String,String> map)
          Merges meta elements to the specified map.
 boolean mergePluginAttributes(ConcurrentMap<String,String> map)
          Merges plugin attributes to the specified map.
 boolean mergeStyleSheets(OrderedMap<String,Boolean> map, int... index)
          Merges style sheets to the specified map.
 void removeAttribute(String name)
          Removes a page attribute.
 void removeBodyAttribute(String name)
          Removes a body attribute.
 void removeBodyScript(String url)
          Removes a body script.
 void removeHeadScript(String url)
          Removes a head script.
 void removeMetaElement(String name)
          Removes a meta element.
 void removePluginAttribute(String name)
          Removes a plugin attribute.
 void removeStyleSheet(String url)
          Removes a style sheet.
 void setAttribute(String name, Object value)
          Sets a page attribute.
 void setBaseName(String name)
          Sets the base name for localized resources.
 void setBodyAttribute(String name, String value)
          Sets a body attribute.
 void setBodyScripts(Collection<String> c, boolean... localized)
          Sets the body scripts.
 void setDocType(String type)
          Sets the doctype.
 void setHeadScripts(Collection<String> c, boolean... localized)
          Sets the head scripts.
 void setInlineBodyScript(String script)
          Sets the inline body script.
 void setInlineStyleSheet(String style)
          Sets the inline style sheet.
 void setLabel(String label)
          Sets the label.
 void setLink(String url)
          Sets the link.
 void setLocalized(Boolean flag)
          Sets whether labels and URLs are localized.
 void setLogo(String path)
          Sets the logo.
 void setMetaElement(String name, String value)
          Sets a meta element.
 void setOrientation(Skin.Orientation o)
          Sets the orientation.
 void setPluginAttribute(String name, String value)
          Sets a plugin attribute.
 void setShortcutIcon(String url)
          Sets the shortcut icon.
 void setStyleSheets(Collection<String> c, boolean... localized)
          Sets the style sheets.
 void setSubtitle(String title)
          Sets the subtitle.
 void setTheme(String theme)
          Sets the form theme.
 void setTitle(String title)
          Sets the title.
 void setXMLNs(String ns)
          Sets the XML namespace.
 

Field Detail

META_DESCRIPTION

static final String META_DESCRIPTION
The meta description attribute.

See Also:
Constant Field Values

META_KEYWORDS

static final String META_KEYWORDS
The meta keywords attribute.

See Also:
Constant Field Values

META_AUTHOR

static final String META_AUTHOR
The meta author attribute.

See Also:
Constant Field Values

META_GENERATOR

static final String META_GENERATOR
The meta generator attribute.

See Also:
Constant Field Values

META_REVISED

static final String META_REVISED
The meta revised attribute.

See Also:
Constant Field Values

PAGE_ID

static final String PAGE_ID
The page id attribute.

See Also:
Constant Field Values

HTML_XMLNS

static final String HTML_XMLNS
XMLNS html attribute.

See Also:
Constant Field Values

BODY_BACKGROUND

static final String BODY_BACKGROUND
The body background attribute.

See Also:
Constant Field Values

BODY_BGCOLOR

static final String BODY_BGCOLOR
The body bgcolor attribute.

See Also:
Constant Field Values

BODY_TEXT

static final String BODY_TEXT
The body text attribute.

See Also:
Constant Field Values

BODY_LINK

static final String BODY_LINK
The body link attribute.

See Also:
Constant Field Values

BODY_VLINK

static final String BODY_VLINK
The body vlink attribute.

See Also:
Constant Field Values

BODY_ALINK

static final String BODY_ALINK
The body alink attribute.

See Also:
Constant Field Values
Method Detail

getName

String getName()
Gets the name.

Returns:
the name.

getLabel

String getLabel()
Gets the label.

Returns:
the label of this skin.

setLabel

void setLabel(String label)
Sets the label.

Parameters:
label - the label.

getTheme

String getTheme()
Gets the form theme.

Returns:
the name of the form theme.

setTheme

void setTheme(String theme)
Sets the form theme.

Parameters:
theme - the name of the form theme.

getLocalized

Boolean getLocalized()
Checks whether labels and URLs are localized.

Returns:
true if localized, false if not, null to continue search.

setLocalized

void setLocalized(Boolean flag)
Sets whether labels and URLs are localized.

Parameters:
flag - true for localized labels, false otherwise.

getBaseName

String getBaseName()
Gets the base name for localized resources.

Returns:
the base name of the resource bundle or null.

setBaseName

void setBaseName(String name)
Sets the base name for localized resources.

Parameters:
name - the base name of the resource bundle.

getDocType

String getDocType()
Gets the doctype.

Returns:
the doctype or null.

setDocType

void setDocType(String type)
Sets the doctype.

Parameters:
type - the doctype.

getXMLNs

String getXMLNs()
Gets the XML namespace.

Returns:
the namespace or null.

setXMLNs

void setXMLNs(String ns)
Sets the XML namespace.

Parameters:
ns - the namespace.

getLink

String getLink()
Gets the link.

Returns:
the URL of the link or null.

setLink

void setLink(String url)
Sets the link.

Parameters:
url - the URL of the link.

getLogo

String getLogo()
Gets the logo.

Returns:
the path of the logo or null.

setLogo

void setLogo(String path)
Sets the logo.

Parameters:
path - the path of the logo.

getTitle

String getTitle()
Gets the title.

Returns:
the title or null.

setTitle

void setTitle(String title)
Sets the title.

Parameters:
title - the title.

getSubtitle

String getSubtitle()
Gets the subtitle.

Returns:
the subtitle or null.

setSubtitle

void setSubtitle(String title)
Sets the subtitle.

Parameters:
title - the subtitle.

getOrientation

Skin.Orientation getOrientation()
Gets the orientation.

Returns:
the orientation.

setOrientation

void setOrientation(Skin.Orientation o)
Sets the orientation.

Parameters:
o - the orientation.

getHeadScripts

Collection<String> getHeadScripts()
Gets the head scripts.

Note that only local scripts are included, apply the merge method to get inherited scripts also.

Returns:
a read-only collection of URLs of the head scripts or null.

setHeadScripts

void setHeadScripts(Collection<String> c,
                    boolean... localized)
Sets the head scripts.

Note that inherited scripts are prohibited after set, apply the add method to keep the inherited scripts.

Parameters:
c - a collection of URLs of the head scripts.
localized - true if localized, false otherwise.

addHeadScript

void addHeadScript(String url,
                   boolean... localized)
Adds a head script.

Parameters:
url - the URL of the head script.
localized - true if localized, false otherwise.

containsHeadScript

Boolean containsHeadScript(String url)
Checks whether a head script is contained.

Parameters:
url - the URL of the head script.
Returns:
true if contained, false if not, null to continue search.

removeHeadScript

void removeHeadScript(String url)
Removes a head script.

Parameters:
url - the URL of the head script.

clearHeadScripts

void clearHeadScripts()
Clears the head scripts.

Note that only local scripts are cleared and inherited scripts are applied after clear.


mergeHeadScripts

boolean mergeHeadScripts(OrderedMap<String,Boolean> map,
                         int... index)
Merges head scripts to the specified map.

Parameters:
map - the script map.
index - the insertion index.
Returns:
true to continue merging, false to break.

getBodyScripts

Collection<String> getBodyScripts()
Gets the body scripts.

Note that only local scripts are included, apply the merge method to get inherited scripts also.

Returns:
a read-only collection of URLs of the body scripts or null.

setBodyScripts

void setBodyScripts(Collection<String> c,
                    boolean... localized)
Sets the body scripts.

Note that inherited scripts are prohibited after set, apply the add method to keep the inherited scripts.

Parameters:
c - a collection of URLs of the body scripts.
localized - true if localized, false otherwise.

addBodyScript

void addBodyScript(String url,
                   boolean... localized)
Adds a body script.

Parameters:
url - the URL of the body script.
localized - true if localized, false otherwise.

containsBodyScript

Boolean containsBodyScript(String url)
Checks whether a body script is contained.

Parameters:
url - the URL of the body script.
Returns:
true if contained, false if not, null to continue search.

removeBodyScript

void removeBodyScript(String url)
Removes a body script.

Parameters:
url - the URL of the body script.

clearBodyScripts

void clearBodyScripts()
Clears the body scripts.

Note that only local scripts are cleared and inherited scripts are applied after clear.


mergeBodyScripts

boolean mergeBodyScripts(OrderedMap<String,Boolean> map,
                         int... index)
Merges body scripts to the specified map.

Parameters:
map - the script map.
index - the insertion index.
Returns:
true to continue merging, false to break.

getInlineBodyScript

String getInlineBodyScript()
Gets the inline body script.

Note that only local scripts are included, apply the merge method to get inherited scripts, too.

Returns:
the inline body script or null.

setInlineBodyScript

void setInlineBodyScript(String script)
Sets the inline body script.

Note that inherited scripts are prohibited after set, apply the append method to keep the inherited scripts.

Parameters:
script - the inline body script.

appendInlineBodyScript

void appendInlineBodyScript(String script)
Appends an inline body script.

Parameters:
script - the inline body script.

clearInlineBodyScript

void clearInlineBodyScript()
Clears the inline body script.

Note that only local scripts are cleared and inherited scripts are applied after clear.


mergeInlineBodyScript

boolean mergeInlineBodyScript(StringBuilder builder,
                              int... index)
Merges the inline body script to the specified buffer.

Parameters:
builder - the body script.
index - the insertion index.
Returns:
true to continue merging, false to break.

getStyleSheets

Collection<String> getStyleSheets()
Gets the style sheets.

Note that only local styles are included, apply the merge method to get inherited styles, too.

Returns:
a read-only collection of URLs of the style sheets or null.

setStyleSheets

void setStyleSheets(Collection<String> c,
                    boolean... localized)
Sets the style sheets.

Note that inherited styles are prohibited after set, apply the add method to keep the inherited styles.

Parameters:
c - a collection of URLs of the style sheets.
localized - true if localized, false otherwise.

addStyleSheet

void addStyleSheet(String url,
                   boolean... localized)
Adds a style sheet.

Parameters:
url - the URL of the style sheet.
localized - true if localized, false otherwise.

containsStyleSheet

Boolean containsStyleSheet(String url)
Checks whether a style sheet is contained.

Parameters:
url - the URL of the style sheet.
Returns:
true if contained, false if not, null to continue search.

removeStyleSheet

void removeStyleSheet(String url)
Removes a style sheet.

Parameters:
url - the URL of the style sheet.

clearStyleSheets

void clearStyleSheets()
Clears the style sheets.

Note that only local styles are cleared and inherited styles are applied after clear.


mergeStyleSheets

boolean mergeStyleSheets(OrderedMap<String,Boolean> map,
                         int... index)
Merges style sheets to the specified map.

Parameters:
map - the style map.
index - the insertion index.
Returns:
true to continue merging, false to break.

getInlineStyleSheet

String getInlineStyleSheet()
Gets the inline style sheet.

Note that only local styles are included, apply the merge method to get inherited styles, too.

Returns:
the inline style sheet or null.

setInlineStyleSheet

void setInlineStyleSheet(String style)
Sets the inline style sheet.

Note that inherited styles are prohibited after set, apply the append method to keep the inherited styles.

Parameters:
style - the inline style sheet.

appendInlineStyleSheet

void appendInlineStyleSheet(String style)
Appends an inline style sheet.

Parameters:
style - the inline style sheet.

clearInlineStyleSheet

void clearInlineStyleSheet()
Clears the inline style sheet.

Note that only local styles are cleared and inherited styles are applied after clear.


mergeInlineStyleSheet

boolean mergeInlineStyleSheet(StringBuilder builder,
                              int... index)
Merges the inline style sheet to the specified buffer.

Parameters:
builder - the style buffer.
index - the insertion index.
Returns:
true to continue merging, false to break.

getShortcutIcon

String getShortcutIcon()
Gets the shortcut icon.

Returns:
the URL of the icon or null.

setShortcutIcon

void setShortcutIcon(String url)
Sets the shortcut icon.

Parameters:
url - the URL of the icon.

getMetaElement

String getMetaElement(String name)
Gets a meta element.

Parameters:
name - the name of the element.
Returns:
the value of the element or null.

setMetaElement

void setMetaElement(String name,
                    String value)
Sets a meta element.

Parameters:
name - the name of the element.
value - the value of the element.

containsMetaElement

Boolean containsMetaElement(String name)
Checks whether a meta element is set.

Parameters:
name - the element name.
Returns:
true if set, false if not, null to continue search.

removeMetaElement

void removeMetaElement(String name)
Removes a meta element.

Parameters:
name - the name of the element.

clearMetaElements

void clearMetaElements()
Clears all meta elements.


mergeMetaElements

boolean mergeMetaElements(ConcurrentMap<String,String> map)
Merges meta elements to the specified map.

Parameters:
map - the element map.
Returns:
true to continue merging, false to break.

getBodyAttribute

String getBodyAttribute(String name)
Gets a body attribute.

Parameters:
name - the name of the attribute.
Returns:
the value of the attribute or null.

setBodyAttribute

void setBodyAttribute(String name,
                      String value)
Sets a body attribute.

Parameters:
name - the name of the attribute.
value - the value of the attribute.

addBodyAttribute

void addBodyAttribute(String name,
                      String value)
Adds a body attribute.

The body attribute is supposed to support values separated by semicolons.

Parameters:
name - the name of the attribute.
value - the value of the attribute.

containsBodyAttribute

Boolean containsBodyAttribute(String name)
Checks whether a body attribute is set.

Parameters:
name - the attribute name.
Returns:
true if set, false if not, null to continue search.

removeBodyAttribute

void removeBodyAttribute(String name)
Removes a body attribute.

Parameters:
name - the name of the attribute.

clearBodyAttributes

void clearBodyAttributes()
Clears all body attributes.


mergeBodyAttributes

boolean mergeBodyAttributes(ConcurrentMap<String,String> map)
Merges body attributes to the specified map.

Parameters:
map - the attribute map.
Returns:
true to continue merging, false to break.

getPluginAttribute

String getPluginAttribute(String name)
Gets a plugin attribute.

Parameters:
name - the name of the plugin.
Returns:
the plugin attribute or null.

setPluginAttribute

void setPluginAttribute(String name,
                        String value)
Sets a plugin attribute.

Parameters:
name - the name of the plugin.
value - the plugin attribute.

containsPluginAttribute

Boolean containsPluginAttribute(String name)
Checks whether a plugin attribute is set.

Parameters:
name - the plugin name.
Returns:
true if set, false if not, null to continue search.

removePluginAttribute

void removePluginAttribute(String name)
Removes a plugin attribute.

Parameters:
name - the name of the plugin.

clearPluginAttributes

void clearPluginAttributes()
Clears all plugin attributes.


mergePluginAttributes

boolean mergePluginAttributes(ConcurrentMap<String,String> map)
Merges plugin attributes to the specified map.

Parameters:
map - the attribute map.
Returns:
true to continue merging, false to break.

getAttribute

Object getAttribute(String name)
Gets a page attribute.

Parameters:
name - the name of the attribute.
Returns:
the value of the attribute or null.

setAttribute

void setAttribute(String name,
                  Object value)
Sets a page attribute.

Parameters:
name - the name of the attribute.
value - the value of the attribute.

containsAttribute

Boolean containsAttribute(String name)
Checks whether a page attribute is set.

Parameters:
name - the attribute name.
Returns:
true if set, false if not, null to continue search.

removeAttribute

void removeAttribute(String name)
Removes a page attribute.

Parameters:
name - the name of the attribute.

clearAttributes

void clearAttributes()
Clears all page attributes.


mergeAttributes

boolean mergeAttributes(ConcurrentMap<String,Object> map)
Merges page attributes to the specified map.

Parameters:
map - the attribute map.
Returns:
true to continue merging, false to break.


Copyright © 2004 The Norther Organization. All rights reserved.