Revision 27231

View differences:

branches/v2_0_0_prep/extensions/extEditing/src/com/iver/cit/gvsig/StopEditing.java
77 77
					MapControl mapControl = vista.getMapControl();
78 78
					VectorialLayerEdited lyrEd = (VectorialLayerEdited)	edMan.getActiveLayerEdited();
79 79
					try {
80
						lv.getFeatureStore().deleteObservers();
80
						lv.getFeatureStore().deleteObserver(lyrEd);
81 81
					} catch (ReadException e) {
82 82
						NotificationManager.addError("Remove Selection Listener",e);
83 83
					}
......
119 119
	 * DOCUMENT ME!
120 120
	 */
121 121
	public boolean stopEditing(FLyrVect layer, MapControl mapControl) {
122
		FeatureStore featureStore=null;
123
		try {
124
			featureStore = layer.getFeatureStore();
125
		} catch (ReadException e1) {
126
			// TODO Auto-generated catch block
127
			e1.printStackTrace();
128
		}
129
//		VectorialEditableAdapter vea = (VectorialEditableAdapter) layer
130
//				.getSource();
122
//		FeatureStore featureStore=null;
123
//		try {
124
//			featureStore = layer.getFeatureStore();
125
//		} catch (ReadException e1) {
126
//			// TODO Auto-generated catch block
127
//			e1.printStackTrace();
128
//		}
131 129
		int resp = JOptionPane.NO_OPTION;
132 130

  
133 131
		try {
......
143 141
					saveLayer(layer);
144 142
				}
145 143

  
146
				featureStore.deleteObservers();
144
//				featureStore.deleteObservers();
147 145
				layer.setEditing(false);
148 146
//				if (layer.isSpatiallyIndexed())
149 147
//	            {
......
174 172
				if (resp == JOptionPane.YES_OPTION) { // CANCEL EDITING
175 173
					cancelEdition(layer);
176 174

  
177
					featureStore.deleteObservers();
175
//					featureStore.deleteObservers();
178 176
//					if (!(layer.getSource().getDriver() instanceof IndexedShpDriver)){
179 177
//						VectorialLayerEdited vle=(VectorialLayerEdited)CADExtension.getEditionManager().getLayerEdited(layer);
180 178
//						layer.setLegend((IVectorLegend)vle.getLegend());
......
191 189
			NotificationManager.addError(e);
192 190
		} catch (CancelEditingLayerException e) {
193 191
			NotificationManager.addError(e);
194
		} catch (DataException e) {
195
			NotificationManager.addError(e);
196 192
		}
197 193
		return false;
198 194

  
......
246 242
	private void cancelEdition(FLyrVect layer) throws CancelEditingTableException, CancelEditingLayerException {
247 243
		layer.setProperty("stoppingEditing",new Boolean(true));
248 244
		com.iver.andami.ui.mdiManager.IWindow[] views = PluginServices
249
		.getMDIManager().getAllWindows();
245
			.getMDIManager().getAllWindows();
250 246
		FeatureStore featureStore=null;
251 247
		try {
252 248
			featureStore = layer.getFeatureStore();
......
353 349
//	            lva.setMapping(lva.getMapping());
354 350
//			}
355 351
			com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager()
356
			.getActiveWindow();
352
				.getActiveWindow();
357 353
			if (f instanceof View) {
358 354
				vista = (View) f;
359 355
				FLayer auxLayer=vista.getMapControl().getMapContext().getLayers().getLayer(layer.getName());

Also available in: Unified diff