root / branches / v10 / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / view / NewPublicationParamsPanel.java @ 13570
History | View | Annotate | Download (3.38 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Iba?ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package com.iver.cit.gvsig.publish.gui.view; |
42 |
|
43 |
import java.awt.Dimension; |
44 |
import java.awt.FlowLayout; |
45 |
import java.util.Iterator; |
46 |
import java.util.Set; |
47 |
|
48 |
import javax.swing.BorderFactory; |
49 |
import javax.swing.BoxLayout; |
50 |
import javax.swing.DefaultComboBoxModel; |
51 |
import javax.swing.JButton; |
52 |
import javax.swing.JLabel; |
53 |
import javax.swing.JPanel; |
54 |
import javax.swing.JTextField; |
55 |
import javax.swing.border.TitledBorder; |
56 |
|
57 |
import com.iver.andami.PluginServices; |
58 |
import com.iver.cit.gvsig.publish.serversModel.Server; |
59 |
import com.iver.utiles.swing.JComboBox; |
60 |
|
61 |
public class NewPublicationParamsPanel extends JPanel { |
62 |
private JLabel serverNameLabel = null; |
63 |
private JTextField serverNameText = null; |
64 |
private JComboBox serverBrandCombo = null; |
65 |
|
66 |
public NewPublicationParamsPanel(){
|
67 |
super();
|
68 |
initialize(); |
69 |
} |
70 |
|
71 |
private void initialize(){ |
72 |
this.setLayout(new FlowLayout()); |
73 |
this.setPreferredSize(new java.awt.Dimension(250,150)); |
74 |
this.setSize(new java.awt.Dimension(250,150)); |
75 |
this.add(getServerNameLabel(), null); |
76 |
this.add(getServerNameText(), null); |
77 |
this.add(getServerBrandCombo(), null); |
78 |
TitledBorder title;
|
79 |
title = BorderFactory.createTitledBorder("border_title"); |
80 |
this.setBorder(title);
|
81 |
} |
82 |
public String getSelectedServer(){ |
83 |
return getServerBrandCombo().getSelectedItem().toString();
|
84 |
} |
85 |
private JLabel getServerNameLabel(){ |
86 |
if (serverNameLabel == null){ |
87 |
serverNameLabel = new JLabel(); |
88 |
serverNameLabel.setText("server_name_label");
|
89 |
} |
90 |
return serverNameLabel;
|
91 |
} |
92 |
|
93 |
private JTextField getServerNameText(){ |
94 |
if (serverNameText == null) { |
95 |
serverNameText = new JTextField(10); |
96 |
} |
97 |
return serverNameText;
|
98 |
} |
99 |
private JComboBox getServerBrandCombo(){ |
100 |
if (serverBrandCombo == null) { |
101 |
serverBrandCombo = new JComboBox(); |
102 |
serverBrandCombo.setModel(new DefaultComboBoxModel()); |
103 |
serverBrandCombo.setPreferredSize(new java.awt.Dimension(100, 20)); |
104 |
serverBrandCombo.setEditable(true);
|
105 |
initializeCombo(); |
106 |
} |
107 |
return serverBrandCombo;
|
108 |
} |
109 |
|
110 |
private void initializeCombo(){ |
111 |
Set set = Server.register.getServerNames();
|
112 |
Iterator i = set.iterator();
|
113 |
while (i.hasNext()){
|
114 |
serverBrandCombo.addItem(i.next()); |
115 |
} |
116 |
} |
117 |
} |