Java Doc for FxJsfUtils.java in  » J2EE » fleXive » com » flexive » faces » 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 » J2EE » fleXive » com.flexive.faces 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.flexive.faces.FxJsfUtils

FxJsfUtils
public class FxJsfUtils (Code)
Utility class for JSF functionality within beans.
author:
   Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
version:
   $Rev: 225 $

Inner Class :public static class SelectItemSorter implements Comparator<SelectItem>,Serializable
Inner Class :public static class ScriptInfoSorter implements Comparator<FxScriptInfo>,Serializable



Method Summary
public static  UIComponentaddChildComponent(UIComponent parent, String componentType)
     Add a child component of the given type to the parent component.
public static  voidaddMessage(FacesMessage message)
    
public static  List<SelectItem>asIdSelectList(List<? extends SelectableObjectWithName> items)
     Convert a list of SelectableObjects to JSF SelectItems.
public static  List<SelectItem>asIdSelectListWithLabel(List<? extends SelectableObjectWithLabel> items)
     Convert a list of SelectableObjectWithLabels to JSF SelectItems.
public static  List<SelectItem>asSelectList(List<? extends SelectableObjectWithName> items, boolean addEmptyElement)
     Convert a list of SelectableObjects to JSF SelectItems.
public static  List<SelectItem>asSelectList(FxSelectList list)
     Converts the given flexive select list to a list of JSF SelectItems.
public static  List<SelectItem>asSelectList(List<String[]> list)
     Converts a list of String arrays (2 dim, containing value and display) to a list of JSF SelectItems.
public static  List<SelectItem>asSelectListWithLabel(List<? extends SelectableObjectWithLabel> items)
     Convert a list of SelectableObjectsWithLabel to JSF SelectItems.
public static  List<SelectItem>asSelectListWithLabel(List<? extends SelectableObjectWithLabel> items, boolean addEmptyElement)
     Convert a list of SelectableObjectsWithLabel to JSF SelectItems.
public static  voidcheckMultiplicity(int min, int max)
    
public static  voidclearAllMessages(String clientId)
     Clears all faces messages (optional: for the given client id).
public static  UIComponentcreateComponent(String componentType)
     Create a new component of the given type.
Parameters:
  componentType - the component type, e.g.
public static  StringdecodeJSFIdentifier(String identifier)
    
public static  StringencodeJSFIdentifier(String identifier)
    
public static  List<SelectItem>enumsAsSelectList(T[] values)
     Convert the values of an enum to a select list.
public static  IntegerevalInt(String el)
     Evaluate the integer value of a JSF expression.
public static  ObjectevalObject(String el)
     Evaluate the value of a JSF expression.
public static  StringevalString(String el)
     Evaluate the string value of a JSF expression.
public static  TfindAncestor(UIComponent component, Class<T> cls)
     Find a parent of the given class.
public static  TfindChild(UIComponent component, Class<T> childType)
     Recursively search for the first child of the given class type for the component.
public static  ApplicationgetApplication()
    
public static  booleangetBooleanParameter(String name, boolean defaultValue)
    
public static  booleangetBooleanParameter(String name)
    
public static  ArrayList<FxFacesMessage>getFxMessages()
    
public static  List<FxFacesMessages>getGroupedFxMessages()
     Gets all faces messages grouped by a equal summary and wrapped as FxFacesMessage (which gives access to the clientId).
public static  longgetId(String parameterName)
     Gets the id of the given parameter name.
public static  intgetIntParameter(String name, int defaultValue)
    
public static  intgetIntParameter(String name)
    
public static  StringgetJsonServletUri()
    
public static  StringgetLocalizedMessage(String messageKey, Object... args)
     Return the localized message for the given key and replace all parameters with the given args.
public static  longgetLongParameter(String name, long defaultValue)
    
public static  longgetLongParameter(String name)
    
public static  ObjectgetManagedBean(String beanName)
     Get managed beans based on the beans name.
public static  TgetManagedBean(Class<T> beanClass)
     Returns the managed beans of the given class.
public static  ArrayList<FacesMessage>getMessages(String clientId)
     Gets all faces messages (optional: for the given client id).
Parameters:
  clientId - the client id to work on, or null to remove all messages.
public static  StringgetParameter(String name)
    
public static  FxRequestgetRequest()
     Gets the request from the faces context.
public static  StringgetRequestParameter(String name)
     Get parameter value from request scope.
public static  FxResponseWrappergetResponse()
     Gets the response from the faces context.
public static  ServletContextgetServletContext()
     Returns the servlet context.
public static  HttpSessiongetSession()
     Gets the session from the faces context.
public static  ObjectgetSessionAttribute(String key)
    
public static  booleanhasParameter(String name)
    
public static  booleanisAjaxRequest()
     Return true if the current request has been submitted via Ajax4JSF.
public static  booleanisValueReference(String value)
     Source: SHALE-305.
Return true if the specified string contains an EL expression.
public static  voidremoveSessionAttribute(String key)
    
public static  voidreplaceManagedBean(String beanName, Object bean)
     Replace the managed beans based on the beans name.
public static  voidresetFaceletsComponent(String componentId)
     Workaround for facelets component tree update problems - deletes the given component and its children so they can be recreated when the component tree is rendered again
Parameters:
  componentId - the complete component ID, e.g.
public static  voidresetManagedBean(String beanName)
     Remove the managed beans based on the beans name.
public static  voidsetManagedBeanInSession(String beanName, Object managedBean)
     Store the managed beans inside the session scope.
public static  voidsetSessionAttribute(String key, Object value)
    



Method Detail
addChildComponent
public static UIComponent addChildComponent(UIComponent parent, String componentType)(Code)
Add a child component of the given type to the parent component. The child component is returned to the caller.
Parameters:
  parent - the parent component
Parameters:
  componentType - child component type, e.g. javax.faces.SelectOne the created child component



addMessage
public static void addMessage(FacesMessage message)(Code)



asIdSelectList
public static List<SelectItem> asIdSelectList(List<? extends SelectableObjectWithName> items)(Code)
Convert a list of SelectableObjects to JSF SelectItems.
Parameters:
  items - the items to be converted the given list converted to JSF SelectItems



asIdSelectListWithLabel
public static List<SelectItem> asIdSelectListWithLabel(List<? extends SelectableObjectWithLabel> items)(Code)
Convert a list of SelectableObjectWithLabels to JSF SelectItems.
Parameters:
  items - the items to be converted the given list converted to JSF SelectItems



asSelectList
public static List<SelectItem> asSelectList(List<? extends SelectableObjectWithName> items, boolean addEmptyElement)(Code)
Convert a list of SelectableObjects to JSF SelectItems.
Parameters:
  items - the items to be converted
Parameters:
  addEmptyElement - if set to true a empty element is added the given list converted to JSF SelectItems



asSelectList
public static List<SelectItem> asSelectList(FxSelectList list)(Code)
Converts the given flexive select list to a list of JSF SelectItems.
Parameters:
  list - the select list to be converted a JSF select list corresponding to the given list options



asSelectList
public static List<SelectItem> asSelectList(List<String[]> list)(Code)
Converts a list of String arrays (2 dim, containing value and display) to a list of JSF SelectItems.
Parameters:
  list - the list of String arrays (2 dim, containing value and display) a JSF select list corresponding to the given list options



asSelectListWithLabel
public static List<SelectItem> asSelectListWithLabel(List<? extends SelectableObjectWithLabel> items)(Code)
Convert a list of SelectableObjectsWithLabel to JSF SelectItems.
Parameters:
  items - the items to be converted the given list converted to JSF SelectItems



asSelectListWithLabel
public static List<SelectItem> asSelectListWithLabel(List<? extends SelectableObjectWithLabel> items, boolean addEmptyElement)(Code)
Convert a list of SelectableObjectsWithLabel to JSF SelectItems.
Parameters:
  items - the items to be converted
Parameters:
  addEmptyElement - true if an empty first element with id=-1 should be added the given list converted to JSF SelectItems



checkMultiplicity
public static void checkMultiplicity(int min, int max) throws FxApplicationException(Code)
Checks if the minimum and maximum values of a muliplicity are in valid ranges
Parameters:
  min - minMultiplicity
Parameters:
  max - maxMultiplicity
throws:
  FxApplicationException - on errors



clearAllMessages
public static void clearAllMessages(String clientId)(Code)
Clears all faces messages (optional: for the given client id).
Parameters:
  clientId - the client id to work on, or null to remove all messages.



createComponent
public static UIComponent createComponent(String componentType)(Code)
Create a new component of the given type.
Parameters:
  componentType - the component type, e.g. javax.faces.SelectOne the created component



decodeJSFIdentifier
public static String decodeJSFIdentifier(String identifier)(Code)
Decode a JSF identifier created by encodeJSFIdentifier
Parameters:
  identifier - id to decode decoded id



encodeJSFIdentifier
public static String encodeJSFIdentifier(String identifier)(Code)
Encode identifier to be valid for JSF components
Parameters:
  identifier - id to encode encoded id



enumsAsSelectList
public static List<SelectItem> enumsAsSelectList(T[] values)(Code)
Convert the values of an enum to a select list.
Parameters:
  values - the enum values to be converted the select list backing the given enumeration values.



evalInt
public static Integer evalInt(String el)(Code)
Evaluate the integer value of a JSF expression.
Parameters:
  el - the JSF expression the integer value associated with the JSF expression



evalObject
public static Object evalObject(String el)(Code)
Evaluate the value of a JSF expression.
Parameters:
  el - the JSF expression the integer value associated with the JSF expression



evalString
public static String evalString(String el)(Code)
Evaluate the string value of a JSF expression.
Parameters:
  el - the JSF expression the string value associated with the JSF expression



findAncestor
public static T findAncestor(UIComponent component, Class<T> cls)(Code)
Find a parent of the given class. Throws a runtime exception if none is found.
Parameters:
  component - the (child) component that searches an ancestor
Parameters:
  cls - the class or interface to be searched for in the component's ancestors the parent component



findChild
public static T findChild(UIComponent component, Class<T> childType)(Code)
Recursively search for the first child of the given class type for the component.
Parameters:
  component - the component to be searched
Parameters:
  childType - the required child type the first child of the given type, or null if no child was found.



getApplication
public static Application getApplication()(Code)



getBooleanParameter
public static boolean getBooleanParameter(String name, boolean defaultValue)(Code)



getBooleanParameter
public static boolean getBooleanParameter(String name)(Code)



getFxMessages
public static ArrayList<FxFacesMessage> getFxMessages()(Code)
Gets all faces messages wrapped as FxFacesMessage (which gives access to the clientId) a array holding all messages



getGroupedFxMessages
public static List<FxFacesMessages> getGroupedFxMessages()(Code)
Gets all faces messages grouped by a equal summary and wrapped as FxFacesMessage (which gives access to the clientId). In case of a grouped message the details of the original FacesMessage can be retrieved by calling getDetails() of the FxFacesMessage. a array holding all (grouped) messages



getId
public static long getId(String parameterName)(Code)
Gets the id of the given parameter name.
Parameters:
  parameterName - the parameter name the id



getIntParameter
public static int getIntParameter(String name, int defaultValue)(Code)



getIntParameter
public static int getIntParameter(String name)(Code)



getJsonServletUri
public static String getJsonServletUri()(Code)
Returns the URI of the JSON/RPC servlet the URI of the JSON/RPC servlet



getLocalizedMessage
public static String getLocalizedMessage(String messageKey, Object... args)(Code)
Return the localized message for the given key and replace all parameters with the given args.
Parameters:
  messageKey - key of the message to be translated
Parameters:
  args - optional arguments to be replaced in the message the localized message



getLongParameter
public static long getLongParameter(String name, long defaultValue)(Code)



getLongParameter
public static long getLongParameter(String name)(Code)



getManagedBean
public static Object getManagedBean(String beanName)(Code)
Get managed beans based on the beans name.
Parameters:
  beanName - the beans name the managed beans associated with the beans name



getManagedBean
public static T getManagedBean(Class<T> beanClass)(Code)
Returns the managed beans of the given class. Works only for flexive beans that have the full class name and a "fx" prefix by convention. For example, the ContentEditorBean is registered with JSF as "fxContentEditorBean".
Parameters:
  beanClass - the beans class the managed beans of the given class, or null if none exists



getMessages
public static ArrayList<FacesMessage> getMessages(String clientId)(Code)
Gets all faces messages (optional: for the given client id).
Parameters:
  clientId - the client id to work on, or null to remove all messages. a array holding all messages



getParameter
public static String getParameter(String name)(Code)



getRequest
public static FxRequest getRequest()(Code)
Gets the request from the faces context.

The result is null if no faces context is available. the request from the faces context




getRequestParameter
public static String getRequestParameter(String name)(Code)
Get parameter value from request scope.
Parameters:
  name - the name of the parameter the parameter value



getResponse
public static FxResponseWrapper getResponse()(Code)
Gets the response from the faces context.

The result is null if no faces context is available. the response from the faces context




getServletContext
public static ServletContext getServletContext()(Code)
Returns the servlet context.

The result is null if no faces context or external context is available. the servlet context




getSession
public static HttpSession getSession()(Code)
Gets the session from the faces context.

The result is null if no faces context is available. the session from the faces context




getSessionAttribute
public static Object getSessionAttribute(String key)(Code)



hasParameter
public static boolean hasParameter(String name)(Code)



isAjaxRequest
public static boolean isAjaxRequest()(Code)
Return true if the current request has been submitted via Ajax4JSF. true if the current request has been submitted via Ajax4JSF.



isValueReference
public static boolean isValueReference(String value)(Code)
Source: SHALE-305.
Return true if the specified string contains an EL expression.

This is taken almost verbatim from javax.faces.webapp.UIComponentTag in order to remove JSP dependencies from the renderers.
Parameters:
  value - the expression to be checked true if the given value contains an EL expression




removeSessionAttribute
public static void removeSessionAttribute(String key)(Code)



replaceManagedBean
public static void replaceManagedBean(String beanName, Object bean)(Code)
Replace the managed beans based on the beans name.
Parameters:
  beanName - the beans name of the managed beans to be replaced
Parameters:
  bean - the new beans



resetFaceletsComponent
public static void resetFaceletsComponent(String componentId)(Code)
Workaround for facelets component tree update problems - deletes the given component and its children so they can be recreated when the component tree is rendered again
Parameters:
  componentId - the complete component ID, e.g. frm:queryEditor



resetManagedBean
public static void resetManagedBean(String beanName)(Code)
Remove the managed beans based on the beans name.
Parameters:
  beanName - the beans name of the managed beans to be removed



setManagedBeanInSession
public static void setManagedBeanInSession(String beanName, Object managedBean)(Code)
Store the managed beans inside the session scope.
Parameters:
  beanName - the name of the managed beans to be stored
Parameters:
  managedBean - the managed beans to be stored



setSessionAttribute
public static void setSessionAttribute(String key, Object value)(Code)



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.