|
Project Wonder 5.0 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objecter.extensions.components.ERXComponentUtilities
public class ERXComponentUtilities
ERXComponentUtilities contains WOComponent/WOElement-related utility methods.
| Field Summary | |
|---|---|
static com.webobjects.appserver.WOAssociation |
EMPTY
|
static com.webobjects.appserver.WOAssociation |
FALSE
|
static com.webobjects.appserver.WOAssociation |
TRUE
|
static com.webobjects.appserver.WOAssociation |
ZERO
|
| Constructor Summary | |
|---|---|
ERXComponentUtilities()
|
|
| Method Summary | ||
|---|---|---|
static com.webobjects.foundation.NSMutableDictionary |
_queryParameterAssociations(com.webobjects.foundation.NSDictionary associations,
boolean removeQueryParameterAssociations)
|
|
static com.webobjects.foundation.NSMutableDictionary |
_queryParametersInComponent(com.webobjects.foundation.NSMutableDictionary associations,
com.webobjects.appserver.WOComponent component)
|
|
static void |
appendHtmlAttribute(java.lang.String key,
com.webobjects.appserver.WOAssociation association,
com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOComponent component)
Appends an association as an HTML attribute. |
|
static void |
appendHtmlAttributes(com.webobjects.foundation.NSDictionary<java.lang.String,com.webobjects.appserver.WOAssociation> associations,
com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOComponent component)
Appends a dictionary of associations as HTML attributes. |
|
static void |
appendHtmlAttributes(com.webobjects.foundation.NSDictionary<java.lang.String,com.webobjects.appserver.WOAssociation> associations,
com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Appends a dictionary of associations as HTML attributes. |
|
static boolean |
booleanValueForBinding(com.webobjects.appserver.WOComponent component,
java.lang.String bindingName)
Returns the boolean value of a binding. |
|
static boolean |
booleanValueForBinding(com.webobjects.appserver.WOComponent component,
java.lang.String bindingName,
boolean defaultValue)
Returns the boolean value of a binding. |
|
static com.webobjects.foundation.NSArray |
componentTree()
Returns an array of the current component names. |
|
static java.lang.String |
htmlTemplate(java.lang.String componentName,
com.webobjects.foundation.NSArray languages)
Returns the contents of the html template for the given component name as a string. |
|
static java.net.URL |
htmlTemplateUrl(java.lang.String componentName,
com.webobjects.foundation.NSArray languages)
Returns the URL of the html template for the given component name. |
|
static com.webobjects.appserver.WOElement |
inheritTemplateFrom(java.lang.String componentName,
com.webobjects.foundation.NSArray<java.lang.String> languages)
Allows a component to "inherit" the template (.html and .wod files) from another component. |
|
static
|
pageWithName(java.lang.Class<T> componentClass)
Calls pageWithName with ERXWOContext.currentContext() for the current thread. |
|
static
|
pageWithName(java.lang.Class<T> componentClass,
com.webobjects.appserver.WOContext context)
Returns the component for the given class without having to cast. |
|
static com.webobjects.foundation.NSMutableDictionary |
queryParameterAssociations(com.webobjects.foundation.NSDictionary associations)
Returns the set of ?key=value associations from an associations dictionary. |
|
static com.webobjects.foundation.NSMutableDictionary |
queryParameterAssociations(com.webobjects.foundation.NSMutableDictionary associations,
boolean removeQueryParameterAssociations)
Returns the set of ?key=value associations from an associations dictionary. |
|
static com.webobjects.foundation.NSMutableDictionary |
queryParametersInComponent(com.webobjects.foundation.NSDictionary associations,
com.webobjects.appserver.WOComponent component)
Returns a query parameter dictionary from a set of ?key=association WOAssociation dictionary. |
|
static com.webobjects.foundation.NSMutableDictionary |
queryParametersInComponent(com.webobjects.foundation.NSMutableDictionary associations,
com.webobjects.appserver.WOComponent component,
boolean removeQueryParametersAssociations)
Returns a query parameter dictionary from a set of ?key=association WOAssociation dictionary. |
|
static java.lang.String |
template(java.lang.String componentName,
java.lang.String extension,
com.webobjects.foundation.NSArray languages)
Returns the contents of the template for the given component name as a string. |
|
static java.net.URL |
templateUrl(java.lang.String componentName,
java.lang.String extension,
com.webobjects.foundation.NSArray languages)
Returns the URL of the template for the given component name. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static com.webobjects.appserver.WOAssociation TRUE
public static com.webobjects.appserver.WOAssociation FALSE
public static com.webobjects.appserver.WOAssociation EMPTY
public static com.webobjects.appserver.WOAssociation ZERO
| Constructor Detail |
|---|
public ERXComponentUtilities()
| Method Detail |
|---|
public static com.webobjects.foundation.NSMutableDictionary queryParametersInComponent(com.webobjects.foundation.NSDictionary associations,
com.webobjects.appserver.WOComponent component)
associations - the set of associationscomponent - the component to evaluate their values within
public static com.webobjects.foundation.NSMutableDictionary queryParametersInComponent(com.webobjects.foundation.NSMutableDictionary associations,
com.webobjects.appserver.WOComponent component,
boolean removeQueryParametersAssociations)
associations - the set of associationscomponent - the component to evaluate their values withinremoveQueryParametersAssociations - should the entries be removed from the passed-in dictionary?
public static com.webobjects.foundation.NSMutableDictionary _queryParametersInComponent(com.webobjects.foundation.NSMutableDictionary associations,
com.webobjects.appserver.WOComponent component)
public static com.webobjects.foundation.NSMutableDictionary queryParameterAssociations(com.webobjects.foundation.NSDictionary associations)
associations - the associations to enumerate
public static com.webobjects.foundation.NSMutableDictionary queryParameterAssociations(com.webobjects.foundation.NSMutableDictionary associations,
boolean removeQueryParameterAssociations)
associations - the associations to enumerateremoveQueryParameterAssociations - should the entries be removed from the passed-in dictionary?
public static com.webobjects.foundation.NSMutableDictionary _queryParameterAssociations(com.webobjects.foundation.NSDictionary associations,
boolean removeQueryParameterAssociations)
public static boolean booleanValueForBinding(com.webobjects.appserver.WOComponent component,
java.lang.String bindingName)
component - the componentbindingName - the name of the boolean binding
public static boolean booleanValueForBinding(com.webobjects.appserver.WOComponent component,
java.lang.String bindingName,
boolean defaultValue)
component - the componentbindingName - the name of the boolean bindingdefaultValue - the default value if the binding is null
public static java.net.URL htmlTemplateUrl(java.lang.String componentName,
com.webobjects.foundation.NSArray languages)
componentName - the name of the component to load a template for (without the
.wo)languages - the list of languages to use for finding components
public static java.net.URL templateUrl(java.lang.String componentName,
java.lang.String extension,
com.webobjects.foundation.NSArray languages)
componentName - the name of the component to load a template for (without the
.wo)extension - the file extension of the template (without the dot -- i.e.
"html")languages - the list of languages to use for finding components
public static java.lang.String htmlTemplate(java.lang.String componentName,
com.webobjects.foundation.NSArray languages)
throws java.io.IOException
componentName - the name of the component to load a template for (without the
.wo)languages - the list of languages to use for finding components
java.io.IOException
public static java.lang.String template(java.lang.String componentName,
java.lang.String extension,
com.webobjects.foundation.NSArray languages)
throws java.io.IOException
componentName - the name of the component to load a template for (without the
.wo)extension - the file extension of the template (without the dot -- i.e.
"html")languages - the list of languages to use for finding components
java.io.IOException
public static com.webobjects.appserver.WOElement inheritTemplateFrom(java.lang.String componentName,
com.webobjects.foundation.NSArray<java.lang.String> languages)
Usage in your WOComponent subclass:
@Override
public WOElement template() {
return ERXComponentUtilities.inheritTemplateFrom("AddAddress", session().languages());
}
This very simple implementation does have some limitations:
componentName - the name of the component whose template will be inheritedlanguages - the list of languages to use for finding components
WOComponent.template()public static com.webobjects.foundation.NSArray componentTree()
public static void appendHtmlAttributes(com.webobjects.foundation.NSDictionary<java.lang.String,com.webobjects.appserver.WOAssociation> associations,
com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
associations - the associations dictionaryresponse - the response to write tocontext - the context
public static void appendHtmlAttributes(com.webobjects.foundation.NSDictionary<java.lang.String,com.webobjects.appserver.WOAssociation> associations,
com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOComponent component)
associations - the associations dictionaryresponse - the response to write tocomponent - the component to evaluate the associations within
public static void appendHtmlAttribute(java.lang.String key,
com.webobjects.appserver.WOAssociation association,
com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOComponent component)
key - the key to appendassociation - the associationresponse - the response to write tocomponent - the component to evaluate the association within
public static <T extends com.webobjects.appserver.WOComponent> T pageWithName(java.lang.Class<T> componentClass,
com.webobjects.appserver.WOContext context)
T - the type of component tocomponentClass - the component class to lookupcontext - the context
public static <T extends com.webobjects.appserver.WOComponent> T pageWithName(java.lang.Class<T> componentClass)
T - the type of component tocomponentClass - the component class to lookup
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||