Index: 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/DefaultFeatureTypePanel.java
===================================================================
--- 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/DefaultFeatureTypePanel.java	(revision 44151)
+++ 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/DefaultFeatureTypePanel.java	(revision 44152)
@@ -215,16 +215,19 @@
         }
     }
        
-    private void doFormFieldFetch() {
+    private boolean doFormFieldFetch() {
         int row = this.tblFields.getSelectedRow();
         if( row<0 ) {
-            return;
+            return true;
         }
         FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
         if( descriptor instanceof EditableFeatureAttributeDescriptor ) {
-            this.descriptorPanel.fetch((EditableFeatureAttributeDescriptor) descriptor);
+            if( this.descriptorPanel.fetch((EditableFeatureAttributeDescriptor) descriptor)==null ) {
+                return false;
+            }
             this.tableModel.fireUpdateEvent();
         } 
+        return true;
     }
     
     private void doFormFieldPut() {
@@ -249,6 +252,8 @@
         this.btnFormFieldAccept.setEnabled(false);
         this.btnFormFieldDiscard.setEnabled(false);
         this.btnFormFieldModify.setEnabled(this.editable);
+        this.btnNew.setEnabled(true);
+        this.btnDelete.setEnabled(true);
     }
     
     private void doFormFieldModify() {
@@ -262,6 +267,8 @@
         this.btnFormFieldAccept.setEnabled(this.editable);
         this.btnFormFieldDiscard.setEnabled(this.editable);
         this.btnFormFieldModify.setEnabled(false);
+        this.btnNew.setEnabled(false);
+        this.btnDelete.setEnabled(false);
         if( descriptor instanceof EditableFeatureAttributeDescriptor ) {
             this.descriptorPanel.setEditable(this.editable);
         } else {
@@ -271,9 +278,16 @@
     }
     
     private void doFormFieldAccept() {
-        doFormFieldFetch();
-        this.updateButtonState();
-        this.fieldSelectionAllowed = true;
+        int row = this.tblFields.getSelectedRow();
+        if( row<0 ) {
+            return;
+        }
+        if( doFormFieldFetch() ) {
+            this.updateButtonState();
+            this.tblFields.getSelectionModel().setSelectionInterval(row, row);
+            this.tblFields.scrollRectToVisible(this.tblFields.getCellRect(row, 0, true));
+            this.fieldSelectionAllowed = true;
+        }
     }
     
     private void doFormFieldDiscard() {
@@ -349,13 +363,15 @@
         EditableFeatureType eft = (EditableFeatureType)this.featureType;
         EditableFeatureAttributeDescriptor descriptor = eft.add(
                 getNewFieldName(this.featureType), 
-                DataTypes.STRING
+                DataTypes.STRING,
+                50
         );
         this.tableModel.fireUpdateEvent();
         int row = descriptor.getIndex();
         this.tblFields.getSelectionModel().addSelectionInterval(row,row);
+        this.tblFields.scrollRectToVisible(this.tblFields.getCellRect(row, 0, true));
         updateButtonState();
-        doFormFieldPut();       
+        doFormFieldModify();       
     }
     
     private void doDeleteField() {
Index: 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/DefaultFeatureTypeAttributePanel.java
===================================================================
--- 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/DefaultFeatureTypeAttributePanel.java	(revision 44151)
+++ 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/DefaultFeatureTypeAttributePanel.java	(revision 44152)
@@ -42,6 +42,7 @@
 import org.gvsig.timesupport.RelativeInterval;
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.dataTypes.DataTypesManager;
+import org.gvsig.tools.i18n.I18nManager;
 import org.gvsig.tools.swing.api.ListElement;
 import org.gvsig.tools.swing.api.ToolsSwingLocator;
 import org.gvsig.tools.swing.api.ToolsSwingManager;
@@ -204,9 +205,6 @@
         this.pickerPrecision = evaluatorManager.createCalculatorController(
                 this.txtPrecision, DataTypes.INT
         );
-//        this.pickerFieldName = evaluatorManager.createCalculatorController(
-//                this.txtFieldName, DataTypes.STRING
-//        );
         this.pickerDefaultValue = evaluatorManager.createCalculatorController(
                 this.txtDefaultValue, DataTypes.OBJECT
         );
@@ -276,14 +274,15 @@
 
     @Override
     public EditableFeatureAttributeDescriptor fetch(EditableFeatureAttributeDescriptor descriptor) {
+        I18nManager i18n = ToolsLocator.getI18nManager();
         try {
             descriptor.setDataType((int) ListElement.getSelected(this.cboFieldType));
             descriptor.setName(this.txtFieldName.getText());
             descriptor.setAllowNull(this.chkAllowNulls.isSelected());
             descriptor.setIsPrimaryKey(this.chkIsPrimaryKey.isSelected());
             descriptor.setIsAutomatic(this.chkIsAutomatic.isSelected());
-            descriptor.setSize(this.pickerSize.get());
-            descriptor.setPrecision(this.pickerPrecision.get());
+            descriptor.setSize(this.pickerSize.get(0));
+            descriptor.setPrecision(this.pickerPrecision.get(0));
             descriptor.setDefaultValue(this.pickerDefaultValue.get());
             switch (descriptor.getType()) {
                 case DataTypes.GEOMETRY:
@@ -310,11 +309,6 @@
                 if( expression==null ) {
                     descriptor.setFeatureAttributeEmulator(null);
                 } else {
-                    if( StringUtils.equalsIgnoreCase("Field1", descriptor.getName()) ) {
-                        if( !StringUtils.startsWithIgnoreCase(expression.getPhrase(), "IFNULL") ) {
-                            LOGGER.info("OOhh!!! sa-roto.");
-                        }
-                    }
                     DataManager dataManager = DALLocator.getDataManager();
                     FeatureAttributeEmulatorExpression emulator = dataManager.createFeatureAttributeEmulatorExpression(
                             descriptor.getFeatureType(),
@@ -323,17 +317,21 @@
                     descriptor.setFeatureAttributeEmulator(emulator);
                 }
             }
+            descriptor.setDataProfileName(
+                StringUtils.defaultIfBlank((String) this.cboDataProfile.getSelectedItem(),null)
+            );
         } catch (Exception ex) {
+            LOGGER.warn("Can't retrieve information from user form.",ex);
             ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
             dialogs.messageDialog(
-                    "Can't retrieve information from user form.", 
-                    "Warning", 
+                    i18n.getTranslation("_Cant_retrieve_information_from_user_form")+
+                        "\n"+
+                        i18n.getTranslation("_See_log_for_details"), 
+                    i18n.getTranslation("_Warning"), 
                     JOptionPane.WARNING_MESSAGE
             );
+            return null;
         }
-        descriptor.setDataProfileName(
-            StringUtils.defaultIfBlank((String) this.cboDataProfile.getSelectedItem(),null)
-        );
         return descriptor;
     }
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44151)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44152)
@@ -1356,4 +1356,5 @@
 _Show_message=Mostrar error
 _Message=Mensaje
 _Tip=Sugerencia
-
+_Cant_retrieve_information_from_user_form=No se puede recuperar informaci\u00f3n del formulario de usuario.
+_See_log_for_details=Ver el registro para m\u00e1s detalles.
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44151)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44152)
@@ -1275,3 +1275,5 @@
 _Show_message=Show message
 _Message=Message
 _Tip=Tip
+_Cant_retrieve_information_from_user_form=Can't retrieve information from user form.
+_See_log_for_details=See log for details.
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/CalculatorController.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/CalculatorController.java	(revision 44151)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.api/src/main/java/org/gvsig/expressionevaluator/swing/CalculatorController.java	(revision 44152)
@@ -16,6 +16,8 @@
 
     public T get();
 
+    public T get(T defaultValue);
+
     public void set(T value);
 
     public void coerceAndSet(Object value);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultCalculatorController.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultCalculatorController.java	(revision 44151)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultCalculatorController.java	(revision 44152)
@@ -227,8 +227,16 @@
     public boolean getWarning() {
         return warning;
     }
+
+    @Override
+    public T get(T defaultValue) {
+        T v = this.get();
+        if( v==null ) {
+            return defaultValue;
+        }
+        return v;
+    }
     
-    
     @Override
     public T get() {
         Object value;
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultJExpressionBuilder.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultJExpressionBuilder.java	(revision 44151)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultJExpressionBuilder.java	(revision 44152)
@@ -752,7 +752,7 @@
     public void setExpression(Expression expression) {
         if( expression==null ) {
             this.txtExpression.setText("");
-            this.scriptEditor.set(null);
+            try { this.scriptEditor.set(null); } catch(Exception ex) {}
             this.scriptPicker.set(null);
         } else {
             this.txtExpression.setText(expression.getPhrase());
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultExpressionPickerController.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultExpressionPickerController.java	(revision 44151)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultExpressionPickerController.java	(revision 44152)
@@ -114,9 +114,13 @@
     
     @Override
     public Expression get() {
-        if( value == null ) {
+        String s = this.text.getText();
+        if( StringUtils.isBlank(s) ) {
             return null;
         }
+        if( value == null ) {
+            value = ExpressionEvaluatorLocator.getManager().createExpression();
+        }
         this.value.setPhrase(this.text.getText());
         return this.value;
     }
