Package org.zkoss.zk.ui.impl
Class Utils
- java.lang.Object
-
- org.zkoss.zk.ui.impl.Utils
-
public class Utils extends java.lang.Object
Utilities to implement ZK.- Since:
- 5.0.7
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ComponentInfo
getComponentInfo(Component comp)
Returns the component info associated with the given component, or null if not available.static XMLResourcesLocator
getXMLResourcesLocator()
Returns the XML resources locator to locate metainfo/zk/config.xml, metainfo/zk/lang.xml, and metainfo/zk/lang-addon.xmlstatic boolean
markClientInfoPerDesktop(Desktop desktop, java.lang.String key)
Marks the per-desktop information of the given key will be generated, and returns true if the information is not generated yet (i.e., this method is NOT called with the given key).static Composer
newComposer(Page page, java.lang.Object o)
Instantiates a composer of the given object.static void
setComponentInfo(Component comp, ComponentInfo info)
Sets the component info for the given component.static void
setShadowInfo(Component comp, ShadowInfo info)
Sets the component info for the given component.static boolean
testAttribute(Component comp, java.lang.String name, boolean defValue, boolean recurse)
Tests if the given attribute is defined in a component or in library property.
-
-
-
Method Detail
-
markClientInfoPerDesktop
public static boolean markClientInfoPerDesktop(Desktop desktop, java.lang.String key)
Marks the per-desktop information of the given key will be generated, and returns true if the information is not generated yet (i.e., this method is NOT called with the given key). You could use this method to minimize the bytes to be sent to the client if the information is required only once per desktop.
-
getXMLResourcesLocator
public static XMLResourcesLocator getXMLResourcesLocator()
Returns the XML resources locator to locate metainfo/zk/config.xml, metainfo/zk/lang.xml, and metainfo/zk/lang-addon.xml
-
newComposer
public static Composer newComposer(Page page, java.lang.Object o) throws java.lang.Exception
Instantiates a composer of the given object. This method will invokeUiFactory.newComposer(org.zkoss.zk.ui.Page, java.lang.Class)
to instantiate the composer if page is not null.- Parameters:
page
- the page that the composer will be created for. Ignored if null.o
- the composer instance, the class of the composer to instantiate, or the name of the class of the composer. Ifo
is an instance ofComposer
, it is returned directly.- Throws:
java.lang.Exception
-
getComponentInfo
public static ComponentInfo getComponentInfo(Component comp)
Returns the component info associated with the given component, or null if not available.It is used only internally.
-
setComponentInfo
public static void setComponentInfo(Component comp, ComponentInfo info)
Sets the component info for the given component.It is used only internally.
-
testAttribute
public static final boolean testAttribute(Component comp, java.lang.String name, boolean defValue, boolean recurse)
Tests if the given attribute is defined in a component or in library property.- Parameters:
name
- the name of the attributedefValue
- the default value if neither component's attribute or library property is defined for the given namerecurse
- whether to look up the ancestor's attribute- Since:
- 5.0.7
-
setShadowInfo
public static void setShadowInfo(Component comp, ShadowInfo info)
Sets the component info for the given component.It is used only internally.
- Since:
- 8.0.0
-
-