KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > decorator > FilterTest


1 /*
2  * $Id: FilterTest.java,v 1.1 2004/10/14 01:28:20 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.swing.decorator;
9
10 import java.awt.Color JavaDoc;
11
12 import junit.framework.TestCase;
13
14 import org.jdesktop.swing.JXTable;
15
16 public class FilterTest extends TestCase {
17
18     /**
19      * This is a test to ensure that the example in the javadoc actually works.
20      * if the javadoc example changes, then those changes should be pasted here.
21      */

22     public void testJavaDocExample() {
23
24         Filter[] filters = new Filter[] {
25             new PatternFilter("S.*", 0, 1), // regex, matchflags, column
26
new ShuttleSorter(1, false), // column 1, descending
27
new ShuttleSorter(0, true), // column 0, ascending
28
};
29         FilterPipeline pipeline = new FilterPipeline(filters);
30         JXTable table = new JXTable();
31         table.setFilters(pipeline);
32     }
33 }
34
Popular Tags