Coverage Report - org.apache.tapestry.contrib.tree.components.table.TreeTableValueRenderSource
 
Classes in this File Line Coverage Branch Coverage Complexity
TreeTableValueRenderSource
0%
0/16
0%
0/4
1.667
 
 1  
 // Copyright 2004, 2005 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry.contrib.tree.components.table;
 16  
 
 17  
 import org.apache.tapestry.IRender;
 18  
 import org.apache.tapestry.IRequestCycle;
 19  
 import org.apache.tapestry.contrib.table.model.ITableColumn;
 20  
 import org.apache.tapestry.contrib.table.model.ITableModelSource;
 21  
 import org.apache.tapestry.contrib.table.model.ITableRendererSource;
 22  
 import org.apache.tapestry.contrib.table.model.common.ComponentTableRendererSource;
 23  
 import org.apache.tapestry.util.ComponentAddress;
 24  
 
 25  
 /**
 26  
  * @author ceco
 27  
  */
 28  
 public class TreeTableValueRenderSource implements ITableRendererSource
 29  
 {
 30  
 
 31  
     private static final long serialVersionUID = 3237638859391458116L;
 32  
 
 33  
     private ComponentTableRendererSource m_objComponentRenderer;
 34  0
     private ComponentAddress m_objComponentAddress = null;
 35  
     
 36  
     /* used to synchronize access */
 37  0
     private Object m_sync = new Object();
 38  
     
 39  
     public TreeTableValueRenderSource()
 40  0
     {
 41  0
         m_objComponentRenderer = null;
 42  0
     }
 43  
     
 44  
     public TreeTableValueRenderSource(ComponentAddress objComponentAddress)
 45  0
     {
 46  0
         m_objComponentAddress = objComponentAddress;
 47  0
     }
 48  
     
 49  
     /**
 50  
      * @see org.apache.tapestry.contrib.table.model.ITableRendererSource#getRenderer(IRequestCycle,
 51  
      *      ITableModelSource, ITableColumn, Object)
 52  
      */
 53  
     public IRender getRenderer(IRequestCycle objCycle, ITableModelSource objSource, ITableColumn objColumn,
 54  
             Object objRow)
 55  
     {
 56  0
         if (m_objComponentRenderer == null)
 57  
         {
 58  0
             synchronized(m_sync)
 59  
             {
 60  0
                 ComponentAddress objAddress = m_objComponentAddress;
 61  0
                 if (m_objComponentAddress == null)
 62  0
                     objAddress = new ComponentAddress("contrib:TreeTableNodeViewPage", "treeTableNodeViewDelegator");
 63  0
                 m_objComponentRenderer = new ComponentTableRendererSource(objAddress);
 64  0
             }
 65  
         }
 66  
         
 67  0
         return m_objComponentRenderer.getRenderer(objCycle, objSource, objColumn, objRow);
 68  
     }
 69  
 
 70  
 }