Revision 11582

View differences:

trunk/libraries/libUI/src-test/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/services/TestJComboBoxItemsSeekerForURLOfServices.java
1
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.services;
2

  
3
import java.awt.Dimension;
4

  
5
import javax.swing.JFrame;
6
import javax.swing.JOptionPane;
7

  
8
import org.gvsig.gui.beans.Messages;
9
import org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.services.JComboBoxItemsSeekerForURLOfServices;
10

  
11
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
12
 *
13
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
14
 *
15
 * This program is free software; you can redistribute it and/or
16
 * modify it under the terms of the GNU General Public License
17
 * as published by the Free Software Foundation; either version 2
18
 * of the License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU General Public License
26
 * along with this program; if not, write to the Free Software
27
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
28
 *
29
 * For more information, contact:
30
 *
31
 *  Generalitat Valenciana
32
 *   Conselleria d'Infraestructures i Transport
33
 *   Av. Blasco Ib??ez, 50
34
 *   46010 VALENCIA
35
 *   SPAIN
36
 *
37
 *      +34 963862235
38
 *   gvsig@gva.es
39
 *      www.gvsig.gva.es
40
 *
41
 *    or
42
 *
43
 *   IVER T.I. S.A
44
 *   Salamanca 50
45
 *   46005 Valencia
46
 *   Spain
47
 *
48
 *   +34 963163400
49
 *   dac@iver.es
50
 */
51

  
52
/**
53
 * Tests the classes JComboBoxItemsSeekerForServers
54
 * 
55
 * Notes:
56
 *    - MORE TESTS COULD BE ADDED!!!
57
 *    - DON'T REMOVE TEST COMMENTED!!!
58
 *
59
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
60
 */
61
public class TestJComboBoxItemsSeekerForURLOfServices {
62

  
63
	/**
64
	 * Test method for the TestJComboBoxItemsSeekerForURLOfServices
65
	 * 
66
	 * @param args
67
	 */
68
	public static void main(String[] args) {
69
		int width = 300;
70
		int height = 60;
71
		
72
		try
73
		{
74
			// Objects creation
75
			JFrame jF = new JFrame();
76
	
77
			// Create a JComboBoxSearcheable, set behavior configuration and add Items
78
			
79
			// --- TESTS FOR THE JCOMBOBOXITEMSSEEKERFORURLOFSERVICES ---
80
			// Test the default behavior
81
			JComboBoxItemsSeekerForURLOfServices jCBISFN = new JComboBoxItemsSeekerForURLOfServices();
82
			
83
			// --- ADD ITEMS TO THE COMPONENT AND OTHER TESTS ---
84
			// Add some items to test if has too much delay with an average number of items
85
			jCBISFN.addItem("_fwAndami");
86
			jCBISFN.addItem("extAddEventTheme");
87
			jCBISFN.addItem("extJDBC");
88
			jCBISFN.addItem("extCAD");
89
			jCBISFN.addItem("libuiDownCase");
90
			jCBISFN.addItem("appgvSig");
91
			jCBISFN.addItem("extNomenclatorIGN");
92
			jCBISFN.addItem("extWMS");
93
			jCBISFN.addItem("LIBUI");
94

  
95
			jF.setSize(new Dimension(width, height));	    
96
		    jF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
97
		    jF.getContentPane().add(jCBISFN);
98
			
99
			// --- END ADD ITEMS TO THE COMPONENT AND OTHER TESTS ---
100
			
101
			// Test of no item default selection 
102
			// jCBISFN.setSelectedIndex(-1);
103
			
104
		    // Test the number of actions that can hold the UndoManager of the JComponent
105
			// jCBISFN.setUndoRedoLimitActions(5);
106
	
107
			// Configure the JFrame
108
			jF.setTitle("Test JComboBoxItemsSeekerForURLOfServices");
109
			jF.setSize(new Dimension(width, height));	    
110
		    jF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
111
		    jF.getContentPane().add(jCBISFN);
112
		    jF.setVisible(true);	
113
		}
114
		catch(Exception e)
115
		{
116
			e.printStackTrace();
117
			JOptionPane.showMessageDialog(null, e.getMessage(), Messages.getText("error"), JOptionPane.ERROR_MESSAGE);
118
		}
119
	}
120

  
121
}
0 122

  

Also available in: Unified diff