Java Doc for Theme.java in  » Development » ivatamasks » com » ivata » mask » web » 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 » Development » ivatamasks » com.ivata.mask.web.theme 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ivata.mask.web.theme.Theme

Theme
public class Theme extends Object (Code)

This class defines an interface to providing themes. In ivata op, themes are used for most HTML elements. The HTML itself is all located in one file, which uses tags to call this class and set the theme sections

These sections usually correspond to either a whole tag or the start and end of a tag in the iiWebGUI tag library.

This class stores all of these HTML sections. What's more, it provides parsing routines for dynamically applying attributes and properties within the HTML of any section. This in turn interacts with the code of iiWebGUI and the JSP files to customize the end result.


since:
   ivata masks 0.4 (2001-10-28)
author:
   Colin MacLeod
author:
   colin.macleod@ivata.com
version:
   $Revision: 1.4 $
See Also:   com.ivata.mask.web.tag.theme



Constructor Summary
public  Theme(String nameParam)
    

Creates new Theme with the name provided.


Method Summary
final public  StringcheckSection(String checkParam)
    

Check that a section is set.

final public  PropertiesgetDefaultProperties()
    

Stores all the default properties used by this theme.

final public  StringgetDefaultProperty(String property)
    

Get a single default property used in the theme.

final public  StringgetName()
    

This field identifies the theme.

final public  StringgetSection(String nameParam)
    

Gets a section to be used in a WebGUI tag.

Note that this method does not parse the section.

final public  PropertiesgetSectionProperties()
    

Stores all the sections held by this Theme.

final public  Stringparse(String textParam, Properties propertiesParam)
    

Works like parseSection but operates on a section text you provide, rather than taking one of the sections defined in this class instance.

final public  StringparseSection(String nameParam, Properties propertiesParam)
    

Parse a string by replacing all the properties and attributes.

This routine looks for Properties with the format PROPERTY(name).

final public  voidsetDefaultProperties(Properties defaultPropertiesParam)
    

Stores all the default properties used by this theme.

final public  voidsetDefaultProperty(String propertyParam, String valueParam)
    

Set a single default property used in the theme.

final public  voidsetName(String nameParam)
    

This field identifies the theme.

final public  voidsetSection(String nameParam, String textParam)
    

Set a section to be used in your theme.

Called from the theme:section tag

By convention, sections are named after the tags they are used in.

final public  voidsetSectionProperties(Properties sectionPropertiesParam)
    

Stores all the sections held by this Theme.



Constructor Detail
Theme
public Theme(String nameParam)(Code)

Creates new Theme with the name provided.

You may create several themes within one WebApp to create multiple window styles, for example.


Parameters:
  nameParam - this name defines this theme




Method Detail
checkSection
final public String checkSection(String checkParam)(Code)

Check that a section is set. If the section has been defined, then return the value which was defined. Otherwise throw a ThemeUnsupportedException.


Parameters:
  checkParam - the name of the section to check the section text, if the section has been set. Otherwise null.
See Also:   Theme.getSection(String name)



getDefaultProperties
final public Properties getDefaultProperties()(Code)

Stores all the default properties used by this theme.

the current value of defaultProperties.



getDefaultProperty
final public String getDefaultProperty(String property)(Code)

Get a single default property used in the theme. These properties are used when the theme text is parsed.


Parameters:
  property - the name of the property the default Value for the property
See Also:   Theme.parse(String text,Properties properties)
See Also:   Theme.parseSection(String name,Properties properties)



getName
final public String getName()(Code)

This field identifies the theme. You can have multiple themes within one WebApp to allow for multiple window styles, for example.

the current value of name.
See Also:   Theme.Theme(String name)



getSection
final public String getSection(String nameParam)(Code)

Gets a section to be used in a WebGUI tag.

Note that this method does not parse the section. For parsing, look at the parseSection method.


Parameters:
  nameParam - the name of the section you want to retrieve the section text matching the name if one exists, otherwisenull.
See Also:   Theme.parseSection
See Also:   Theme.checkSection



getSectionProperties
final public Properties getSectionProperties()(Code)

Stores all the sections held by this Theme.

the current value of sectionProperties.



parse
final public String parse(String textParam, Properties propertiesParam)(Code)

Works like parseSection but operates on a section text you provide, rather than taking one of the sections defined in this class instance.


Parameters:
  textParam - the text of the section to parse forPROPERTY or ATTRIBUTE strings
Parameters:
  propertiesParam - the properties to use when evaluatingPROPERTY or ATTRIBUTE strings a parsed string where all instances of PROPERTY orATTRIBUTE are replaced as appropriate, or an empty stringif this section has not been defined.
See Also:   Theme.parseSection
See Also:   Theme.getSection



parseSection
final public String parseSection(String nameParam, Properties propertiesParam)(Code)

Parse a string by replacing all the properties and attributes.

This routine looks for Properties with the format PROPERTY(name). These will be replaced with the value of the property provided from the supplied properties instance ( properties.get("name")).

The routine also identifies attributes, identified by the format string ATTRIBUTE({name:}attribute{,default}).

In this case {name:} is an optional name (which defaults to the attribute name, if it is not supplied. This format string will be replaced by setting the attribute with the given name to properties.get("name"), if name was supplied, or properties.get("attribute"), if it wasn't.

For an attribute, there is also the optional default parameter, which is separated from the attribute name by a comma. This value will be used, quoted, if the property was not set.

example

This is best illustrated by means of example. Consider the following theme section called "myFirstTag". This must have been set separately in the theme JSP file, using the com.ivata.mask.web.tag.theme.SectionTag <theme:section>tag .

<table ATTRIBUTE(cellpadding) ATTRIBUTE(width:cellspacing) border=(border,0)>
  <tr>
    <td>
PROPERTY(text)</td>
  </tr>
</table>

Now look at the following Java code:

Properties properties = new Properties();
properties.set("width", 10);
properties.set("text", "This is an output test text.");
String sMyFirstTag = theme.parse("myFirstTag", properties);

At this point, sMyFirstTag will contain:

<table cellspacing='10' border='0'>
  <tr>
    <td>
This is an output test text.</td>
  </tr>
</table>


Parameters:
  nameParam - the name of the section text to parse forPROPERTY or ATTRIBUTE strings
Parameters:
  propertiesParam - the properties to use when evaluatingPROPERTY or ATTRIBUTE strings a parsed string where all instances of PROPERTY orATTRIBUTE are replaced as appropriate, or an emptystring if this section has not been defined.
See Also:   Theme.getSection(String name)
See Also:   Theme.parse(String text,Properties properties)



setDefaultProperties
final public void setDefaultProperties(Properties defaultPropertiesParam)(Code)

Stores all the default properties used by this theme.


Parameters:
  defaultPropertiesParam - the new value of defaultProperties.



setDefaultProperty
final public void setDefaultProperty(String propertyParam, String valueParam)(Code)

Set a single default property used in the theme. These properties are used when the theme text is parsed.


Parameters:
  propertyParam - the name of the property
Parameters:
  valueParam - the default Value for the property
See Also:   Theme.parse(String text,Properties properties)
See Also:   Theme.parseSection(String name,Properties properties)



setName
final public void setName(String nameParam)(Code)

This field identifies the theme. You can have multiple themes within one WebApp to allow for multiple window styles, for example.


See Also:   Theme.Theme(String name)
Parameters:
  nameParam - the new value of name.



setSection
final public void setSection(String nameParam, String textParam)(Code)

Set a section to be used in your theme.

Called from the theme:section tag

By convention, sections are named after the tags they are used in. If your empty tag is called tagName, the section for your tag should be called just that: "tagName".

If, on the other hand, your tag has a body, then you will need two sections. Call the first "tagNameStart" (comes before the body) and "tagNameEnd" (comes after the body.


Parameters:
  nameParam - the name of the section you want to define. Overrides anyprevious section with the same name
Parameters:
  textParam - the section text



setSectionProperties
final public void setSectionProperties(Properties sectionPropertiesParam)(Code)

Stores all the sections held by this Theme.


Parameters:
  sectionPropertiesParam - the new value of sectionProperties.



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.