Clover coverage report - Code Coverage for tapestry-contrib release 4.0-alpha-3
Coverage timestamp: Mon May 16 2005 09:12:41 EDT
file stats: LOC: 80   Methods: 5
NCLOC: 41   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
BasicTableModelWrap.java 0% 0% 0% 0%
coverage
 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.table.model.common;
 16   
 
 17   
 import java.util.Iterator;
 18   
 
 19   
 import org.apache.tapestry.contrib.table.model.IBasicTableModel;
 20   
 import org.apache.tapestry.contrib.table.model.ITableColumn;
 21   
 import org.apache.tapestry.contrib.table.model.ITableColumnModel;
 22   
 import org.apache.tapestry.contrib.table.model.simple.SimpleTableState;
 23   
 
 24   
 /**
 25   
  * @author mindbridge
 26   
  */
 27   
 public class BasicTableModelWrap extends AbstractTableModel 
 28   
 {
 29   
     private IBasicTableModel m_objBasicTableModel;
 30   
     private ITableColumnModel m_objTableColumnModel;
 31   
 
 32  0
     public BasicTableModelWrap(IBasicTableModel objBasicTableModel, ITableColumnModel objColumnModel)
 33   
     {
 34  0
         this(objBasicTableModel, objColumnModel, new SimpleTableState());
 35   
     }
 36   
 
 37  0
     public BasicTableModelWrap(IBasicTableModel objBasicTableModel, ITableColumnModel objColumnModel, SimpleTableState objState)
 38   
     {
 39  0
         super(objState);
 40  0
         m_objBasicTableModel = objBasicTableModel;
 41  0
         m_objTableColumnModel = objColumnModel;
 42   
     }
 43   
 
 44   
     /**
 45   
      * @see org.apache.tapestry.contrib.table.model.ITableModel#getColumnModel()
 46   
      */
 47  0
     public ITableColumnModel getColumnModel()
 48   
     {
 49  0
         return m_objTableColumnModel;
 50   
     }
 51   
 
 52   
     /**
 53   
      * @see org.apache.tapestry.contrib.table.model.common.AbstractTableModel#getRowCount()
 54   
      */
 55  0
     protected int getRowCount()
 56   
     {
 57  0
         return m_objBasicTableModel.getRowCount();
 58   
     }
 59   
 
 60   
     /**
 61   
      * @see org.apache.tapestry.contrib.table.model.ITableModel#getCurrentPageRows()
 62   
      */
 63  0
     public Iterator getCurrentPageRows()
 64   
     {
 65  0
         int nPageSize = getPagingState().getPageSize();
 66  0
         if (nPageSize <= 0)
 67  0
             nPageSize = getRowCount();
 68   
 
 69  0
         int nCurrentPage = getPagingState().getCurrentPage();
 70  0
         int nFrom = nCurrentPage * nPageSize;
 71   
         
 72  0
         String strSortColumn = getSortingState().getSortColumn();
 73  0
         ITableColumn objSortColumn = getColumnModel().getColumn(strSortColumn); 
 74  0
         boolean bSortOrder = getSortingState().getSortOrder();
 75   
         
 76  0
         return m_objBasicTableModel.getCurrentPageRows(nFrom, nPageSize, objSortColumn, bSortOrder);
 77   
     }
 78   
 
 79   
 }
 80