Clover Coverage Report - FEST Swing 1.2
Coverage timestamp: Tue Jun 1 2010 15:19:25 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
3   61   2   1.5
0   24   0.67   2
2     1  
1    
 
  JTableFormatter       Line # 32 3 0% 2 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Dec 23, 2007
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. 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 distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2007-2010 the original author or authors.
15    */
16    package org.fest.swing.format;
17   
18    import static java.lang.String.valueOf;
19    import static org.fest.util.Strings.concat;
20    import static org.fest.util.Strings.quote;
21   
22    import java.awt.Component;
23   
24    import javax.swing.JTable;
25   
26    /**
27    * Understands a formatter for <code>{@link JTable}</code>s.
28    *
29    * @author Alex Ruiz
30    * @author Yvonne Wang
31    */
 
32    public class JTableFormatter extends ComponentFormatterTemplate {
33   
34    /**
35    * Returns the <code>String</code> representation of the given <code>{@link Component}</code>, which should be a
36    * <code>{@link JTable}</code> (or subclass.)
37    * @param c the given <code>Component</code>.
38    * @return the <code>String</code> representation of the given <code>JTable</code>.
39    */
 
40  2551 toggle protected String doFormat(Component c) {
41  2551 JTable table = (JTable)c;
42  2551 return concat(
43    table.getClass().getName(), "[",
44    "name=", quote(table.getName()), ", ",
45    "rowCount=", valueOf(table.getRowCount()), ", ",
46    "columnCount=", valueOf(table.getColumnCount()), ", ",
47    "enabled=", valueOf(table.isEnabled()), ", ",
48    "visible=", valueOf(table.isVisible()), ", ",
49    "showing=", valueOf(table.isShowing()),
50    "]"
51    );
52    }
53   
54    /**
55    * Indicates that this formatter supports <code>{@link JTable}</code> only.
56    * @return <code>JTable.class</code>.
57    */
 
58  2875 toggle public Class<? extends Component> targetType() {
59  2875 return JTable.class;
60    }
61    }