Java Doc for Util.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » 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 » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.rave.web.ui.component.util.Util

Util
public class Util (Code)
Utility class that contains helper methods for components.
author:
   Ken Paulsen




Method Summary
public static  voidaddPhaseListener(PhaseListener phaseListener)
     Add a PhaseListener.
public static  UIComponentcreateChildComponent(FacesContext context, LayoutComponent descriptor, UIComponent parent)
    

This method creates a child UIComponent by using the provided LayoutComponent (descriptor).

public static  UIComponentfindChild(UIComponent parent, String id, String facetName)
    

Return a child with the specified component id (or facetName) from the specified component.

public static  StringgetActionURL(FacesContext context, String url)
    
public static  StringgetBase(FacesContext context)
    
public static  UIComponentgetChild(UIComponent parent, String id)
    

Return a child with the specified component id from the specified component.

public static  UIComponentgetChild(UIComponent parent, String id, String factoryClass)
    

This method finds or creates a child UIComponent identified by the given id.

public static  UIComponentgetChild(UIComponent parent, String id, String factoryClass, String facetName)
    

Same as Util.getChild(UIComponent,String,String) except that it allows you to specify a facetName different than the id.

public static  UIComponentgetChild(UIComponent parent, String id, String factoryClass, Properties properties)
    

This method finds or creates a child UIComponent identified by the given id.

public static  UIComponentgetChild(UIComponent parent, String id, String factoryClass, Properties properties, String facetName)
    

Same as Util.getChild(UIComponent,String,String,Properties) except that it allows you to specify a facetName different than the id.

public static  UIComponentgetChild(UIComponent parent, LayoutComponent descriptor)
    

This method finds or creates a child UIComponent identified by the given id.

public static  StringgetContext(FacesContext context)
    
public static  UIComponentgetForm(FacesContext context, UIComponent component)
    
public static  StringgetFormName(FacesContext context, UIComponent component)
    

Gets the form id from the containing UIForm.


Parameters:
  context - FacesContext for the request we are processing.
Parameters:
  component - UIComponent to find form from.
public static  booleanisVisible(UIComponent component)
    

Return whether the given UIComponent is "visible". If the property is null, it will return true.

public static  voidremovePhaseListener(PhaseListener phaseListener)
     Remove a PhaseListener.
public static  ObjectresolveValue(FacesContext context, LayoutElement elt, UIComponent parent, String value)
    

This method will attempt to resolve EL strings in the given value.


Parameters:
  context - The FacesContext
Parameters:
  elt - The LayoutElement associated w/ the expression
Parameters:
  parent - The parent UIComponent.
public static  ObjectsetOption(FacesContext context, String key, Object value, LayoutElement desc, UIComponent component)
    

This util method will set the given key/value on the UIComponent.




Method Detail
addPhaseListener
public static void addPhaseListener(PhaseListener phaseListener)(Code)
Add a PhaseListener.
Parameters:
  phaseListener - PhaseListener instance.



createChildComponent
public static UIComponent createChildComponent(FacesContext context, LayoutComponent descriptor, UIComponent parent)(Code)

This method creates a child UIComponent by using the provided LayoutComponent (descriptor). It will associate the parent and the newly created UIComponent.

It is recommended that this method NOT be called from a Renderer. It should not be called if you have not yet checked to see if a child UIComponent with the requested ID already exists.


Parameters:
  context - The FacesContext object.
Parameters:
  descriptor - The LayoutComponent describing theUIComponent to be created.
Parameters:
  parent - Parent UIComponent. A new UIComponent based on the providedLayoutComponent.
throws:
  IllegalArgumentException - Thrown if descriptor equals null.
See Also:   Util.getChild(UIComponent,LayoutComponent)
See Also:   Util.getChild(UIComponent,String,String,Properties)
See Also:   LayoutComponent.getType
See Also:   ComponentType.getFactory
See Also:   com.sun.rave.web.ui.component.util.factories.ComponentFactory.create(FacesContextLayoutComponentUIComponent)



findChild
public static UIComponent findChild(UIComponent parent, String id, String facetName)(Code)

Return a child with the specified component id (or facetName) from the specified component. If not found, return null. facetName or id may be null to avoid searching the facet Map or the parent's children.

This method will NOT create a new UIComponent.


Parameters:
  parent - UIComponent to be searched
Parameters:
  id - id to search for
Parameters:
  facetName - Facet name to search for The child UIComponent if it exists, null otherwise.



getActionURL
public static String getActionURL(FacesContext context, String url)(Code)



getBase
public static String getBase(FacesContext context)(Code)

Return the base URI for the view identifier of the current view.


Parameters:
  context - FacesContext for the current request



getChild
public static UIComponent getChild(UIComponent parent, String id)(Code)

Return a child with the specified component id from the specified component. If not found, return null.

This method will NOT create a new UIComponent.


Parameters:
  parent - UIComponent to be searched
Parameters:
  id - Component id (or facet name) to search for The child UIComponent if it exists, null otherwise.



getChild
public static UIComponent getChild(UIComponent parent, String id, String factoryClass)(Code)

This method finds or creates a child UIComponent identified by the given id. If the child is not found, it will attempt to create it using the provided com.sun.rave.web.ui.component.util.factories.ComponentFactory (factoryClass).

If there are Properties to be set on the UIComponent, this method should generally be avoided. It is preferable to use the Util.getChild(UIComponent,String,String,Properties) form of getChild.

// Example (no properties):
UIComponent child = Util.getChild(component, "jklLabel", " com.sun.rave.web.ui.component.util.factories.LabelFactory com.sun.rave.web.ui.component.util.factories.LabelFactory ");
((Label)child).setText("JKL Label:");
((Label)child).setFor("jkl");

LayoutComponent.encodeChild(FacesContextUIComponent) LayoutComponent.encodeChild (context, child);


Parameters:
  parent - Parent UIComponent
Parameters:
  id - Identifier for the child UIComponent
Parameters:
  factoryClass - Full com.sun.rave.web.ui.component.util.factories.ComponentFactory class name The child UIComponent that was found or created.
See Also:   Util.getChild(UIComponent,String,String,Properties)



getChild
public static UIComponent getChild(UIComponent parent, String id, String factoryClass, String facetName)(Code)

Same as Util.getChild(UIComponent,String,String) except that it allows you to specify a facetName different than the id. If null is supplied, it won't save the component as a facet.


Parameters:
  parent - Parent UIComponent
Parameters:
  id - Identifier for the child UIComponent
Parameters:
  factoryClass - Full com.sun.rave.web.ui.component.util.factories.ComponentFactory class name
Parameters:
  facetName - The facet name (null means don't store it) The child UIComponent that was found or created.
See Also:   Util.getChild(UIComponent,String,String)



getChild
public static UIComponent getChild(UIComponent parent, String id, String factoryClass, Properties properties)(Code)

This method finds or creates a child UIComponent identified by the given id. If the child is not found, it will attempt to create it using the provided com.sun.rave.web.ui.component.util.factories.ComponentFactory (factoryClass). It will also initialize the UIComponent using the provided set of Properties.

// Example (with properties):
Properties props = new Properties();
props.setProperty("text", "ABC Label:");
props.setProperty("for", "abc");
UIComponent child = Util.getChild(component, "abcLabel", " com.sun.rave.web.ui.component.util.factories.LabelFactory com.sun.rave.web.ui.component.util.factories.LabelFactory ", props);

LayoutComponent.encodeChild(FacesContextUIComponent) LayoutComponent.encodeChild (context, child);


Parameters:
  parent - Parent UIComponent
Parameters:
  id - Identifier for the child UIComponent
Parameters:
  factoryClass - Full com.sun.rave.web.ui.component.util.factories.ComponentFactory class name
Parameters:
  properties - java.util.Properties needed tocreate and/or initialize theUIComponent The child UIComponent that was found or created.



getChild
public static UIComponent getChild(UIComponent parent, String id, String factoryClass, Properties properties, String facetName)(Code)

Same as Util.getChild(UIComponent,String,String,Properties) except that it allows you to specify a facetName different than the id. If null is supplied, it won't save the component as a facet.


Parameters:
  parent - Parent UIComponent
Parameters:
  id - Identifier for the child UIComponent
Parameters:
  factoryClass - Full com.sun.rave.web.ui.component.util.factories.ComponentFactory class name
Parameters:
  properties - java.util.Properties needed tocreate and/or initialize theUIComponent
Parameters:
  facetName - The facet name (null means don't store it) The child UIComponent that was found or created.



getChild
public static UIComponent getChild(UIComponent parent, LayoutComponent descriptor)(Code)

This method finds or creates a child UIComponent identified by the given id. If the child is not found, it will attempt to create it using the provided LayoutComponent (descriptor). It will also initialize the UIComponent using the options set on the LayoutComponent .

If parent implements ChildManager , then the responsibility of finding and creating the child will be delegated to the ChildManager UIComponent.

If you are constructing and populating a LayoutComponent before calling this method, there are a few features that should be noted. Besides id and type which can be set in the LayoutComponent constructor, you can also set options, and com.sun.rave.web.ui.component.util.event.Handler 's.

Options may be set via LayoutComponent.setOptions(Map) . These options will be applied to the UIComponent and may also be used by the com.sun.rave.web.ui.component.util.factories.ComponentFactory while instantiating the UIComponent.

com.sun.rave.web.ui.component.util.event.Handler 's can be supplied by calling LayoutComponent.setHandlers(StringList) . The type must match the event name which invokes the List of handlers you provide. The Renderer for this UIComponent is responsible for declaring and dispatching events. com.sun.rave.web.ui.renderer.template.TemplateRenderer will invoke beforeCreate and afterCreate events for each child it creates (such as the one being requested here).

// Example (with LayoutComponent):
ComponentType type = new ComponentType.ComponentType(StringString) ComponentType ("LabelFactory", " com.sun.rave.web.ui.component.util.factories.LabelFactory com.sun.rave.web.ui.component.util.factories.LabelFactory ");
LayoutComponent descriptor = new LayoutComponent.LayoutComponent(LayoutElementStringComponentType) LayoutComponent (null, "abcLabel", type);
LayoutComponent.addOption(StringObject) descriptor.addOption ("text", "ABC Label:");
LayoutComponent.addOption(StringObject) descriptor.addOption ("for", "abc");
UIComponent child = Util.getChild(component, descriptor);

LayoutComponent.encodeChild(FacesContextUIComponent) LayoutComponent.encodeChild (context, child);


Parameters:
  parent - Parent UIComponent
Parameters:
  descriptor - The LayoutComponent describing theUIComponent The child UIComponent that was found or created.



getContext
public static String getContext(FacesContext context)(Code)

Return an absolute URL to our server and context path.


Parameters:
  context - FacesContext for the current request



getForm
public static UIComponent getForm(FacesContext context, UIComponent component)(Code)

Helper method to obtain containing UIForm.


Parameters:
  context - FacesContext for the request we areprocessing.
Parameters:
  component - UIComponent to find form from. Returns the UIForm component that contains this element



getFormName
public static String getFormName(FacesContext context, UIComponent component)(Code)

Gets the form id from the containing UIForm.


Parameters:
  context - FacesContext for the request we are processing.
Parameters:
  component - UIComponent to find form from. Returns the id of the UIForm that contains thiselement.



isVisible
public static boolean isVisible(UIComponent component)(Code)

Return whether the given UIComponent is "visible". If the property is null, it will return true. Otherwise the value of the property is returned.


Parameters:
  component - The UIComponent to check True if the property is null or true, false otherwise.



removePhaseListener
public static void removePhaseListener(PhaseListener phaseListener)(Code)
Remove a PhaseListener.
Parameters:
  phaseListener - PhaseListener instance.



resolveValue
public static Object resolveValue(FacesContext context, LayoutElement elt, UIComponent parent, String value)(Code)

This method will attempt to resolve EL strings in the given value.


Parameters:
  context - The FacesContext
Parameters:
  elt - The LayoutElement associated w/ the expression
Parameters:
  parent - The parent UIComponent. This is usedbecause the current UIComponent is typicallyunknown (or not even created yet).
Parameters:
  value - The String to resolve The evaluated value (may be null).



setOption
public static Object setOption(FacesContext context, String key, Object value, LayoutElement desc, UIComponent component)(Code)

This util method will set the given key/value on the UIComponent. It will resolve all $...{...} expressions, and convert the String into a ValueBinding if a ValueBinding is detected. The return value will be a ValueBinding or the value.


Parameters:
  context - FacesContext
Parameters:
  key - The Property name to set
Parameters:
  value - The Property value to set
Parameters:
  desc - The LayoutElement associated with theUIComponent
Parameters:
  component - The UIComponent A ValueBinding, or the evaulated value (if no value binding ispresent).



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.