|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidadinternal.ui.laf.base.BaseLafUtils
public class BaseLafUtils
Field Summary | |
---|---|
static char |
CHAR_UNDEFINED
|
Constructor Summary | |
---|---|
protected |
BaseLafUtils()
|
Method Summary | |
---|---|
static java.lang.String |
appendURLArgument(java.lang.String baseURL,
java.lang.String key,
java.lang.String value)
|
static java.lang.String |
appendURLArguments(java.lang.StringBuffer buffer,
java.lang.String baseURL,
java.lang.String[] keysAndValues)
|
static java.lang.String |
appendURLArguments(java.lang.String baseURL,
java.lang.String[] keysAndValues)
|
static BoundValue |
createIsRenderedBoundValue(BoundValue targetUINodeValue)
produces a BoundValue that checks to see if a given UINode must be rendered. |
static BoundValue |
createIsRenderedBoundValue(java.lang.String childName)
|
static java.lang.String |
encodeCompoundKeyValues(java.lang.Object[] keyValues)
Encodes an array of key value pairs as a single value appended to the baseName, if any; |
static java.lang.String |
encodeCompoundKeyValues(java.lang.Object[] keyValues,
java.lang.Object[] keyExchanges)
Encodes an array of key value pairs as a single value appended to the baseName, if any; |
static java.lang.String |
generateUniqueID(UIXRenderingContext context)
Generates an ID that will be unique in the current rendering context. |
static java.awt.Color |
getBackgroundColor(UIXRenderingContext context)
Returns the current background color. |
static char |
getCharacter(java.lang.Object charObj)
|
static char |
getCharacterAttr(UIXRenderingContext context,
UINode node,
AttributeKey key)
|
static java.lang.Object |
getComponentLabel(javax.faces.component.UIComponent component)
Utility method to get the component's label. |
static java.lang.String |
getConfiguredURL(UIXRenderingContext context,
java.lang.Object directoryKey)
Return an URL based on the current Configuration. |
static java.lang.String |
getFormattedString(UIXRenderingContext context,
java.lang.String pattern,
java.lang.String[] parameters)
Format a string with the specified pattern and parameters, caching the FastMessageFormat on the RenderingContext. |
static int |
getKeyValueArraySize(java.lang.Object[] keyValues,
int perPairOverhead)
Returns the total string length of an array of key/value pairs, plus any per pair overhead |
static int |
getLength(java.lang.String[] strings)
Adds up the lengths of each individual String. |
static java.lang.Object |
getLocalAttribute(UIXRenderingContext context,
UINode node,
AttributeKey attrKey)
Returns the value of the specified attribute from the local Renderer stack frame if possible, or from the node, and caches the result |
static boolean |
getLocalBooleanAttribute(UIXRenderingContext context,
UINode node,
AttributeKey attrKey,
boolean defaultValue)
Returns the value of the specified Boolean attribute from the local Renderer stack frame if possible, or from the node, and caches the result |
static UINode |
getLocalNamedChild(UIXRenderingContext context,
UINode node,
java.lang.String childName)
Returns the value of the specified named child from the local Renderer stack frame if possible, or from the node, and caches the result |
static java.lang.String |
getLocalTextAttribute(UIXRenderingContext context,
UINode node,
AttributeKey attrKey)
Returns the value of the specified String attribute from the local Renderer stack frame if possible, or from the node, and caches the result |
static java.lang.String |
getOutputEncoding(UIXRenderingContext context)
Gets the character encoding of the output. |
static java.lang.String |
getParentFormName(UIXRenderingContext context)
Returns the name of the current parent form |
static UINode |
getRenderedAncestorByName(UIXRenderingContext context,
UINode child,
java.lang.String namespaceURI,
java.lang.String name)
Returns the nearest rendered ancestor of the specified child node which has the desired local name. |
static java.lang.Object |
getRenderingProperty(UIXRenderingContext context,
java.lang.Object key)
Gets a property stored on the context, using the BLAF namespace. |
static java.lang.Object |
getRenderingProperty(UIXRenderingContext context,
java.lang.Object key,
java.lang.Object defaultValue)
Gets a property stored on the context, using the Marlin namespace. |
static java.lang.String |
getStringAttributeValue(UIXRenderingContext context,
UINode node,
AttributeKey key)
Returns the attribute as a String |
static java.lang.Object |
getTransformedID(UIXRenderingContext context,
java.lang.Object idObject,
boolean isSubID)
|
static boolean |
isRightToLeft(UIXRenderingContext context)
|
static void |
popRenderingProperty(UIXRenderingContext context,
java.lang.Object key)
Pops a previously pushed local value back into the rendering context property, setting the local property value back to null. |
static void |
popRenderingProperty(UIXRenderingContext context,
java.lang.Object key,
java.lang.Object localKey)
Pops a previously pushed local value back into the rendering context property, setting the local property value back to null. |
static void |
popStyleAttrs(UIXRenderingContext context)
Pops the style attributes stack. |
static void |
pushAttributeAsRenderingProperty(UIXRenderingContext context,
UINode node,
AttributeKey attrKey)
Pushes the attribute value into the rendering context property, storing the old value as a local property to be restored later. |
static void |
pushAttributeAsStringRenderingProperty(UIXRenderingContext context,
UINode node,
AttributeKey attrKey)
Pushes the attribute value into the rendering context property, as a String, storing the old value as a local property to be restored later. |
static void |
pushRenderingProperty(UIXRenderingContext context,
java.lang.Object key,
java.lang.Object value)
Pushes a new value into the rendering context property, storing the old value as a local property to be restored later. |
static void |
pushRenderingProperty(UIXRenderingContext context,
java.lang.Object key,
java.lang.Object localKey,
java.lang.Object value)
Pushes a new value into the rendering context property, storing the old value as a local property to be restored later. |
static void |
pushStyleAttrs(UIXRenderingContext context,
java.lang.String styleClass,
Style inlineStyle)
Pushes the specified style attributes onto a stack which is used to track the current background color. |
static void |
setRenderingProperty(UIXRenderingContext context,
java.lang.Object key,
java.lang.Object value)
Stores a property on the context, using the BLAF namespace. |
static void |
setRootBoundValue(MutableUINode node,
AttributeKey attrKey)
Convenience function for creating and setting a RootAttributeBoundValue that points to the root of the local rendering node stack with the same key as the attribute will be registered under. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static char CHAR_UNDEFINED
Constructor Detail |
---|
protected BaseLafUtils()
Method Detail |
---|
public static java.lang.String appendURLArgument(java.lang.String baseURL, java.lang.String key, java.lang.String value)
public static java.lang.String appendURLArguments(java.lang.StringBuffer buffer, java.lang.String baseURL, java.lang.String[] keysAndValues)
public static java.lang.String appendURLArguments(java.lang.String baseURL, java.lang.String[] keysAndValues)
public static java.lang.String getStringAttributeValue(UIXRenderingContext context, UINode node, AttributeKey key)
public static java.lang.String getParentFormName(UIXRenderingContext context)
public static boolean isRightToLeft(UIXRenderingContext context)
public static java.lang.Object getTransformedID(UIXRenderingContext context, java.lang.Object idObject, boolean isSubID)
public static UINode getRenderedAncestorByName(UIXRenderingContext context, UINode child, java.lang.String namespaceURI, java.lang.String name)
context
- a RenderingContextchild
- the node whose ancestor is being soughtnamespaceURI
- the namespace of the ancestor being soughtname
- the local name of the ancestor being soughtpublic static void setRootBoundValue(MutableUINode node, AttributeKey attrKey)
public static java.lang.Object getRenderingProperty(UIXRenderingContext context, java.lang.Object key)
public static java.lang.Object getRenderingProperty(UIXRenderingContext context, java.lang.Object key, java.lang.Object defaultValue)
public static void setRenderingProperty(UIXRenderingContext context, java.lang.Object key, java.lang.Object value)
public static void pushAttributeAsRenderingProperty(UIXRenderingContext context, UINode node, AttributeKey attrKey)
pushRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object, java.lang.Object)
,
popRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object)
public static void pushAttributeAsStringRenderingProperty(UIXRenderingContext context, UINode node, AttributeKey attrKey)
pushRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object, java.lang.Object)
,
popRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object)
public static void pushRenderingProperty(UIXRenderingContext context, java.lang.Object key, java.lang.Object value)
popRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object)
public static void pushRenderingProperty(UIXRenderingContext context, java.lang.Object key, java.lang.Object localKey, java.lang.Object value)
popRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object)
public static void popRenderingProperty(UIXRenderingContext context, java.lang.Object key)
pushRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object, java.lang.Object)
public static void popRenderingProperty(UIXRenderingContext context, java.lang.Object key, java.lang.Object localKey)
pushRenderingProperty(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, java.lang.Object, java.lang.Object)
public static java.lang.Object getLocalAttribute(UIXRenderingContext context, UINode node, AttributeKey attrKey)
public static java.lang.String getLocalTextAttribute(UIXRenderingContext context, UINode node, AttributeKey attrKey)
public static boolean getLocalBooleanAttribute(UIXRenderingContext context, UINode node, AttributeKey attrKey, boolean defaultValue)
public static UINode getLocalNamedChild(UIXRenderingContext context, UINode node, java.lang.String childName)
public static int getLength(java.lang.String[] strings)
strings
- Each element must be a String and cannot be null
public static java.lang.String generateUniqueID(UIXRenderingContext context)
public static char getCharacterAttr(UIXRenderingContext context, UINode node, AttributeKey key)
public static char getCharacter(java.lang.Object charObj)
public static java.lang.String getConfiguredURL(UIXRenderingContext context, java.lang.Object directoryKey)
This method uses the RenderingContext.CONTEXT_URI_PROPERTY to resolve URLs, which means that it never returns URLs to shared installable resources. As such, this method should only be used to get URLs for resources which are always known to be local to the current application's context path - such as the image cache. For resources which could be shared across applications, such as images, jsps, jsLibs, getSharedConfiguredURL() should be used instead.
public static BoundValue createIsRenderedBoundValue(java.lang.String childName)
public static BoundValue createIsRenderedBoundValue(BoundValue targetUINodeValue)
targetUINodeValue
- This bound value must return a
UINode (or null). If a UINode is returned and this UINode does not have
its rendered attribute set to false, then the value returned by this
method is true.
public static int getKeyValueArraySize(java.lang.Object[] keyValues, int perPairOverhead)
public static java.lang.String encodeCompoundKeyValues(java.lang.Object[] keyValues)
public static java.lang.String encodeCompoundKeyValues(java.lang.Object[] keyValues, java.lang.Object[] keyExchanges)
public static java.lang.String getOutputEncoding(UIXRenderingContext context)
public static java.lang.String getFormattedString(UIXRenderingContext context, java.lang.String pattern, java.lang.String[] parameters)
public static void pushStyleAttrs(UIXRenderingContext context, java.lang.String styleClass, Style inlineStyle)
public static void popStyleAttrs(UIXRenderingContext context)
public static java.awt.Color getBackgroundColor(UIXRenderingContext context)
public static java.lang.Object getComponentLabel(javax.faces.component.UIComponent component)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |