Revision 19419 branches/v10/extensions/extPublish/src/org/gvsig/publish/gui/selectServer/SelectServerPanel.java

View differences:

SelectServerPanel.java
57 57
import com.iver.utiles.swing.jcomboServer.JComboServer;
58 58
import com.iver.utiles.swing.jcomboServer.ServerData;
59 59

  
60
/**
61
 * GUI for server and service selection
62
 * 
63
 * @author jvhigon
64
 *
65
 */
60 66

  
61

  
62 67
public class SelectServerPanel extends JPanel {
63 68

  
64 69
	/**
......
177 182
	private javax.swing.JComboBox servicecombo;
178 183
	// End of variables declaration                   
179 184

  
180

  
185
	/**
186
	 * sets the listener for all the actions in the panel
187
	 */
181 188
	public void setListener(EventListener listener) {
182 189
		//set listener into the buttons
183 190
		acceptButton.addActionListener((ActionListener)listener);
......
185 192
		cancelButton.addActionListener((ActionListener)listener);		
186 193
		cancelButton.setActionCommand(SelectServerController.NEWSERVER_EVENT_CANCEL);
187 194
		serverurlcombo.addActionListener((ActionListener)listener);
188
		serverurlcombo.setActionCommand(SelectServerController.COMBOSERVER_EVENT_CHANGE);
195
		serverurlcombo.setActionCommand(SelectServerController.COMBOSERVERURL_EVENT_CHANGE);
196
		servercombo.addActionListener((ActionListener)listener);
197
		servercombo.setActionCommand(SelectServerController.COMBOSERVER_EVENT_CHANGE);
189 198
	}
190

  
199
	/**
200
	 * initialize combos
201
	 */
191 202
	public void initCombos(){
192 203
		//remove items
193 204
		servercombo.removeAllItems();
......
211 222
	}
212 223
	
213 224
	/**
214
	 * Initializes the serverCombo with the saved servers 
225
	 * Initializes the serverComboURL with the saved servers 
215 226
	 */
216 227
	private void initServerCombo(){
217 228
		ServerDataPersistence persistence = new ServerDataPersistence(this,Server.PUBLISH_SERVERS);
......
244 255
	}
245 256
	
246 257
	/**
247
	 * Update the server and the service combo with the
248
	 * selected server
258
	 * Updates the server and the service combo with the
259
	 * selected server url
249 260
	 */
250 261
	protected void updateCombos(){
251 262
		ServerData server = serverurlcombo.getSelectedServer();
......
264 275
			}
265 276
		}	
266 277
	}
278
	/**
279
	 * Updates the service combo when you select a server
280
	 */
281
	public void updateServiceCombo() {
282
		servicecombo.removeAllItems();
283
		ArrayList set = PublishRegister.register().getServicesNames(servercombo.getSelectedItem().toString());
284
		Iterator i = set.iterator();
285
		while (i.hasNext()){
286
			servicecombo.addItem(i.next());
287
		}		
288
	}
289
	
267 290

  
268 291
	public String getSelectedServer(){
269 292
		return servercombo.getSelectedItem().toString();

Also available in: Unified diff