Revision 38560 branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/EditionManager.java
EditionManager.java | ||
---|---|---|
28 | 28 |
import java.util.Iterator; |
29 | 29 |
import java.util.List; |
30 | 30 |
|
31 |
import javax.swing.JOptionPane; |
|
31 | 32 |
import javax.swing.JPanel; |
32 | 33 |
import javax.swing.SwingUtilities; |
33 | 34 |
|
... | ... | |
37 | 38 |
import org.gvsig.andami.PluginServices; |
38 | 39 |
import org.gvsig.andami.messages.NotificationManager; |
39 | 40 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
41 |
import org.gvsig.app.ApplicationLocator; |
|
40 | 42 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
41 | 43 |
import org.gvsig.editing.layers.FactoryLayerEdited; |
42 | 44 |
import org.gvsig.editing.layers.ILayerEdited; |
... | ... | |
63 | 65 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
64 | 66 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent; |
65 | 67 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener; |
66 |
import org.gvsig.tools.service.ServiceException; |
|
67 | 68 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
68 | 69 |
import org.gvsig.tools.swing.api.dynobject.DynObjectSwingManager; |
69 | 70 |
import org.gvsig.tools.swing.api.dynobject.JDynObjectComponent; |
... | ... | |
338 | 339 |
dynObjectComponent = |
339 | 340 |
dynObjectSwinManager.createJDynObjectComponent( |
340 | 341 |
feature.getAsDynObject(), true); |
341 |
} catch (ServiceException e) { |
|
342 |
throw new FeatureRuleMandatoryAttributesException(e, |
|
343 |
store.getFullName()); |
|
342 |
} catch (Exception e) { |
|
343 |
|
|
344 |
// TODO This has to be improved |
|
345 |
// Instead of this warning, show dialog to |
|
346 |
// fill feature type |
|
347 |
showBadValuesMessage(e.getMessage()); |
|
348 |
return; |
|
349 |
|
|
344 | 350 |
} |
345 | 351 |
final JPanel panel = new JPanel(); |
346 | 352 |
|
... | ... | |
372 | 378 |
|
373 | 379 |
} |
374 | 380 |
|
381 |
/** |
|
382 |
* @param message |
|
383 |
*/ |
|
384 |
private void showBadValuesMessage(String message) { |
|
385 |
|
|
386 |
ApplicationLocator.getManager().message( |
|
387 |
message, |
|
388 |
JOptionPane.WARNING_MESSAGE); |
|
389 |
|
|
390 |
/* |
|
391 |
* We cannot do this because window focus |
|
392 |
* causes exception in drawing |
|
393 |
* |
|
394 |
IWindow iw = PluginServices.getMDIManager().getActiveWindow(); |
|
395 |
Component pare = null; |
|
396 |
if (iw instanceof Component) { |
|
397 |
pare = (Component) iw; |
|
398 |
} |
|
399 |
|
|
400 |
String _tit = Messages.getText("editing"); |
|
401 |
String _msg = Messages.getText("_Invalid_values_in_some_fields_must_be_edited_before_end_editing"); |
|
402 |
_msg = _msg + "\n\n[" + message + "]"; |
|
403 |
|
|
404 |
JOptionPane.showMessageDialog( |
|
405 |
pare, |
|
406 |
_msg, _tit, |
|
407 |
JOptionPane.WARNING_MESSAGE); |
|
408 |
*/ |
|
409 |
} |
|
410 |
|
|
375 | 411 |
private void addCheckRules(FLyrVect layer) { |
376 | 412 |
try { |
377 | 413 |
FeatureType featureType = |
Also available in: Unified diff