Revision 28905
trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/wcs/WCSWizard.java | ||
---|---|---|
133 | 133 |
private void addHost(String host) { |
134 | 134 |
host = host.trim(); |
135 | 135 |
|
136 |
DefaultComboBoxModel model = (DefaultComboBoxModel) getTxtHost() |
|
137 |
.getModel(); |
|
136 |
ServerDataPersistence persistence = new ServerDataPersistence(this,ServerData.SERVER_TYPE_WCS); |
|
137 |
persistence.addServerData(new ServerData(host, ServerData.SERVER_TYPE_WCS)); |
|
138 |
persistence.setPersistent(); |
|
139 |
} |
|
138 | 140 |
|
139 |
if (model.getIndexOf(host) < 0) { |
|
140 |
model.addElement(host); |
|
141 |
// private void addHost(String host) { |
|
142 |
// host = host.trim(); |
|
143 |
// |
|
144 |
// DefaultComboBoxModel model = (DefaultComboBoxModel) getTxtHost() |
|
145 |
// .getModel(); |
|
146 |
// |
|
147 |
// if (model.getIndexOf(host) < 0) { |
|
148 |
// model.addElement(host); |
|
149 |
// |
|
150 |
// PluginServices ps = PluginServices.getPluginServices(this); |
|
151 |
// XMLEntity xml = ps.getPersistentXML(); |
|
152 |
// |
|
153 |
// try { |
|
154 |
// String[] servers = xml.getStringArrayProperty("wcs-servers"); |
|
155 |
// String[] newServers = new String[servers.length + 1]; |
|
156 |
// System.arraycopy(servers, 0, newServers, 0, servers.length); |
|
157 |
// newServers[servers.length] = host; |
|
158 |
// xml.putProperty("wcs-servers", newServers); |
|
159 |
// } catch (NotExistInXMLEntity e) { |
|
160 |
// xml.putProperty("wcs-servers", new String[] { host }); |
|
161 |
// } |
|
162 |
// |
|
163 |
// ps.setPersistentXML(xml); |
|
164 |
// } |
|
165 |
// } |
|
141 | 166 |
|
142 |
PluginServices ps = PluginServices.getPluginServices(this); |
|
143 |
XMLEntity xml = ps.getPersistentXML(); |
|
144 |
|
|
145 |
try { |
|
146 |
String[] servers = xml.getStringArrayProperty("wcs-servers"); |
|
147 |
String[] newServers = new String[servers.length + 1]; |
|
148 |
System.arraycopy(servers, 0, newServers, 0, servers.length); |
|
149 |
newServers[servers.length] = host; |
|
150 |
xml.putProperty("wcs-servers", newServers); |
|
151 |
} catch (NotExistInXMLEntity e) { |
|
152 |
xml.putProperty("wcs-servers", new String[] { host }); |
|
153 |
} |
|
154 |
|
|
155 |
ps.setPersistentXML(xml); |
|
156 |
} |
|
157 |
} |
|
158 |
|
|
159 | 167 |
/** |
160 | 168 |
* Fills up the initial WCSWizard controls. |
161 | 169 |
* |
Also available in: Unified diff