Java Doc for RendererUtil.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » jsf » util » 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 » ERP CRM Financial » sakai » org.sakaiproject.jsf.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.sakaiproject.jsf.util.RendererUtil

RendererUtil
public class RendererUtil (Code)
Common static utility methods that help in implementing JSF tags.




Method Summary
public static  voidencodeRecursive(FacesContext context, UIComponent component)
     Helper method for recursively encoding a component.
public static  ObjectgetAttribute(FacesContext context, UIComponent component, String name)
     Return the attribute value - handles getting the value from a ValueBinding if necessary.
public static  ObjectgetDefaultedAttribute(FacesContext context, UIComponent component, String name, Object defaultValue)
     Same as getAttribute, but if not found, we return a default value.
public static  StringgetFormId(FacesContext context, UIComponent component)
    
public static  booleanisDisabledOrReadonly(FacesContext context, UIComponent component)
     If renderer supports disabled or readonly attributes use this method to obtain an early exit from decode method.
public static  StringmakeSwitchString(String rawSwitch, boolean supportOnOff, boolean supportTrueFalse, boolean supportYesNo, boolean returnOnOff, boolean returnYesNo, boolean defaultValue)
     Switch handling utility.
public static  MapmapComponentAttributes(Collection collection, UIComponent component)
    
public static  MapmapComponentAttributes(String[] attributeNames, UIComponent component)
    
public static  voidrenderMenu(ResponseWriter out, List items, int selected, String clientId, String styleClass, UIComponent component)
    
public static  voidsetAttribute(FacesContext context, UIComponent component, String name, Object value)
     Sets component attribute value - if a ValueBinding exists for that attribute, set through the binding; otherwise, set the value directly on the component.
public static  voidwriteAttr(Writer inWriter, String inAttr, String inAttrValue)
    
public static  voidwriteAttributes(Map attributeMap, ResponseWriter writer)
    
public static  voidwriteAttributes(Map attributeMap, FacesContext context)
    
public static  voidwriteExternalCSSDependencies(FacesContext context, ResponseWriter writer, String key, String path)
    
public static  voidwriteExternalJSDependencies(FacesContext context, ResponseWriter writer, String key, String path)
    
public static  voidwritePassthroughAttributes(String[] passthrus, boolean writeNullAttrs, FacesContext context, UIComponent component)
    
public static  voidwritePassthroughs(FacesContext context, UIComponent component)
    
public static  voidwriteSmartExternalScripts(FacesContext context, String gateKey, String gateValue, String contextBasePath, String[] scriptPaths)
     Renders a script that includes an external JavaScript that gets added to the document through a document.write() if a gatekeeper value is NOT set.
public static  voidwriteSmartExternalScripts(ResponseWriter writer, String gateKey, String gateValue, String contextBasePath, String[] scriptPaths)
     Renders a script that includes an external JavaScript that gets added to the document through a document.write() if a gatekeeper value is NOT set.



Method Detail
encodeRecursive
public static void encodeRecursive(FacesContext context, UIComponent component) throws IOException(Code)
Helper method for recursively encoding a component.
Parameters:
  context - the given FacesContext
Parameters:
  component - the UIComponent to render
throws:
  IOException -



getAttribute
public static Object getAttribute(FacesContext context, UIComponent component, String name)(Code)
Return the attribute value - handles getting the value from a ValueBinding if necessary. This is necessary because of a difference in the Sun JSF RI versus the MyFaces RI. The Sun RI component.getAttributes().get(attrName) will automatically return value bindings, whereas the MyFaces implmentation requires getting values from ValueBinding seperately.



getDefaultedAttribute
public static Object getDefaultedAttribute(FacesContext context, UIComponent component, String name, Object defaultValue)(Code)
Same as getAttribute, but if not found, we return a default value.



getFormId
public static String getFormId(FacesContext context, UIComponent component)(Code)
Return the form ID of the form containing the given component



isDisabledOrReadonly
public static boolean isDisabledOrReadonly(FacesContext context, UIComponent component)(Code)
If renderer supports disabled or readonly attributes use this method to obtain an early exit from decode method. Good idea to include it anyway, compnent will continue to work when these properties are added.



makeSwitchString
public static String makeSwitchString(String rawSwitch, boolean supportOnOff, boolean supportTrueFalse, boolean supportYesNo, boolean returnOnOff, boolean returnYesNo, boolean defaultValue)(Code)
Switch handling utility.
Parameters:
  rawSwitch - String input string
Parameters:
  supportOnOff - boolean can input string be on, off?
Parameters:
  supportTrueFalse - boolean can input string be true, false?
Parameters:
  supportYesNo - boolean can input string be yes, no?
Parameters:
  returnOnOff - boolean output on, off instead of true false
Parameters:
  returnYesNo - boolean output yes, no instead of true false
Parameters:
  defaultValue - boolean if unknown, return true or false? String raw swrich sring translated to correct switch value ordefault



mapComponentAttributes
public static Map mapComponentAttributes(Collection collection, UIComponent component)(Code)
Get a Map of String key/value pairs from a UIComponent for all attributes keys in a collection
Parameters:
  collection -
Parameters:
  component - Map of String key/value pairs from a UIComponent for all keys ina collection



mapComponentAttributes
public static Map mapComponentAttributes(String[] attributeNames, UIComponent component)(Code)
Get String key/value pairs from a UIComponent for all attributes keys in an array
Parameters:
  attributeNames -
Parameters:
  component - Map of String key/value pairs from a UIComponent for all keys ina collection



renderMenu
public static void renderMenu(ResponseWriter out, List items, int selected, String clientId, String styleClass, UIComponent component) throws IOException(Code)
Given a List of SelectItems render the select options
Parameters:
  out -
Parameters:
  items - List of SelectItems
Parameters:
  selected - seelcted choice
Parameters:
  clientId - the id
Parameters:
  styleClass - the optional style class
Parameters:
  component - the component being rendered
throws:
  IOException -



setAttribute
public static void setAttribute(FacesContext context, UIComponent component, String name, Object value)(Code)
Sets component attribute value - if a ValueBinding exists for that attribute, set through the binding; otherwise, set the value directly on the component.



writeAttr
public static void writeAttr(Writer inWriter, String inAttr, String inAttrValue) throws IOException(Code)



writeAttributes
public static void writeAttributes(Map attributeMap, ResponseWriter writer) throws IOException(Code)

Parameters:
  attributeMap - String key/value pairs
Parameters:
  writer - response writer



writeAttributes
public static void writeAttributes(Map attributeMap, FacesContext context) throws IOException(Code)

Parameters:
  attributeMap - String key/value pairs
Parameters:
  context - Faces context
Parameters:
  component - the UIComponent
throws:
  IOException -



writeExternalCSSDependencies
public static void writeExternalCSSDependencies(FacesContext context, ResponseWriter writer, String key, String path) throws IOException(Code)

Parameters:
  context - FacesContext for the request we are processing
Parameters:
  writer - ResponseWriter to be used
Parameters:
  key - key to use to look up the value in the request
Parameters:
  path - path to the file
exception:
  IOException - if an input/output error occurs while rendering



writeExternalJSDependencies
public static void writeExternalJSDependencies(FacesContext context, ResponseWriter writer, String key, String path) throws IOException(Code)

Parameters:
  context - FacesContext for the request we are processing
Parameters:
  writer - ResponseWriter to be used
Parameters:
  key - key to use to look up the value in the request
Parameters:
  path - path to the file
exception:
  IOException - if an input/output error occurs while rendering



writePassthroughAttributes
public static void writePassthroughAttributes(String[] passthrus, boolean writeNullAttrs, FacesContext context, UIComponent component) throws IOException(Code)
write passthough attributes on the current element



writePassthroughs
public static void writePassthroughs(FacesContext context, UIComponent component) throws IOException(Code)
Write default HTML passthrough attributes



writeSmartExternalScripts
public static void writeSmartExternalScripts(FacesContext context, String gateKey, String gateValue, String contextBasePath, String[] scriptPaths) throws IOException(Code)
Renders a script that includes an external JavaScript that gets added to the document through a document.write() if a gatekeeper value is NOT set. This effectively makes the script inclusion a per request JavaScript singleton.
Parameters:
  gateKey - for key value pair
Parameters:
  gateValue - value for key value pair for gatekeeper
Parameters:
  contextBasePath - the web app with the script
Parameters:
  scriptPath - the webapp-relative path
throws:
  IOException -



writeSmartExternalScripts
public static void writeSmartExternalScripts(ResponseWriter writer, String gateKey, String gateValue, String contextBasePath, String[] scriptPaths) throws IOException(Code)
Renders a script that includes an external JavaScript that gets added to the document through a document.write() if a gatekeeper value is NOT set. This effectively makes the script inclusion a per request JavaScript singleton.
Parameters:
  writer - the ResponseWriter
Parameters:
  gateKey - for key value pair
Parameters:
  gateValue - value for key value pair for gatekeeper
Parameters:
  contextBasePath - the web app with the script
Parameters:
  scriptPath - the webapp-relative path
throws:
  IOException -



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.