|
|||||||||||||||||||
| 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 | |||||||||||||||
| PropertyTableModel.java | 50% | 100% | 100% | 92,3% |
|
||||||||||||||
| 1 |
/* |
|
| 2 |
* Angkor Web Framework |
|
| 3 |
* |
|
| 4 |
* Distributable under LGPL license. |
|
| 5 |
* See terms of license at gnu.org. |
|
| 6 |
*/ |
|
| 7 |
|
|
| 8 |
package com.tirsen.angkor.beans; |
|
| 9 |
|
|
| 10 |
import java.util.List; |
|
| 11 |
|
|
| 12 |
/** |
|
| 13 |
* <!-- $Id: PropertyTableModel.java,v 1.2 2002/10/09 21:37:37 tirsen Exp $ --> |
|
| 14 |
* <!-- $Author: tirsen $ --> |
|
| 15 |
* |
|
| 16 |
* @author Jon Tirs´n (tirsen@users.sourceforge.net) |
|
| 17 |
* @version $Revision: 1.2 $ |
|
| 18 |
*/ |
|
| 19 |
class PropertyTableModel extends BeanTableModel |
|
| 20 |
{
|
|
| 21 |
private PropertySupport property; |
|
| 22 |
|
|
| 23 | 6 |
public PropertyTableModel(BeanModel model, String property, Class propertyClass) |
| 24 |
{
|
|
| 25 | 6 |
this.property = new PropertySupport(model, property, propertyClass); |
| 26 |
} |
|
| 27 |
|
|
| 28 | 16 |
public List getRows() |
| 29 |
{
|
|
| 30 | 16 |
return property.getList(); |
| 31 |
} |
|
| 32 |
|
|
| 33 | 11 |
protected Class getRowClass() |
| 34 |
{
|
|
| 35 | 11 |
return property.getComponentType(); |
| 36 |
} |
|
| 37 |
|
|
| 38 | 63 |
public int getRowCount() |
| 39 |
{
|
|
| 40 | 63 |
int rowCount = super.getRowCount(); |
| 41 | 63 |
if (rowCount == -1) |
| 42 |
{
|
|
| 43 | 63 |
rowCount = property.size(); |
| 44 |
} |
|
| 45 | 63 |
return rowCount; |
| 46 |
} |
|
| 47 |
} |
|
| 48 |
|
|
||||||||||