Package com.atlassian.confluence.themes
Class DefaultTheme
- java.lang.Object
-
- com.atlassian.confluence.themes.DefaultTheme
-
-
Field Summary
Fields Modifier and Type Field Description static String
MODULE_KEY
static String
PLUGIN_KEY
static String
STYLESHEET_MODULE_KEY
static String
STYLESHEET_NAME
static String
TOP_NAV_LOCATION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBodyClass()
Returns the class for the body element specified by the theme.ColourScheme
getColourScheme()
Returns null because this object doesn't represent a colour scheme.ThemedDecorator
getDecorator(String path)
Returns null because this object doesn't attempt to list the default decorators, which are still loaded directly from the classpath.static Theme
getInstance()
Collection<? extends ThemeResource>
getJavascript()
Return the JavaScript resources for the theme.String
getModuleKey()
Returns the module key of the theme plugin module, or null if this theme doesn't come from a plugin.String
getPluginKey()
Return the key of the plugin which includes this theme.Collection<? extends ThemeResource>
getStylesheets()
Return the stylesheets for the theme.String
getTopNavLocation()
Returns the location of the Velocity file which renders the top navigation.String
getXworkVelocityPath(String packageName, String actionName, String result, String template)
If this theme defines any specific overrides for Velocity XWork results, process them through here.boolean
hasSpaceSideBar()
Tells whether this theme requires rendering of the Space IA sidebar.void
init(ThemeModuleDescriptor moduleDescriptor)
Initialise the theme details from the given theme module descriptor.boolean
isDisableSitemesh()
If this flag returns true, all requests for sitemesh templates w.r.t this theme will return NoDecorator, leading to a total bypassing of the sitemesh-based theme system.
-
-
-
Field Detail
-
STYLESHEET_NAME
public static final String STYLESHEET_NAME
- See Also:
- Constant Field Values
-
PLUGIN_KEY
public static final String PLUGIN_KEY
- See Also:
- Constant Field Values
-
MODULE_KEY
public static final String MODULE_KEY
- See Also:
- Constant Field Values
-
STYLESHEET_MODULE_KEY
public static final String STYLESHEET_MODULE_KEY
- See Also:
- Constant Field Values
-
TOP_NAV_LOCATION
public static final String TOP_NAV_LOCATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getColourScheme
public ColourScheme getColourScheme()
Returns null because this object doesn't represent a colour scheme. All callers assume a null colour scheme means use the custom colour scheme for a particular space, which is the correct behaviour.- Specified by:
getColourScheme
in interfaceTheme
-
getDecorator
public ThemedDecorator getDecorator(String path)
Returns null because this object doesn't attempt to list the default decorators, which are still loaded directly from the classpath.- Specified by:
getDecorator
in interfaceTheme
-
getStylesheets
public Collection<? extends ThemeResource> getStylesheets()
Description copied from interface:Theme
Return the stylesheets for the theme.- Specified by:
getStylesheets
in interfaceTheme
- Returns:
- a Collection of
ThemeResource
s representing custom stylesheets for this theme, or an empty list if none exist.
-
getJavascript
public Collection<? extends ThemeResource> getJavascript()
Description copied from interface:Theme
Return the JavaScript resources for the theme.- Specified by:
getJavascript
in interfaceTheme
- Returns:
- a Collection of
ThemeResource
s representing custom JavaScript for this theme, or an empty list if none exist.
-
init
public void init(ThemeModuleDescriptor moduleDescriptor)
Description copied from interface:Theme
Initialise the theme details from the given theme module descriptor.
-
getPluginKey
public String getPluginKey()
Description copied from interface:Theme
Return the key of the plugin which includes this theme. May return null if the theme doesn't come from a plugin.- Specified by:
getPluginKey
in interfaceTheme
-
getModuleKey
public String getModuleKey()
Description copied from interface:Theme
Returns the module key of the theme plugin module, or null if this theme doesn't come from a plugin.- Specified by:
getModuleKey
in interfaceTheme
-
getInstance
public static Theme getInstance()
-
isDisableSitemesh
public boolean isDisableSitemesh()
Description copied from interface:Theme
If this flag returns true, all requests for sitemesh templates w.r.t this theme will return NoDecorator, leading to a total bypassing of the sitemesh-based theme system.- Specified by:
isDisableSitemesh
in interfaceTheme
- Returns:
- true if this theme wants to turn off sitemesh
-
getXworkVelocityPath
public String getXworkVelocityPath(String packageName, String actionName, String result, String template)
Description copied from interface:Theme
If this theme defines any specific overrides for Velocity XWork results, process them through here.- Specified by:
getXworkVelocityPath
in interfaceTheme
- Parameters:
packageName
- the package name of the action being runactionName
- the name of the action being runresult
- the result string of the action being runtemplate
- the Velocity template path the action wants to process- Returns:
- the Velocity template path the action should process, with any overrides applied
-
getBodyClass
public String getBodyClass()
Description copied from interface:Theme
Returns the class for the body element specified by the theme.- Specified by:
getBodyClass
in interfaceTheme
-
getTopNavLocation
public String getTopNavLocation()
Description copied from interface:Theme
Returns the location of the Velocity file which renders the top navigation.- Specified by:
getTopNavLocation
in interfaceTheme
-
hasSpaceSideBar
public boolean hasSpaceSideBar()
Description copied from interface:Theme
Tells whether this theme requires rendering of the Space IA sidebar. The Space IA side bar is the one on the left, which contains a tree view of pages, a chronological view of the blogs, and so on.Recommended value: false for themes that don't require rendering of the Space IA sidebar, true otherwise. This value is true for the default theme starting from Confluence 5.0.
- Specified by:
hasSpaceSideBar
in interfaceTheme
- Returns:
- whether this theme needs rendering of the Space IA side bar.
-
-