KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > JXTableIssues


1 /*
2  * $Id: JXTableIssues.java,v 1.9 2005/02/28 11:30:45 kleopatra Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7 package org.jdesktop.swing;
8
9 import javax.swing.JFrame JavaDoc;
10 import javax.swing.table.DefaultTableModel JavaDoc;
11 import javax.swing.table.TableCellRenderer JavaDoc;
12
13 import org.jdesktop.swing.decorator.ComponentAdapter;
14 import org.jdesktop.swing.decorator.Filter;
15 import org.jdesktop.swing.decorator.FilterPipeline;
16 import org.jdesktop.swing.decorator.PatternFilter;
17 import org.jdesktop.swing.decorator.PipelineListener;
18
19 import junit.framework.TestCase;
20
21 /**
22  * @author Jeanette Winzenburg
23  */

24 public class JXTableIssues extends TestCase {
25
26     private DefaultTableModel JavaDoc createModel(int startRow, int count) {
27         DefaultTableModel JavaDoc model = new DefaultTableModel JavaDoc(count, 5);
28         for (int i = 0; i < model.getRowCount(); i++) {
29             model.setValueAt(new Integer JavaDoc(startRow++), i, 0);
30         }
31         return model;
32     }
33     
34     /**
35      * JW: Still needed? moved to main testCase?
36      *
37      */

38     public void testNewRendererInstance() {
39         JXTable table = new JXTable();
40         TableCellRenderer JavaDoc newRenderer = table.getNewDefaultRenderer(Boolean JavaDoc.class);
41         TableCellRenderer JavaDoc sharedRenderer = table.getDefaultRenderer(Boolean JavaDoc.class);
42         assertNotNull(newRenderer);
43         assertNotSame("new renderer must be different from shared", sharedRenderer, newRenderer);
44         assertNotSame("new renderer must be different from object renderer",
45                 table.getDefaultRenderer(Object JavaDoc.class), newRenderer);
46     }
47
48
49 // public static void main(String[] args) {
50
// JXTableIssues issues = new JXTableIssues();
51
//
52
// }
53
}
54
Popular Tags