tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r565921 - in /tapestry/tapestry4/trunk: tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/ tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/ tapestry-contrib/src/java/org/apache/tapestry/contrib/table/m...
Date Tue, 14 Aug 2007 21:29:47 GMT
Author: jkuhnert
Date: Tue Aug 14 14:29:46 2007
New Revision: 565921

URL: http://svn.apache.org/viewvc?view=rev&rev=565921
Log:
-) Implemented missing AbstractTableColumn patch from TAPESTRY-234 contributed from Matt Raible
which handles some of the regexp irregularities in dealing with column names && periods.


-) Cleaned up the tag rendering of some of the table page related components. 

-) Re-implemented slightly better handling of TAPESTRY-234 which was applied when the ticket
was closed the first time.

Modified:
    tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/Table.jwc
    tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TableFormPages.jwc
    tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TablePages.jwc
    tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/ITableModelSource.java
    tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java
    tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/simple/SimpleTableColumn.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/TapestryUtils.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java

Modified: tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/Table.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/Table.jwc?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/Table.jwc
(original)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/Table.jwc
Tue Aug 14 14:29:46 2007
@@ -224,19 +224,23 @@
   
 	<component id="tableElement" type="Any" inherit-informal-parameters="yes">
 		<binding name="element">literal:table</binding>
-	</component>
+    </component>
 
 	<component id="condPages" type="If">
 		<binding name="condition" value="tableModel.pageCount > 1"/>
-	</component>
+        <binding name="renderTag" value="false" />
+    </component>
 
 	<component id="ifNormalPages" type="If">
 		<binding name="condition" value="showNormalPages"/>
-	</component>
+        <binding name="renderTag" value="false" />
+    </component>
 
-	<component id="elseFormPages" type="Else"/>
+	<component id="elseFormPages" type="Else">
+        <binding name="renderTag" value="false" />
+    </component>
 
-	<component id="tableView" type="TableView">
+    <component id="tableView" type="TableView">
 		<inherited-binding name="tableModel" parameter-name="tableModel"/>
 		<inherited-binding name="source" parameter-name="source"/>
 		<inherited-binding name="columns" parameter-name="columns"/>

Modified: tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TableFormPages.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TableFormPages.jwc?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TableFormPages.jwc
(original)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TableFormPages.jwc
Tue Aug 14 14:29:46 2007
@@ -15,105 +15,107 @@
    limitations under the License.
 -->
 
-<!DOCTYPE component-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-	
-<component-specification class="org.apache.tapestry.contrib.table.components.TableFormPages"

-	allow-body="no" allow-informal-parameters="yes">
-	
-	<description>
-        A version of TablePages that is designed for operation in a form. 
-        It is a low level Table component that renders the pages in the table. 
-        This component must be wrapped by TableView. 
-	</description>
-  
-	<parameter name="pagesDisplayed" 
-		type="int" 
-		required="no"
-		direction="auto"
-    	default-value="7">
-		<description>
-            Determines the maximum number of pages to be displayed in the page list 
-            when the table has more than one page. 
+<!DOCTYPE component-specification PUBLIC
+        "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+        "http://tapestry.apache.org/dtd/Tapestry_3_0.dtd">
+
+<component-specification class="org.apache.tapestry.contrib.table.components.TableFormPages"
+                         allow-body="no" allow-informal-parameters="yes">
+
+    <description>
+        A version of TablePages that is designed for operation in a form.
+        It is a low level Table component that renders the pages in the table.
+        This component must be wrapped by TableView.
+    </description>
+
+    <parameter name="pagesDisplayed"
+               type="int"
+               required="no"
+               direction="auto"
+               default-value="7">
+        <description>
+            Determines the maximum number of pages to be displayed in the page list
+            when the table has more than one page.
         </description>
     </parameter>
-  
-	<component id="informal" type="Any" inherit-informal-parameters="yes"/>
-  
-	<property-specification name="selectedPage" type="int"/>
-  
-	<component id="hiddenCurrentPage" type="Hidden">
-		<binding name="value" expression="currentPage"/>
-	</component>
-  
-	<component id="hiddenPageCount" type="Hidden">
-		<binding name="value" expression="pageCount"/>
-	</component>
-  
-	<component id="hiddenStartPage" type="Hidden">
-		<binding name="value" expression="startPage"/>
-	</component>
-  
-	<component id="hiddenStopPage" type="Hidden">
-		<binding name="value" expression="stopPage"/>
-	</component>
-  
-	<component id="condCurrent" type="If">
-		<binding name="condition" expression="condCurrent"/>
-		<binding name="volatile" expression="true"/>
-	</component>
-  
-	<component id="condOther" type="Else">
-	</component>
-  
-	<component id="iterPage" type="For">
-		<binding name="source" expression="pageList"/>
-		<binding name="value" expression="displayPage"/>
-		<binding name="volatile" expression="true"/>
+
+    <component id="informal" type="Any" inherit-informal-parameters="yes"/>
+
+    <property-specification name="selectedPage" type="int"/>
+
+    <component id="hiddenCurrentPage" type="Hidden">
+        <binding name="value" expression="currentPage"/>
+    </component>
+
+    <component id="hiddenPageCount" type="Hidden">
+        <binding name="value" expression="pageCount"/>
+    </component>
+
+    <component id="hiddenStartPage" type="Hidden">
+        <binding name="value" expression="startPage"/>
+    </component>
+
+    <component id="hiddenStopPage" type="Hidden">
+        <binding name="value" expression="stopPage"/>
+    </component>
+
+    <component id="condCurrent" type="If">
+        <binding name="condition" expression="condCurrent"/>
+        <binding name="volatile" expression="true"/>
+        <binding name="renderTag" expression="false" />
+    </component>
+
+    <component id="condOther" type="Else">
+        <binding name="renderTag" expression="false" />
+    </component>
+
+    <component id="iterPage" type="For">
+        <binding name="source" expression="pageList"/>
+        <binding name="value" expression="displayPage"/>
+        <binding name="volatile" expression="true"/>
         <binding name="renderTag" expression="false" />
-	</component>
+    </component>
 
-	<component id="insertCurrentPage" type="Insert">
-	    <binding name="value" expression="displayPage"/>
-	</component>
-
-	<component id="insertOtherPage" type="Insert">
-	    <binding name="value" expression="displayPage"/>
-	</component>
-
-	<component id="linkPage" type="LinkSubmit">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="tag" expression="displayPage"/>
-	    <binding name="selected" expression="selectedPage"/>
-	</component>
-
-	<component id="linkFirst" type="LinkSubmit">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="tag" expression="1"/>
-	    <binding name="selected" expression="selectedPage"/>
-	    <binding name="disabled" expression="!condBack"/>
-	</component>
-
-	<component id="linkBack" type="LinkSubmit">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="tag" expression="currentPage - 1"/>
-	    <binding name="selected" expression="selectedPage"/>
-	    <binding name="disabled" expression="!condBack"/>
-	</component>
-
-	<component id="linkFwd" type="LinkSubmit">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="tag" expression="currentPage + 1"/>
-	    <binding name="selected" expression="selectedPage"/>
-	    <binding name="disabled" expression="!condFwd"/>
-	</component>
-	
-	<component id="linkLast" type="LinkSubmit">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="tag" expression="pageCount"/>
-	    <binding name="selected" expression="selectedPage"/>
-	    <binding name="disabled" expression="!condFwd"/>
-	</component>
+    <component id="insertCurrentPage" type="Insert">
+        <binding name="value" expression="displayPage"/>
+    </component>
+
+    <component id="insertOtherPage" type="Insert">
+        <binding name="value" expression="displayPage"/>
+    </component>
+
+    <component id="linkPage" type="LinkSubmit">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="tag" expression="displayPage"/>
+        <binding name="selected" expression="selectedPage"/>
+    </component>
+
+    <component id="linkFirst" type="LinkSubmit">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="tag" expression="1"/>
+        <binding name="selected" expression="selectedPage"/>
+        <binding name="disabled" expression="!condBack"/>
+    </component>
+
+    <component id="linkBack" type="LinkSubmit">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="tag" expression="currentPage - 1"/>
+        <binding name="selected" expression="selectedPage"/>
+        <binding name="disabled" expression="!condBack"/>
+    </component>
+
+    <component id="linkFwd" type="LinkSubmit">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="tag" expression="currentPage + 1"/>
+        <binding name="selected" expression="selectedPage"/>
+        <binding name="disabled" expression="!condFwd"/>
+    </component>
+
+    <component id="linkLast" type="LinkSubmit">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="tag" expression="pageCount"/>
+        <binding name="selected" expression="selectedPage"/>
+        <binding name="disabled" expression="!condFwd"/>
+    </component>
 
 </component-specification>

Modified: tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TablePages.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TablePages.jwc?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TablePages.jwc
(original)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/components/TablePages.jwc
Tue Aug 14 14:29:46 2007
@@ -15,79 +15,81 @@
    limitations under the License.
 -->
 
-<!DOCTYPE component-specification PUBLIC 
-  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
-  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
-	
-<component-specification class="org.apache.tapestry.contrib.table.components.TablePages"

-	allow-body="no" allow-informal-parameters="yes">
-	
-	<description>
-        A low level Table component that renders the pages in the table. 
-        This component must be wrapped by TableView. 
-	</description>
-  
-	<parameter name="pagesDisplayed" 
-		type="int" 
-		required="no"
-		direction="auto"
-    	default-value="7">
-		<description>
-            Determines the maximum number of pages to be displayed in the page list 
-            when the table has more than one page. 
+<!DOCTYPE component-specification PUBLIC
+        "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+        "http://tapestry.apache.org/dtd/Tapestry_3_0.dtd">
+
+<component-specification class="org.apache.tapestry.contrib.table.components.TablePages"
+                         allow-body="no" allow-informal-parameters="yes">
+
+    <description>
+        A low level Table component that renders the pages in the table.
+        This component must be wrapped by TableView.
+    </description>
+
+    <parameter name="pagesDisplayed"
+               type="int"
+               required="no"
+               direction="auto"
+               default-value="7">
+        <description>
+            Determines the maximum number of pages to be displayed in the page list
+            when the table has more than one page.
         </description>
     </parameter>
 
-	<component id="informal" type="Any" inherit-informal-parameters="yes"/>
-  
-	<component id="condCurrent" type="If">
-		<binding name="condition" expression="condCurrent"/>
-	</component>
-  
-	<component id="condOther" type="Else">
-	</component>
-  
-	<component id="iterPage" type="For">
-		<binding name="source" expression="pageList"/>
-		<binding name="value" expression="displayPage"/>
+    <component id="informal" type="Any" inherit-informal-parameters="yes"/>
+
+    <component id="condCurrent" type="If">
+        <binding name="condition" expression="condCurrent"/>
+        <binding name="renderTag" expression="false" />
+    </component>
+
+    <component id="condOther" type="Else">
         <binding name="renderTag" expression="false" />
-	</component>
+    </component>
+
+    <component id="iterPage" type="For">
+        <binding name="source" expression="pageList"/>
+        <binding name="value" expression="displayPage"/>
+        <binding name="renderTag" expression="false" />
+    </component>
+
+    <component id="insertCurrentPage" type="Insert">
+        <binding name="value" expression="displayPage"/>
+    </component>
+
+    <component id="insertOtherPage" type="Insert">
+        <binding name="value" expression="displayPage"/>
+    </component>
+
+    <component id="linkPage" type="DirectLink">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="parameters" expression="displayPageContext"/>
+    </component>
+
+    <component id="linkFirst" type="DirectLink">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="parameters" expression="firstPageContext"/>
+        <binding name="disabled" expression="!condBack"/>
+    </component>
+
+    <component id="linkBack" type="DirectLink">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="parameters" expression="backPageContext"/>
+        <binding name="disabled" expression="!condBack"/>
+    </component>
+
+    <component id="linkFwd" type="DirectLink">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="parameters" expression="fwdPageContext"/>
+        <binding name="disabled" expression="!condFwd"/>
+    </component>
+
+    <component id="linkLast" type="DirectLink">
+        <binding name="listener" expression="listeners.changePage"/>
+        <binding name="parameters" expression="lastPageContext"/>
+        <binding name="disabled" expression="!condFwd"/>
+    </component>
 
-	<component id="insertCurrentPage" type="Insert">
-	    <binding name="value" expression="displayPage"/>
-	</component>
-
-	<component id="insertOtherPage" type="Insert">
-	    <binding name="value" expression="displayPage"/>
-	</component>
-
-	<component id="linkPage" type="DirectLink">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="parameters" expression="displayPageContext"/>
-	</component>
-
-	<component id="linkFirst" type="DirectLink">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="parameters" expression="firstPageContext"/>
-	    <binding name="disabled" expression="!condBack"/>
-	</component>
-
-	<component id="linkBack" type="DirectLink">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="parameters" expression="backPageContext"/>
-	    <binding name="disabled" expression="!condBack"/>
-	</component>
-
-	<component id="linkFwd" type="DirectLink">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="parameters" expression="fwdPageContext"/>
-	    <binding name="disabled" expression="!condFwd"/>
-	</component>
-	
-	<component id="linkLast" type="DirectLink">
-	    <binding name="listener" expression="listeners.changePage"/>
-	    <binding name="parameters" expression="lastPageContext"/>
-	    <binding name="disabled" expression="!condFwd"/>
-	</component>
-	
 </component-specification>

Modified: tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/ITableModelSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/ITableModelSource.java?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/ITableModelSource.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/ITableModelSource.java
Tue Aug 14 14:29:46 2007
@@ -48,6 +48,9 @@
 
     /**
      * Stores the provided table action.
+     *
+     * @param action
+     *          The action to store.
      */
     void storeTableAction(ITableAction action);
 

Modified: tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java
Tue Aug 14 14:29:46 2007
@@ -14,9 +14,6 @@
 
 package org.apache.tapestry.contrib.table.model.common;
 
-import java.io.Serializable;
-import java.util.Comparator;
-
 import org.apache.tapestry.IComponent;
 import org.apache.tapestry.IRender;
 import org.apache.tapestry.IRequestCycle;
@@ -26,18 +23,20 @@
 import org.apache.tapestry.contrib.table.model.ITableRendererSource;
 import org.apache.tapestry.valid.RenderString;
 
+import java.io.Serializable;
+import java.util.Comparator;
+
 /**
  * A base implementation of
  * {@link org.apache.tapestry.contrib.table.model.ITableColumn} that allows
  * renderers to be set via aggregation.
- * 
+ *
  * @see org.apache.tapestry.contrib.table.model.ITableRendererSource
  * @author mindbridge
  * @since 2.3
  */
 public class AbstractTableColumn implements IAdvancedTableColumn, Serializable
 {
-
     /**
      * The suffix of the name of the Block that will be used as the column
      * renderer for this column.
@@ -65,15 +64,15 @@
     }
 
     public AbstractTableColumn(String strColumnName, boolean bSortable,
-            Comparator objComparator)
+                               Comparator objComparator)
     {
         this(strColumnName, bSortable, objComparator, null, null);
     }
 
     public AbstractTableColumn(String strColumnName, boolean bSortable,
-            Comparator objComparator,
-            ITableRendererSource objColumnRendererSource,
-            ITableRendererSource objValueRendererSource)
+                               Comparator objComparator,
+                               ITableRendererSource objColumnRendererSource,
+                               ITableRendererSource objValueRendererSource)
     {
         setColumnName(strColumnName);
         setSortable(bSortable);
@@ -92,12 +91,15 @@
 
     /**
      * Sets the columnName.
-     * 
+     *
      * @param columnName
      *            The columnName to set
      */
     public void setColumnName(String columnName)
     {
+        if (columnName != null)
+            columnName = columnName.replace('.', '_');
+        
         m_strColumnName = columnName;
     }
 
@@ -111,7 +113,7 @@
 
     /**
      * Sets whether the column is sortable.
-     * 
+     *
      * @param sortable
      *            The sortable flag to set
      */
@@ -130,7 +132,7 @@
 
     /**
      * Sets the comparator.
-     * 
+     *
      * @param comparator
      *            The comparator to set
      */
@@ -144,9 +146,10 @@
      *      ITableModelSource)
      */
     public IRender getColumnRenderer(IRequestCycle objCycle,
-            ITableModelSource objSource)
+                                     ITableModelSource objSource)
     {
         ITableRendererSource objRendererSource = getColumnRendererSource();
+
         if (objRendererSource == null)
         {
             // log error
@@ -161,9 +164,10 @@
      *      ITableModelSource, Object)
      */
     public IRender getValueRenderer(IRequestCycle objCycle,
-            ITableModelSource objSource, Object objRow)
+                                    ITableModelSource objSource, Object objRow)
     {
         ITableRendererSource objRendererSource = getValueRendererSource();
+
         if (objRendererSource == null)
         {
             // log error
@@ -175,7 +179,7 @@
 
     /**
      * Returns the columnRendererSource.
-     * 
+     *
      * @return ITableColumnRendererSource
      */
     public ITableRendererSource getColumnRendererSource()
@@ -185,19 +189,19 @@
 
     /**
      * Sets the columnRendererSource.
-     * 
+     *
      * @param columnRendererSource
      *            The columnRendererSource to set
      */
     public void setColumnRendererSource(
-            ITableRendererSource columnRendererSource)
+      ITableRendererSource columnRendererSource)
     {
         m_objColumnRendererSource = columnRendererSource;
     }
 
     /**
      * Returns the valueRendererSource.
-     * 
+     *
      * @return the valueRendererSource of this column
      */
     public ITableRendererSource getValueRendererSource()
@@ -207,7 +211,7 @@
 
     /**
      * Sets the valueRendererSource.
-     * 
+     *
      * @param valueRendererSource
      *            The valueRendererSource to set
      */
@@ -220,33 +224,37 @@
      * Use the column name to get the column and value renderer sources from the
      * provided component. Use the column and value renderer sources for all
      * columns if necessary.
-     * 
-     * @param objSettingsContainer
+     *
+     * @param container
      *            the component from which to get the settings
      */
-    public void loadSettings(IComponent objSettingsContainer)
+    public void loadSettings(IComponent container)
     {
-        IComponent objColumnRendererSource = (IComponent) objSettingsContainer
-                .getComponents().get(
-                        getColumnName() + COLUMN_RENDERER_BLOCK_SUFFIX);
+        IComponent objColumnRendererSource =
+          (IComponent) container.getComponents().get(getColumnName() + COLUMN_RENDERER_BLOCK_SUFFIX);
+
         if (objColumnRendererSource == null)
-            objColumnRendererSource = (IComponent) objSettingsContainer
-                    .getComponents().get(COLUMN_RENDERER_BLOCK_SUFFIX);
+            objColumnRendererSource = (IComponent) container.getComponents().get(COLUMN_RENDERER_BLOCK_SUFFIX);
+
         if (objColumnRendererSource != null
-                && objColumnRendererSource instanceof Block)
-            setColumnRendererSource(new BlockTableRendererSource(
-                    (Block) objColumnRendererSource));
-
-        IComponent objValueRendererSource = (IComponent) objSettingsContainer
-                .getComponents().get(
-                        getColumnName() + VALUE_RENDERER_BLOCK_SUFFIX);
+            && objColumnRendererSource instanceof Block)
+        {
+            setColumnRendererSource(new BlockTableRendererSource((Block) objColumnRendererSource));
+        }
+
+        IComponent objValueRendererSource =
+          (IComponent) container.getComponents().get(getColumnName() + VALUE_RENDERER_BLOCK_SUFFIX);
+
         if (objValueRendererSource == null)
-            objValueRendererSource = (IComponent) objSettingsContainer
-                    .getComponents().get(VALUE_RENDERER_BLOCK_SUFFIX);
+        {
+            objValueRendererSource = (IComponent) container.getComponents().get(VALUE_RENDERER_BLOCK_SUFFIX);
+        }
+
         if (objValueRendererSource != null
-                && objValueRendererSource instanceof Block)
-            setValueRendererSource(new BlockTableRendererSource(
-                    (Block) objValueRendererSource));
+            && objValueRendererSource instanceof Block)
+        {
+            setValueRendererSource(new BlockTableRendererSource((Block) objValueRendererSource));
+        }
     }
 
 }

Modified: tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/simple/SimpleTableColumn.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/simple/SimpleTableColumn.java?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/simple/SimpleTableColumn.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/table/model/simple/SimpleTableColumn.java
Tue Aug 14 14:29:46 2007
@@ -14,13 +14,13 @@
 
 package org.apache.tapestry.contrib.table.model.simple;
 
-import java.io.Serializable;
-import java.util.Comparator;
-
 import org.apache.tapestry.IComponent;
 import org.apache.tapestry.contrib.table.model.ITableRendererSource;
 import org.apache.tapestry.contrib.table.model.common.AbstractTableColumn;
 
+import java.io.Serializable;
+import java.util.Comparator;
+
 /**
  * A simple minimal implementation of the
  * {@link org.apache.tapestry.contrib.table.model.ITableColumn}interface that
@@ -146,7 +146,6 @@
      */
     public String getDisplayName()
     {
-        m_strDisplayName.replace('.', '_'); // added from patch
         return m_strDisplayName;
     }
 
@@ -158,6 +157,9 @@
      */
     public void setDisplayName(String displayName)
     {
+        if (displayName != null)
+            displayName = displayName.replace(".", "_");
+        
         m_strDisplayName = displayName;
     }
 
@@ -223,15 +225,17 @@
      */
     public void loadSettings(IComponent objSettingsContainer)
     {
-        String strDisplayName = objSettingsContainer.getMessages().getMessage(
-                getColumnName());
+        String strDisplayName = objSettingsContainer.getMessages().getMessage(getColumnName());
 
         // Hack! the Messages inteface needs to restore the getMessage(key,
         // default), or needs
         // to add a containsKey(key) method. Looking for the '[' used with
         // invalid/unknown keys.
 
-        if (!strDisplayName.startsWith("[")) setDisplayName(strDisplayName);
+        if (!strDisplayName.startsWith("["))
+        {
+            setDisplayName(strDisplayName);
+        }
 
         super.loadSettings(objSettingsContainer);
     }
@@ -256,13 +260,16 @@
             boolean bComparable2 = objValue2 instanceof Comparable;
 
             // non-comparable values are considered equal
-            if (!bComparable1 && !bComparable2) return 0;
+            if (!bComparable1 && !bComparable2)
+                return 0;
 
             // non-comparable values (null included) are considered smaller
             // than the comparable ones
-            if (!bComparable1) return -1;
+            if (!bComparable1)
+                return -1;
 
-            if (!bComparable2) return 1;
+            if (!bComparable2)
+                return 1;
 
             return ((Comparable) objValue1).compareTo(objValue2);
         }

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/TapestryUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/TapestryUtils.java?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/TapestryUtils.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/TapestryUtils.java
Tue Aug 14 14:29:46 2007
@@ -14,17 +14,17 @@
 
 package org.apache.tapestry;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.HiveMind;
 import org.apache.hivemind.Location;
 import org.apache.hivemind.util.Defense;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Constants and static methods.
- * 
+ *
  * @author Howard M. Lewis Ship
  * @since 4.0
  */
@@ -33,9 +33,9 @@
     public static final String PAGE_RENDER_SUPPORT_ATTRIBUTE = "org.apache.tapestry.PageRenderSupport";
 
     public static final String FORM_ATTRIBUTE = "org.apache.tapestry.Form";
-    
+
     public static final String FIELD_PRERENDER = "org.apache.tapestry.form.Prerender";
-    
+
     private static final char QUOTE = '\'';
 
     private static final char BACKSLASH = '\\';
@@ -44,11 +44,11 @@
 
     /* defeat instantiation */
     private TapestryUtils() { }
-    
+
     /**
      * Stores an attribute into the request cycle, verifying that no object with that key
is already
      * present.
-     * 
+     *
      * @param cycle
      *            the cycle to store the attribute into
      * @param key
@@ -68,9 +68,9 @@
         Object existing = cycle.getAttribute(key);
         if (existing != null)
             throw new IllegalStateException(TapestryMessages.nonUniqueAttribute(
-                    object,
-                    key,
-                    existing));
+              object,
+              key,
+              existing));
 
         cycle.setAttribute(key, object);
     }
@@ -103,10 +103,10 @@
     {
         storeUniqueAttribute(cycle, FIELD_PRERENDER, component);
     }
-    
+
     /**
      * Gets the previously stored {@link org.apache.tapestry.PageRenderSupport}&nbsp;object.
-     * 
+     *
      * @param cycle
      *            the request cycle storing the support object
      * @param component
@@ -122,14 +122,14 @@
         PageRenderSupport result = getOptionalPageRenderSupport(cycle);
         if (result == null)
             throw new ApplicationRuntimeException(TapestryMessages.noPageRenderSupport(component),
-                    component.getLocation(), null);
+                                                  component.getLocation(), null);
 
         return result;
     }
 
     /**
      * Gets the previously stored {@link IForm} object.
-     * 
+     *
      * @param cycle
      *            the request cycle storing the support object
      * @param component
@@ -159,12 +159,12 @@
     {
         cycle.removeAttribute(FORM_ATTRIBUTE);
     }
-    
+
     public static void removePrerender(IRequestCycle cycle)
     {
         cycle.removeAttribute(FIELD_PRERENDER);
     }
-    
+
     /**
      * Returns the {@link PageRenderSupport}&nbsp;object if previously stored, or null
otherwise.
      * This is used in the rare case that a component wishes to adjust its behavior based
on whether
@@ -235,17 +235,17 @@
         return (String[]) strings.toArray(new String[strings.size()]);
     }
 
-	/**
-	 * Capitalize the first letter of the input if at least 1 character.
-	 */
-
-	public static String capitalize(String input)
-	{
-		if (input == null || input.length() < 1)
-			   return input;
+    /**
+     * Capitalize the first letter of the input if at least 1 character.
+     */
 
-		return input.substring(0, 1).toUpperCase() + input.substring(1);
-	}
+    public static String capitalize(String input)
+    {
+        if (input == null || input.length() < 1)
+            return input;
+
+        return input.substring(0, 1).toUpperCase() + input.substring(1);
+    }
 
     /**
      * Enquotes a string within single quotes, ready for insertion as part of a block of
JavaScript.
@@ -289,7 +289,7 @@
     public static String convertTapestryIdToNMToken(String baseId)
     {
         String result = baseId.replace('$', '_');
-        
+
         while (result.startsWith("_"))
             result = result.substring(1);
 
@@ -313,7 +313,7 @@
      */
 
     public static IComponent getComponent(IComponent container, String componentId,
-            Class expectedType, Location location)
+                                          Class expectedType, Location location)
     {
         Defense.notNull(container, "container");
         Defense.notNull(componentId, "componentId");
@@ -333,8 +333,8 @@
 
         if (!expectedType.isAssignableFrom(component.getClass()))
             throw new ApplicationRuntimeException(TapestryMessages.componentWrongType(
-                    component,
-                    expectedType), location, null);
+              component,
+              expectedType), location, null);
 
         return component;
     }

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java?view=diff&rev=565921&r1=565920&r2=565921
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java
Tue Aug 14 14:29:46 2007
@@ -28,21 +28,21 @@
     protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
     {
         String element = isParameterBound("element") ? getElement() : getTemplateTagName();
-        
+
         boolean rewinding = cycle.isRewinding();
-        
+
         if (!rewinding)
         {
             writer.begin(element);
-            
+
             renderInformalParameters(writer, cycle);
-            
+
             if (getId() != null && !isParameterBound("id"))
                 renderIdAttribute(writer, cycle);
         }
-        
+
         renderBody(writer, cycle);
-        
+
         if (!rewinding)
         {
             writer.end();



Mime
View raw message