Revision 46104 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretype/DefaultFeatureAttributePanel.java

View differences:

DefaultFeatureAttributePanel.java
108 108
    private final JComponent lblMinValue = new JLabel();
109 109
    private final JComponent lblMaxValue = new JLabel();
110 110
    // ----
111
    private Feature sampleFeature;
111 112

  
112 113
    private static class ForeingKeyController {
113 114

  
......
913 914
                                JOptionPane.WARNING_MESSAGE
914 915
                        );
915 916
                    }
916
                    descriptor.setFeatureAttributeEmulator(emulator);
917 917
                    //
918 918
                    // No se porque esto de abajo no funciona.
919 919
                    // Nunca se lanza la excepcion en el get(Feature) de
920 920
                    // DefaultFeatureAttributeEmulatorExpression.
921 921
                    //
922
//                    try {
923
//                        emulator.setEnableExceptions(true);
922
                    try {
923
                        emulator.setEnableExceptions(true);
924 924
//                        descriptor.setFeatureAttributeEmulator(emulator);
925
//                        this.pickerVirtualField.getPreviewSymbolTable().value(descriptor.getName());
926
//                    } catch(Throwable ex) {
925
                        emulator.get(this.sampleFeature);
926
                    } catch(Throwable ex) {
927 927
//                        emulator.setEnableExceptions(false);
928 928
//                        descriptor.setFeatureAttributeEmulator(null);
929
//                        ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
930
//                        dialogs.messageDialog(
931
//                                i18n.getTranslation("_The_expression_of_virtual_field_is_not_valid")+
932
//                                    "\n"+
933
//                                    ex.getMessage(), 
934
//                                i18n.getTranslation("_Warning"), 
935
//                                JOptionPane.WARNING_MESSAGE
936
//                        );
929
                        ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
930
                        dialogs.messageDialog(
931
                                i18n.getTranslation("_The_expression_can_not_be_evaluated_right_now_It_could_be_valid_when_all_changes_has_been_applied")+
932
                                    "\n"+
933
                                    ex.getMessage(), 
934
                                i18n.getTranslation("_Warning"), 
935
                                JOptionPane.WARNING_MESSAGE
936
                        );
937 937
//                        return null;
938
//                    } finally {
939
//                        emulator.setEnableExceptions(false);
940
//                    }
938
                    } finally {
939
                        emulator.setEnableExceptions(false);
940
                    }
941
                    descriptor.setFeatureAttributeEmulator(emulator);
941 942
                }
942 943
            }
943 944
        } catch (Exception ex) {
......
1026 1027
            FeatureStore store = descriptor.getFeatureType().getStore();
1027 1028
            this.featureStoreElement.setFeatureStore(store);
1028 1029
            if (store != null) {
1029
                Feature sampleFeature = null;
1030
                this.sampleFeature = null;
1030 1031
                try {
1031 1032
                    sampleFeature = store.getFeatureSelection().first();
1032 1033
                    if (sampleFeature == null) {

Also available in: Unified diff