Java Doc for Theme.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » theme » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.theme 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.rave.web.ui.theme.Theme

Theme
public class Theme (Code)

The Theme class is responsible for managing application resources such as style sheets, JavaScript files and message files.

Theme resources are delived in the form of Jar files which are placed in the classpath of the application or of the Servlet container. Themes must include a file called META-INF/swc_theme.properties which describe the resources available to the theme.

To configure the default Theme to be used by an application, ensure that the theme jar is the application's classpath and configure the application's deployment descriptor to set the context parameter com.sun.rave.web.ui.DEFAULT_THEME to the Theme's name.

If you need to add additional locale support, you have two options:

  • If your application only uses a single Theme, you can find out what the message file for the Theme is called and provide a message file for your locale using the same namebase in the application's classpath. The usual fallback mechanism will apply.
  • If your application uses multiple Themes, you can specify an alternative message file to be used by all Themes using the context parameter com.sun.rave.web.ui.MESSAGES. The themes will attempt to retrieve messages from the bundle(s) of this basename first. If the message key does not resolve, the Theme's default bundles are used instead.


Field Summary
final public static  StringRESOURCE_PATH_ATTR
     The context parameter name used to specify a console path, if one is used.
final public static  StringTHEME_ATTR
    

Constructor Summary
public  Theme(Locale locale)
    

Method Summary
protected  voidconfigureClassMapper(ResourceBundle classMapper)
     Configures a resource bundle which overrides the standard keys for retrieving style class names.
protected  voidconfigureImages(ResourceBundle imageResources)
    

Configures the image resource bundle.


Parameters:
  imageResources - A ResourceBundle whose keys specify the available images.
protected  voidconfigureJSFiles(ResourceBundle jsFiles)
    
protected  voidconfigureMessages(ResourceBundle base, ResourceBundle override)
    

Configures the message bundles.

protected  voidconfigureStylesheets(ResourceBundle stylesheets)
    
public  String[]getGlobalJSFiles()
    
public  String[]getGlobalStylesheets()
    
public  IcongetIcon(String identifier)
    
public  StringgetMessage(String key)
     Retrieves a message from the appropriate ResourceBundle. If the web application specifies a bundle that overrides the standard bundle, that one is tried first.
public  StringgetMessage(String key, Object[] params)
     Retrieves a message from the appropriate ResourceBundle. If the web application specifies a bundle that overrides the standard bundle, that one is tried first.
public  StringgetPathToJSFile(String key)
    
public  StringgetPathToMasterStylesheet()
    
public  StringgetPathToStylesheet(FacesContext context)
    
public  StringgetPathToStylesheet(String clientName)
    
public  StringgetStyleClass(String name)
     Returns the name of a CSS style.
public  voidinitializePath(ServletContext context, HttpServletRequest request)
    
protected  voidsetPrefix(String p)
    

Field Detail
RESOURCE_PATH_ATTR
final public static String RESOURCE_PATH_ATTR(Code)
The context parameter name used to specify a console path, if one is used.



THEME_ATTR
final public static String THEME_ATTR(Code)
Attribute name used to store the user's theme name in the Session




Constructor Detail
Theme
public Theme(Locale locale)(Code)




Method Detail
configureClassMapper
protected void configureClassMapper(ResourceBundle classMapper)(Code)
Configures a resource bundle which overrides the standard keys for retrieving style class names.
Parameters:
  classMapper - A ResourceBundle that overrides the standard styleclass keys



configureImages
protected void configureImages(ResourceBundle imageResources)(Code)

Configures the image resource bundle.


Parameters:
  imageResources - A ResourceBundle whose keys specify the available images.



configureJSFiles
protected void configureJSFiles(ResourceBundle jsFiles)(Code)

Configures the JS resource files.


Parameters:
  jsFiles - A ResourceBundle whose keys specify the available JavaScript files



configureMessages
protected void configureMessages(ResourceBundle base, ResourceBundle override)(Code)

Configures the message bundles. All Themes must contain a default ResourceBundle for messages, which is configured in the Theme configuration file. This bundle is passed in as the first parameter (base).

Optionally, the web application developer can override the messages from all themes by specifying a resource bundle in a context init parameter (if they haven't done so, the second parameter will be null). If the second parameter is non-null, Theme.getMessage tries to get the message from the override bundle first. If that fails (or if there is no override bundle), getMessage() tries the base bundle.


Parameters:
  base - The message bundle specified by the Theme configuration file.
Parameters:
  override - A message bundle configured by the userin a context parameter, to override messages from the base bundle.



configureStylesheets
protected void configureStylesheets(ResourceBundle stylesheets)(Code)

Configures the stylesheets.


Parameters:
  stylesheets - A resource bundle specifying the stylesheet foreach @link ClientType



getGlobalJSFiles
public String[] getGlobalJSFiles()(Code)
Use this method to retrieve a String array of URIs to the JavaScript files that should be included with all pages of this application String array of URIs to the JavaScript files



getGlobalStylesheets
public String[] getGlobalStylesheets()(Code)
Use this method to retrieve a String array of URIs to the CSS stylesheets files that should be included with all pages of this application String array of URIs to the stylesheets



getIcon
public Icon getIcon(String identifier)(Code)



getMessage
public String getMessage(String key)(Code)
Retrieves a message from the appropriate ResourceBundle. If the web application specifies a bundle that overrides the standard bundle, that one is tried first. If no override bundle is specified, or if the bundle does not contain the key, the key is resolved from the Theme's default bundle.
Parameters:
  key - The key used to retrieve the message A localized message string



getMessage
public String getMessage(String key, Object[] params)(Code)
Retrieves a message from the appropriate ResourceBundle. If the web application specifies a bundle that overrides the standard bundle, that one is tried first. If no override bundle is specified, or if the bundle does not contain the key, the key is resolved from the Theme's default bundle.
Parameters:
  key - The key used to retrieve the message
Parameters:
  params - An object array specifying the parameters ofthe message A localized message string



getPathToJSFile
public String getPathToJSFile(String key)(Code)
Returns a String that represents a valid path to the JavaScript file corresponding to the key Returns a String that represents a valid path to the JavaScriptfile corresponding to the key
Parameters:
  key - Key to retrieve the javascript file



getPathToMasterStylesheet
public String getPathToMasterStylesheet()(Code)
Returns a String that represents a valid path to the CSS stylesheet corresponding to the key A String that represents a valid path to the CSS stylesheetcorresponding to the key



getPathToStylesheet
public String getPathToStylesheet(FacesContext context)(Code)
Returns a String that represents a valid path to the CSS stylesheet corresponding to the key
Parameters:
  context - FacesContext of the request A String that represents a valid path to the CSS stylesheetcorresponding to the key



getPathToStylesheet
public String getPathToStylesheet(String clientName)(Code)
Returns a String that represents a valid path to the CSS stylesheet corresponding to the key A String that represents a valid path to the CSS stylesheetcorresponding to the key



getStyleClass
public String getStyleClass(String name)(Code)
Returns the name of a CSS style. If the Theme includes a class mapper, the method checks it for the presence of a mapping for the CSS class name passed in with the argument. If there is no mapping, the name is used as is. up in the class mapper if there is one, a valid path to the CSS stylesheet corresponding to the key
Parameters:
  name - The style class name to be used the name of a CSS style.



initializePath
public void initializePath(ServletContext context, HttpServletRequest request)(Code)



setPrefix
protected void setPrefix(String p)(Code)
Sets the prefix to be prepended to the path names of the resources
Parameters:
  p - prefix for all URIs in the theme



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.