KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: JXTreeUnitTest.java,v 1.1 2005/01/11 17:43:37 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
11 import org.jdesktop.swing.treetable.FileSystemModel;
12 import org.jdesktop.swing.treetable.TreeTableModel;
13
14 //import de.kleopatra.view.LFSwitcher;
15

16 /**
17  * @author Jeanette Winzenburg
18  */

19 public class JXTreeUnitTest extends InteractiveTestCase {
20
21     TreeTableModel treeTableModel; // shared
22

23     public JXTreeUnitTest() {
24         super("JXTree Test");
25     }
26
27     /**
28      * Needed because testCase fails if it does not have at least
29      * one fixture.
30      * learning something new every day :-)
31      *
32      */

33     public void testDummy() {
34         
35     }
36     /**
37      * test if lineStyle client property is respected by JXTree.
38      * Note that some LFs don't respect anyway (WinLF f.i.)
39      */

40     public void interactiveTestLineStyle() {
41         JXTree tree = new JXTree(treeTableModel);
42         tree.putClientProperty("JTree.lineStyle", "None");
43         JFrame JavaDoc frame = wrapWithScrollingInFrame(tree, "LineStyle Test");
44         frame.setVisible(true); // RG: Changed from deprecated method show();
45
}
46     
47     protected void setUp() throws Exception JavaDoc {
48         super.setUp();
49         treeTableModel = new FileSystemModel();
50     }
51
52     public static void main(String JavaDoc[] args) {
53       // LFSwitcher.metalLF();
54
JXTreeUnitTest test = new JXTreeUnitTest();
55         try {
56             test.runInteractiveTests();
57         } catch (Exception JavaDoc e) {
58             System.err.println("exception when executing interactive tests:");
59             e.printStackTrace();
60         }
61     }
62 }
63
Popular Tags