Revision 770
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/EditingExtension.java | ||
---|---|---|
102 | 102 |
|
103 | 103 |
if (canBeEdited(layer)) { |
104 | 104 |
if( !mapControl.getProjection().equals(layer.getProjection()) ) { |
105 |
String msg = "_The_layer_is_reproyected_on_the_fly"
|
|
105 |
String msg = "_The_layer_is_reproyected_on_the_fly" |
|
106 | 106 |
+ "_Not_all_editing_tools_work_properly" |
107 | 107 |
+ "_When_you_finish_editing" |
108 | 108 |
+ "_will_only_export_the_changes_to_another_layer"; |
... | ... | |
252 | 252 |
private boolean canBeEdited(FLyrVect layer) { |
253 | 253 |
if (layer != null && layer.isAvailable()) { |
254 | 254 |
|
255 |
boolean isWritable = layer.isWritable(); |
|
256 | 255 |
boolean isNotTransformed = |
257 | 256 |
layer.getFeatureStore().getTransforms().isEmpty(); |
258 | 257 |
|
259 |
return isWritable && isNotTransformed && !layer.isEditing();
|
|
258 |
return isNotTransformed && !layer.isEditing(); |
|
260 | 259 |
} |
261 | 260 |
|
262 | 261 |
return false; |
... | ... | |
289 | 288 |
|
290 | 289 |
} else if (n.isOfType(EditingContext.EXPORT_LAYER_NOTIFICATION)){ |
291 | 290 |
exportLayer((FLyrVect)(n.getValue())); |
292 |
|
|
291 |
|
|
293 | 292 |
} else if (n.isOfType(EditingContext.REFRESH_TOOLS_NOTIFICATION)){ |
294 | 293 |
appManager.refreshMenusAndToolBars(); |
295 | 294 |
} |
296 | 295 |
} |
297 | 296 |
} |
298 |
|
|
297 |
|
|
299 | 298 |
private void exportLayer(FLyrVect layer) { |
300 | 299 |
ApplicationManager appManager = ApplicationLocator.getManager(); |
301 | 300 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
... | ... | |
303 | 302 |
action.execute(new Object[] { layer, MODE.toInteger(MODE.DIALOG) }); |
304 | 303 |
String msg = "_Do_you_want_to_finish_editing_If_not_exported_the_data_the_changes_will_be_lost"; |
305 | 304 |
if( appManager.confirmDialog( |
306 |
i18nManager.getTranslation(msg),
|
|
307 |
i18nManager.getTranslation("end_editing"),
|
|
305 |
i18nManager.getTranslation(msg), |
|
306 |
i18nManager.getTranslation("end_editing"), |
|
308 | 307 |
JOptionPane.YES_NO_OPTION, |
309 | 308 |
JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION ) { |
310 | 309 |
try { |
... | ... | |
316 | 315 |
} |
317 | 316 |
} |
318 | 317 |
} |
319 |
|
|
318 |
|
|
320 | 319 |
private List<FLyrVect> getEditedLayers(){ |
321 | 320 |
ApplicationManager application = ApplicationLocator.getManager(); |
322 | 321 |
List<FLyrVect> editedLayers = new ArrayList<>(); |
323 |
|
|
322 |
|
|
324 | 323 |
Project project = application.getCurrentProject(); |
325 | 324 |
for( Document document : project.getDocuments(ViewManager.TYPENAME) ) { |
326 | 325 |
ViewDocument view = (ViewDocument) document; |
Also available in: Unified diff