You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2008/04/12 05:57:12 UTC
svn commit: r647372 - in
/myfaces/trinidad/branches/ar_subRendererPerfTesting:
trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/
trinidad-build/src/main/resources/META-INF/maven-faces-plugin/renderers/trinidad/
tri...
Author: arobinson74
Date: Fri Apr 11 20:57:10 2008
New Revision: 647372
URL: http://svn.apache.org/viewvc?rev=647372&view=rev
Log:
The renderers for a very simple component before making the tests
Added:
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/TestSubRendererComponent.xml (with props)
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/renderers/trinidad/TestSubRenderer.xml
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-examples/trinidad-demo/src/main/webapp/components/testSubRenderer.jspx (with props)
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererFooterRenderer.java (with props)
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererHeaderRenderer.java (with props)
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer.java (with props)
myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer2.java (with props)
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/TestSubRendererComponent.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/TestSubRendererComponent.xml?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/TestSubRendererComponent.xml (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/TestSubRendererComponent.xml Fri Apr 11 20:57:10 2008
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:tr="http://myfaces.apache.org/trinidad"
+ xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <component>
+ <description><![CDATA[Test]]>
+ </description>
+ <icon>
+ <!-- small-icon>/org/apache/myfaces/trinidadinternal/metadata/icons/panelBorderLayout.png</small-icon -->
+ </icon>
+ <component-type>org.apache.myfaces.trinidad.CoreTestSubRenderer</component-type>
+ <component-class>org.apache.myfaces.trinidad.component.core.layout.TestSubRenderer</component-class>
+
+ <facet>
+ <description><![CDATA[]]></description>
+ <facet-name>top</facet-name>
+ <facet-extension>
+ <mfp:facet-metadata>
+ <mfp:preferred>true</mfp:preferred>
+ </mfp:facet-metadata>
+ </facet-extension>
+ </facet>
+ <facet>
+ <description><![CDATA[]]></description>
+ <facet-name>bottom</facet-name>
+ <facet-extension>
+ <mfp:facet-metadata>
+ <mfp:preferred>true</mfp:preferred>
+ </mfp:facet-metadata>
+ </facet-extension>
+ </facet>
+
+ <property>
+ <description>
+ <![CDATA[]]>
+ </description>
+ <property-name>header</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <mfp:required>false</mfp:required>
+ <mfp:property-metadata>
+ <mfp:preferred>true</mfp:preferred>
+ </mfp:property-metadata>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ <![CDATA[]]>
+ </description>
+ <property-name>footer</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <mfp:required>false</mfp:required>
+ <mfp:property-metadata>
+ <mfp:preferred>true</mfp:preferred>
+ </mfp:property-metadata>
+ </property-extension>
+ </property>
+
+ <xi:include href="includes/CommonAttrs.xml" xpointer="/faces-config/component/*"/>
+ <xi:include href="includes/CoreJSEvents.xml" xpointer="/faces-config/component/*"/>
+
+ <component-extension>
+ <mfp:component-supertype>org.apache.myfaces.trinidad.Panel</mfp:component-supertype>
+ <mfp:renderer-type>org.apache.myfaces.trinidad.TestSubRenderer</mfp:renderer-type>
+ <mfp:tag-name>tr:testSubRenderer</mfp:tag-name>
+ <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.core.layout.CoreTestSubRendererTag</mfp:tag-class>
+ <mfp:long-description><![CDATA[Test]]>
+ </mfp:long-description>
+ </component-extension>
+ </component>
+</faces-config>
Propchange: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/TestSubRendererComponent.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/renderers/trinidad/TestSubRenderer.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/renderers/trinidad/TestSubRenderer.xml?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/renderers/trinidad/TestSubRenderer.xml (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/renderers/trinidad/TestSubRenderer.xml Fri Apr 11 20:57:10 2008
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin">
+ <render-kit>
+ <render-kit-id>org.apache.myfaces.trinidadinternal.core</render-kit-id>
+ <renderer>
+ <component-family>org.apache.myfaces.trinidad.Panel</component-family>
+ <renderer-type>org.apache.myfaces.trinidad.TestSubRenderer</renderer-type>
+ <renderer-class>
+ org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.TestSubRendererRenderer2
+ </renderer-class>
+ <renderer-extension>
+ <mfp:component-type>org.apache.myfaces.trinidad.CoreTestSubRenderer</mfp:component-type>
+ </renderer-extension>
+ </renderer>
+ <renderer>
+ <component-family>org.apache.myfaces.trinidad.Panel</component-family>
+ <renderer-type>org.apache.myfaces.trinidad.TestSubRendererHeader</renderer-type>
+ <renderer-class>
+ org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.TestSubRendererHeaderRenderer
+ </renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.apache.myfaces.trinidad.Panel</component-family>
+ <renderer-type>org.apache.myfaces.trinidad.TestSubRendererFooter</renderer-type>
+ <renderer-class>
+ org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.TestSubRendererFooterRenderer
+ </renderer-class>
+ </renderer>
+ </render-kit>
+</faces-config>
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-examples/trinidad-demo/src/main/webapp/components/testSubRenderer.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-examples/trinidad-demo/src/main/webapp/components/testSubRenderer.jspx?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-examples/trinidad-demo/src/main/webapp/components/testSubRenderer.jspx (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-examples/trinidad-demo/src/main/webapp/components/testSubRenderer.jspx Fri Apr 11 20:57:10 2008
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
+ xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:trh="http://myfaces.apache.org/trinidad/html"
+ xmlns:tr="http://myfaces.apache.org/trinidad">
+ <jsp:directive.page contentType="text/html;charset=utf-8"/>
+ <f:view>
+ <tr:document title="TestSubRenderer Demo">
+ <tr:form>
+ <tr:panelGroupLayout layout="vertical">
+ <f:facet name="separator">
+ <tr:separator/>
+ </f:facet>
+ <tr:panelGroupLayout layout="horizontal">
+ <tr:commandLink immediate="true" text="Component Guide" action="guide"/>
+ </tr:panelGroupLayout>
+ <tr:outputFormatted styleUsage="instruction" value="<b>testSubRenderer</b>"/>
+ <tr:testSubRenderer binding="#{editor.component}" footer="This is the footer">
+ <f:facet name="top">
+ <tr:outputText value="This is the top"/>
+ </f:facet>
+ <tr:outputText value="Body"/>
+ </tr:testSubRenderer>
+ <jsp:directive.include file="editor.jspf"/>
+ </tr:panelGroupLayout>
+ </tr:form>
+ </tr:document>
+ </f:view>
+</jsp:root>
Propchange: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-examples/trinidad-demo/src/main/webapp/components/testSubRenderer.jspx
------------------------------------------------------------------------------
svn:eol-style = native
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererFooterRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererFooterRenderer.java?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererFooterRenderer.java (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererFooterRenderer.java Fri Apr 11 20:57:10 2008
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.trinidad.bean.FacesBean;
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.bean.FacesBean.Type;
+import org.apache.myfaces.trinidad.component.core.layout.TestSubRenderer;
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.util.ComponentUtils;
+
+/**
+ * @version $Name: $ $
+ */
+public class TestSubRendererFooterRenderer extends XhtmlRenderer
+{
+ private PropertyKey _footerKey;
+
+ public TestSubRendererFooterRenderer()
+ {
+ super(TestSubRenderer.TYPE);
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#shouldRenderId(
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ protected boolean shouldRenderId(FacesContext context, UIComponent component)
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#findTypeConstants(
+ * org.apache.myfaces.trinidad.bean.FacesBean.Type)
+ */
+ @Override
+ protected void findTypeConstants(Type type)
+ {
+ super.findTypeConstants(type);
+ _footerKey = type.findKey("footer");
+ }
+
+ protected String getFooter(FacesBean bean)
+ {
+ return ComponentUtils.resolveString(bean.getProperty(_footerKey), (String)_footerKey.getDefault());
+ }
+
+ @Override
+ protected void encodeAll(
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
+ {
+ ResponseWriter writer = context.getResponseWriter();
+ String str;
+ UIComponent facet = getFacet(component, TestSubRenderer.BOTTOM_FACET);
+ if (facet != null)
+ {
+ writer.startElement("div", component);
+ encodeChild(context, facet);
+ writer.endElement("div");
+ }
+ else if ((str = getFooter(bean)) != null)
+ {
+ writer.startElement("div", component);
+ writer.writeText(str, null);
+ writer.endElement("div");
+ }
+ }
+}
Propchange: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererFooterRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererHeaderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererHeaderRenderer.java?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererHeaderRenderer.java (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererHeaderRenderer.java Fri Apr 11 20:57:10 2008
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.trinidad.bean.FacesBean;
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.bean.FacesBean.Type;
+import org.apache.myfaces.trinidad.component.core.layout.TestSubRenderer;
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.util.ComponentUtils;
+
+/**
+ * @version $Name: $ $
+ */
+public class TestSubRendererHeaderRenderer extends XhtmlRenderer
+{
+ private PropertyKey _headerKey;
+
+ public TestSubRendererHeaderRenderer()
+ {
+ super(TestSubRenderer.TYPE);
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#shouldRenderId(
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ protected boolean shouldRenderId(FacesContext context, UIComponent component)
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#findTypeConstants(
+ * org.apache.myfaces.trinidad.bean.FacesBean.Type)
+ */
+ @Override
+ protected void findTypeConstants(Type type)
+ {
+ super.findTypeConstants(type);
+ _headerKey = type.findKey("header");
+ }
+
+ protected String getHeader(FacesBean bean)
+ {
+ return ComponentUtils.resolveString(bean.getProperty(_headerKey), (String)_headerKey.getDefault());
+ }
+
+ @Override
+ protected void encodeAll(
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
+ {
+ ResponseWriter writer = context.getResponseWriter();
+
+ UIComponent facet = getFacet(component, TestSubRenderer.TOP_FACET);
+ String str;
+ if (facet != null)
+ {
+ writer.startElement("div", component);
+ encodeChild(context, facet);
+ writer.endElement("div");
+ }
+ else if ((str = getHeader(bean)) != null)
+ {
+ writer.startElement("div", component);
+ writer.writeText(str, null);
+ writer.endElement("div");
+ }
+ }
+}
Propchange: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererHeaderRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer.java?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer.java (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer.java Fri Apr 11 20:57:10 2008
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.trinidad.bean.FacesBean;
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.bean.FacesBean.Type;
+import org.apache.myfaces.trinidad.component.core.layout.TestSubRenderer;
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.util.ComponentUtils;
+
+/**
+ * @version $Name: $ $
+ */
+public class TestSubRendererRenderer extends XhtmlRenderer
+{
+ private PropertyKey _headerKey;
+ private PropertyKey _footerKey;
+
+ public TestSubRendererRenderer()
+ {
+ super(TestSubRenderer.TYPE);
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#getDefaultStyleClass(
+ * org.apache.myfaces.trinidad.bean.FacesBean)
+ */
+ @Override
+ protected String getDefaultStyleClass(FacesBean bean)
+ {
+ return "af|testSubRenderer";
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#shouldRenderId(
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ protected boolean shouldRenderId(FacesContext context, UIComponent component)
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#findTypeConstants(
+ * org.apache.myfaces.trinidad.bean.FacesBean.Type)
+ */
+ @Override
+ protected void findTypeConstants(Type type)
+ {
+ super.findTypeConstants(type);
+ _headerKey = type.findKey("header");
+ _footerKey = type.findKey("footer");
+ }
+
+ protected String getHeader(FacesBean bean)
+ {
+ return ComponentUtils.resolveString(bean.getProperty(_headerKey), (String)_headerKey.getDefault());
+ }
+
+ protected String getFooter(FacesBean bean)
+ {
+ return ComponentUtils.resolveString(bean.getProperty(_footerKey), (String)_footerKey.getDefault());
+ }
+
+ @Override
+ protected void encodeAll(
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
+ {
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement("div", component);
+ renderAllAttributes(context, rc, bean, true);
+
+ UIComponent facet = getFacet(component, TestSubRenderer.TOP_FACET);
+ String str;
+ if (facet != null)
+ {
+ writer.startElement("div", component);
+ encodeChild(context, facet);
+ writer.endElement("div");
+ }
+ else if ((str = getHeader(bean)) != null)
+ {
+ writer.startElement("div", component);
+ writer.writeText(str, null);
+ writer.endElement("div");
+ }
+
+ writer.startElement("div", component);
+ encodeAllChildren(context, component);
+ writer.endElement("div");
+
+ facet = getFacet(component, TestSubRenderer.BOTTOM_FACET);
+ if (facet != null)
+ {
+ writer.startElement("div", component);
+ encodeChild(context, facet);
+ writer.endElement("div");
+ }
+ else if ((str = getFooter(bean)) != null)
+ {
+ writer.startElement("div", component);
+ writer.writeText(str, null);
+ writer.endElement("div");
+ }
+ writer.endElement("div");
+ }
+}
Propchange: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer2.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer2.java?rev=647372&view=auto
==============================================================================
--- myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer2.java (added)
+++ myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer2.java Fri Apr 11 20:57:10 2008
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.trinidad.bean.FacesBean;
+import org.apache.myfaces.trinidad.bean.FacesBean.Type;
+import org.apache.myfaces.trinidad.component.core.layout.TestSubRenderer;
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.render.CoreRenderer;
+
+/**
+ * @version $Name: $ $
+ */
+public class TestSubRendererRenderer2 extends XhtmlRenderer
+{
+ private CoreRenderer _headerRenderer;
+ private CoreRenderer _footerRenderer;
+
+ public TestSubRendererRenderer2()
+ {
+ super(TestSubRenderer.TYPE);
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#getDefaultStyleClass(
+ * org.apache.myfaces.trinidad.bean.FacesBean)
+ */
+ @Override
+ protected String getDefaultStyleClass(FacesBean bean)
+ {
+ return "af|testSubRenderer";
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#shouldRenderId(
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ protected boolean shouldRenderId(FacesContext context, UIComponent component)
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#findTypeConstants(
+ * org.apache.myfaces.trinidad.bean.FacesBean.Type)
+ */
+ @Override
+ protected void findTypeConstants(Type type)
+ {
+ super.findTypeConstants(type);
+ _headerRenderer = (CoreRenderer)FacesContext.getCurrentInstance().getRenderKit().getRenderer(
+ TestSubRenderer.COMPONENT_FAMILY, "org.apache.myfaces.trinidad.TestSubRendererHeader");
+ _footerRenderer = (CoreRenderer)FacesContext.getCurrentInstance().getRenderKit().getRenderer(
+ TestSubRenderer.COMPONENT_FAMILY, "org.apache.myfaces.trinidad.TestSubRendererFooter");
+ }
+
+ @Override
+ protected void encodeAll(
+ FacesContext context,
+ RenderingContext rc,
+ UIComponent component,
+ FacesBean bean
+ ) throws IOException
+ {
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement("div", component);
+ renderAllAttributes(context, rc, bean, true);
+
+ delegateRenderer(context, rc, component, bean, _headerRenderer);
+ writer.startElement("div", component);
+ encodeAllChildren(context, component);
+ writer.endElement("div");
+ delegateRenderer(context, rc, component, bean, _footerRenderer);
+ writer.endElement("div");
+ }
+}
Propchange: myfaces/trinidad/branches/ar_subRendererPerfTesting/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TestSubRendererRenderer2.java
------------------------------------------------------------------------------
svn:eol-style = native