Revision 2966 trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/catalogClient/gui/ConnectDialog.java

View differences:

ConnectDialog.java
43 43
import com.iver.andami.PluginServices;
44 44
import com.iver.andami.ui.mdiManager.View;
45 45
import com.iver.andami.ui.mdiManager.ViewInfo;
46
import com.iver.utiles.NotExistInXMLEntity;
47
import com.iver.utiles.XMLEntity;
46 48

  
47 49
import es.gva.cit.catalogClient.ui.ServerConnectDialogPanel;
48 50

  
......
73 75
	private void init() {
74 76
		this.setBounds(0, 0, 630, 260);
75 77
		setName("connectDialog");
76
				
78
						
77 79
		getConnectButton().addActionListener(this);
78 80
		getSearchButton().addActionListener(new java.awt.event.ActionListener() {
79 81
            public void actionPerformed(java.awt.event.ActionEvent evt) {
......
87 89
	}
88 90
	
89 91
	public void searchButtonActionPerformed() {
90
        closeJDialog();
92
	    addHost(getCliente().getUrl().toString());
93
	    closeJDialog();
91 94
		SearchDialog dialog = new SearchDialog();
92 95
		dialog.setCatalogClient(getCliente());
93 96
		dialog.setBounds(0, 0, 675, 490);
......
96 99
		PluginServices.getMDIManager().addView(dialog);
97 100
	}
98 101
	
102
	 public void addHost(String host){
103
	        host = host.trim();
104

  
105
	        PluginServices ps = PluginServices.getPluginServices(this);
106
			XMLEntity xml = ps.getPersistentXML();
107

  
108
			try {
109
				String[] servers = xml.getStringArrayProperty("cat-servers");
110
				String[] newServers = new String[servers.length + 1];
111
				System.arraycopy(servers, 0, newServers, 0, servers.length);
112
				newServers[servers.length] = host;
113
				xml.putProperty("cat-servers", newServers);
114
			} catch (NotExistInXMLEntity e) {
115
					xml.putProperty("cat-servers", new String[] { host });
116
			}
117

  
118
			ps.setPersistentXML(xml);
119
			
120
	    }
121
	
99 122
	/**
100 123
	 * Cierra el Dialog
101 124
	 */

Also available in: Unified diff