incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r449872 - in /incubator/adffaces/trunk/trinidad: trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/ trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/ trinidad-build/src/main/resource...
Date Tue, 26 Sep 2006 00:22:25 GMT
Author: awiner
Date: Mon Sep 25 17:22:24 2006
New Revision: 449872

URL: http://svn.apache.org/viewvc?view=rev&rev=449872
Log:
Patch for ADFFACES-197: tr:group should not render any content - it's just a grouping mechanism.
 It also no longer has a renderer, and CoreGroup is history - just use UIXGroup.

Added:
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXGroupTemplate.java
Removed:
    incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreGroup.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/GroupRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimal-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimalIE-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimalIERtl-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimalInacc-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimalPPC-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimalSaf-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/group-minimalScrRdr-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/group.xml
Modified:
    incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Group.xml
    incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/components/group.jspx

Added: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXGroupTemplate.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXGroupTemplate.java?view=auto&rev=449872
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXGroupTemplate.java
(added)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXGroupTemplate.java
Mon Sep 25 17:22:24 2006
@@ -0,0 +1,68 @@
+/*
+ * Copyright  2003-2006 The Apache Software Foundation.
+ * 
+ * Licensed 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.trinidad.component;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+
+/**
+ * Base class for the group componnet.
+ * <p>
+ * @version $Name:  $ ($Revision: 429530 $) $Date: 2006-08-07 18:44:54 -0600 (Mon, 07 Aug
2006) $
+ * @author The Oracle ADF Faces Team
+ */
+abstract public class UIXGroupTemplate extends UIXComponentBase
+{
+  /**
+   * Overridden to return true.
+   * @return true because the children are rendered by this component
+   */
+  @Override
+  public boolean getRendersChildren()
+  {
+    return true;
+  }
+
+  /**
+   * Renders the children in their raw form.
+   * There is no Renderer for this component because it has no
+   * visual representation or any sort of layout for its children.
+   * @param context the FacesContext
+   * @throws IOException if there is an error encoding the children
+   */
+  @Override
+  public void encodeChildren(FacesContext context) throws IOException
+  {
+    if (context == null)
+      throw new NullPointerException();
+
+    if (!isRendered())
+      return;
+
+    if (getChildCount() > 0)
+    {
+      for(UIComponent child : (List<UIComponent>)getChildren())
+      {
+        __encodeRecursive(context, child);
+      }
+    }
+  }
+}
+

Modified: incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Group.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Group.xml?view=diff&rev=449872&r1=449871&r2=449872
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Group.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Group.xml
Mon Sep 25 17:22:24 2006
@@ -21,8 +21,11 @@
               xmlns:mafp="http://myfaces.apache.org/maven-trinidad-plugin"
               xmlns:xhtml="http://www.w3.org/1999/xhtml">
   <component>
-    <description><![CDATA[Group is the base abstraction for components that contain
-a group of semantically-related children.]]>
+    <description><![CDATA[The group component is an invisible control that aggregates
semantically-related children; the group itself has no associated client representation (visual
or API).
+Some parent components may have special representation for groups like adding separators
around the group but this is a special case and is not always rendered this way.
+In most cases, only the children of the group will be rendered directly to the page.
+There will be no layout applied to the children so the natural layout behavior of the underlying
HTML elements will apply.
+If you require a more predictable layout, you should use a layout component such as panelGroupLayout.]]>
     </description>
     <icon>
       <small-icon>/org/apache/myfaces/trinidad/metadata/icons/group.png</small-icon>
@@ -32,12 +35,31 @@
     <component-extension>
       <mfp:component-family>org.apache.myfaces.trinidad.Group</mfp:component-family>
       <mfp:component-supertype>org.apache.myfaces.trinidad.ComponentBase</mfp:component-supertype>
+      <mfp:tag-name>tr:group</mfp:tag-name>
       <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.UIXGroupTag</mfp:tag-class>
-      <mfp:long-description><![CDATA[Group is the base abstraction for components
that contain
-a group semantically-related children.]]>
+      <mfp:long-description><![CDATA[The group component is an invisible control
that aggregates semantically-related children; the group itself has no associated client representation
(visual or API).
+Some parent components may have special representation for groups like adding separators
around the group but this is a special case and is not always rendered this way.
+In most cases, only the children of the group will be rendered directly to the page.
+There will be no layout applied to the children so the natural layout behavior of the underlying
HTML elements will apply.
+If you require a more predictable layout, you should use a layout component such as panelGroupLayout.]]>
       </mfp:long-description>
+      <mfp:example>
+        <mfp:source-code><![CDATA[
+          <tr:panelFormLayout labelWidth="33%" fieldWidth="67%">
+  <tr:inputText label="non-group item 1"/>
+  <tr:group>
+    <tr:inputText label="group item 1"/>
+    <tr:inputText label="group item 2"/>
+    <tr:inputText label="group item 3"/>
+  </tr:group>
+  <tr:inputText label="non-group item 2"/>
+</tr:panelFormLayout>]]>
+        </mfp:source-code>
+      </mfp:example>
       <mfp:author>Matt Cooper</mfp:author>
-      <mfp:tag-class-modifier>abstract</mfp:tag-class-modifier>
+      <mfp:component-metadata>
+        <mfp:group>${md:getTranslatedString("PALETTE_OTHER")}</mfp:group>
+      </mfp:component-metadata>
     </component-extension>
   </component>
 </faces-config>

Modified: incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/components/group.jspx
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/components/group.jspx?view=diff&rev=449872&r1=449871&r2=449872
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/components/group.jspx
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/components/group.jspx
Mon Sep 25 17:22:24 2006
@@ -29,43 +29,24 @@
           <tr:commandLink immediate="true" text="Component Guide"
             action="guide"/>
           <tr:outputText
-            value="The group component is an invisible control that aggregates semantically-related
children.
-The children of the group will not be displayed unless the parent of the group has specific
support for displaying the grouped children.
-The panelForm is an example of one of the components that has support for grouping its children
components.
-If you place panelForm child items inside of a group, separators will be drawn around the
group of form items if adjacent to other form items (separators won't be drawn at the top
if the group is the first item in the column or, similarly, at the bottom if the group is
the last item in the column).
-Grouped panelForm items are kept in the same column of the panelForm even when the assigned
rows attribute is set to a value smaller than the number of items in the group.
-The panelForm component also supports the group component in its footer facet so you can
place more than one item in the footer.  You can even group footer items one additional time
to get separators to appear."/>
+            value="The group component is an invisible control that aggregates semantically-related
children; the group itself has no associated client representation (visual or API).
+Some parent components may have special representation for groups like adding separators
around the group but this is a special case and is not always rendered this way.
+In most cases, only the children of the group will be rendered directly to the page.
+There will be no layout applied to the children so the natural layout behavior of the underlying
HTML elements will apply.
+If you require a more predictable layout, you should use a layout component such as panelGroupLayout."/>
           <tr:outputText
-            value="This is a demo page for a panelForm (drawn with a thick red border) that
uses various group components around its form items."/>
-          <tr:panelFormLayout labelWidth="50%" fieldWidth="50%" rows="6"
-            inlineStyle="border: 4px solid red;">
-            <tr:inputText columns="10" label="main item 1"/>
-            <tr:inputText columns="10" label="main item 2"/>
-            <tr:inputText columns="10" label="main item 3"/>
-            <tr:inputText columns="10" label="main item 4"/>
-            <tr:inputText columns="10" label="main item 5"/>
-            <tr:inputText columns="10" label="main item 6"/>
-            <tr:inputText columns="10" label="main item 7"/>
-            <tr:group binding="#{editor.component}">
-              <tr:inputText columns="10" label="grouped item 1"/>
-              <tr:inputText columns="10" label="grouped item 2"/>
-            </tr:group>
-            <tr:inputText columns="10" label="main item 8"/>
-            <tr:inputText columns="10" label="main item 9"/>
-            <tr:inputText columns="10" label="main item 10"/>
-            <f:facet name="footer">
-              <tr:group>
-                <tr:inputText columns="10" label="grouped footer item 1"/>
-                <tr:inputText columns="10" label="grouped footer item 2"/>
-                <tr:group>
-                  <tr:inputText columns="10" label="double grouped footer item 1"/>
-                  <tr:inputText columns="10" label="double grouped footer item 2"/>
-                </tr:group>
-                <tr:inputText columns="10" label="grouped footer item 3"/>
-                <tr:inputText columns="10" label="grouped footer item 4"/>
+            value="The following demo shows a vertical panelGroupLayout with a separator
facet containing a
+group that has two images directly inside of it."/>
+          <tr:panelGroupLayout layout="vertical">
+            <f:facet name="separator">
+              <tr:group binding="#{editor.component}">
+                <tr:image shortDesc="File" source="/components/images/file.gif"/>
+                <tr:image shortDesc="Check" source="/components/images/processCheck.gif"/>
               </tr:group>
             </f:facet>
-          </tr:panelFormLayout>
+            <tr:outputText value="Item 1"/>
+            <tr:outputText value="Item 2"/>
+          </tr:panelGroupLayout>
           <jsp:directive.include file="editor.jspf"/>
         </tr:panelGroupLayout>
       </tr:form>



Mime
View raw message