Index: SelectTableNamePanel.java
===================================================================
--- SelectTableNamePanel.java	(revision 44385)
+++ SelectTableNamePanel.java	(revision 44386)
@@ -37,9 +37,6 @@
 import org.apache.commons.lang3.StringUtils;
 import org.gvsig.export.jdbc.service.ExportJDBCAttributeNamesTranslator;
 import org.gvsig.export.jdbc.service.ExportJDBCParameters;
-import org.gvsig.export.spi.AttributeNamesTranslator;
-//import org.gvsig.app.ApplicationLocator;
-//import org.gvsig.app.ApplicationManager;
 import org.gvsig.fmap.dal.DALLocator;
 import org.gvsig.fmap.dal.DataManager;
 import org.gvsig.fmap.dal.SQLBuilder;
@@ -64,10 +61,9 @@
  * @version $Id$
  *
  */
-public class SelectTableNamePanel 
-        extends SelectTableNamePanelLayout 
-        implements ExportPanel 
-    {
+public class SelectTableNamePanel
+        extends SelectTableNamePanelLayout
+        implements ExportPanel {
 
     private static final Logger logger = LoggerFactory.getLogger(SelectTableNamePanel.class);
 
@@ -84,9 +80,9 @@
         }
 
         public TableItem(JDBCStoreParameters params) {
-            this( StringUtils.isEmpty(params.getSchema())? 
-                params.getTable() : params.getSchema() + "." + params.getTable(), 
-                params);
+            this(StringUtils.isEmpty(params.getSchema())
+                    ? params.getTable() : params.getSchema() + "." + params.getTable(),
+                    params);
         }
 
         @Override
@@ -106,9 +102,9 @@
 
     @SuppressWarnings("OverridableMethodCallInConstructor")
     public SelectTableNamePanel(
-            JExportProcessPanel processPanel, 
+            JExportProcessPanel processPanel,
             ExportJDBCParameters parameters
-        ) {
+    ) {
         this.processPanel = processPanel;
         this.parameters = parameters;
         initComponents();
@@ -205,7 +201,6 @@
         return tableParameter.getTable();
     }
 
-
     @Override
     public String getIdPanel() {
         return this.getClass().getCanonicalName();
@@ -241,7 +236,7 @@
             );
         }
         String schema = this.getSchema();
-        if( sqlbuilder.support_schemas() ) {
+        if (sqlbuilder.support_schemas()) {
             if (schema == null) {
                 throw new ExportPanelValidationException(
                         i18nManager.getTranslation(
@@ -251,32 +246,22 @@
             }
         }
         if (this.rdoCreateTable.isSelected()) {
-            String tablename_tr = tablename;
-            ExportJDBCAttributeNamesTranslator nameTranslator = 
-                    (ExportJDBCAttributeNamesTranslator) this.parameters.getExportAttributes().getNamesTranslator();
-            if( nameTranslator.getTranslateIdentifiersToLowerCase() ) {
-                tablename_tr = tablename_tr.toLowerCase();
-            }
-            if( nameTranslator.getTranslateHyphens()) {
-                tablename_tr = tablename_tr.replace("-", "_");
-                tablename_tr = tablename_tr.replace(".", "_");                
-            }
-            if( nameTranslator.getRemoveSpacesInIdentifiers() ) {
-                tablename_tr = StringUtils.normalizeSpace(tablename_tr).replace(" ", "_");
-            }
-            if( !tablename_tr.equals(tablename) ) {
+            ExportJDBCAttributeNamesTranslator nameTranslator
+                    = (ExportJDBCAttributeNamesTranslator) this.parameters.getExportAttributes().getNamesTranslator();
+            String tablename_tr = nameTranslator.getNameSuggestion(tablename);
+            if (!tablename_tr.equals(tablename)) {
                 String msg = i18nManager.getTranslation(
                         "Ha_utilizado_espacios_en_blanco_o_mayusculas_en_el_nombre_de_la_tabla_Desea_que_se_corrija_de_forma_automatica"
                 );
                 ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
                 int resp = dialogs.confirmDialog(
-                        msg, 
+                        msg,
                         i18nManager.getTranslation("_Warning"),
-                        JOptionPane.YES_NO_OPTION, 
+                        JOptionPane.YES_NO_OPTION,
                         JOptionPane.WARNING_MESSAGE,
                         "Exportto_Table_name_with_spaces_or_mixed_case"
                 );
-                if( resp != JOptionPane.YES_OPTION ) {
+                if (resp != JOptionPane.YES_OPTION) {
                     msg = i18nManager.getTranslation(
                             "El_nombre_de_tabla_contiene_caracteres no_validos"
                     );
@@ -288,8 +273,8 @@
             ListModel model = this.lstTables.getModel();
             for (int i = 0; i < model.getSize(); i++) {
                 TableItem item = (TableItem) model.getElementAt(i);
-                if ( StringUtils.equals(schema,item.getParams().getSchema())
-                        && StringUtils.equals(tablename,item.getParams().getTable())) {
+                if (StringUtils.equals(schema, item.getParams().getSchema())
+                        && StringUtils.equals(tablename, item.getParams().getTable())) {
                     String msg = i18nManager.getTranslation(
                             "_La_tabla_{0}_{1}_ya_existe_en_la_base_de_datos_Seleccione_la_opcion_de_insertar_registros_en_una_tabla_existente_para_añadir_los_datos_a_esta_o_indique_otro_nombre",
                             new String[]{schema, tablename}
@@ -312,14 +297,35 @@
         try {
             DataManager dataManager = DALLocator.getDataManager();
             JDBCServerExplorer explorer = (JDBCServerExplorer) dataManager.openServerExplorer(
-                explorerParameters.getExplorerName(),
-                explorerParameters
+                    explorerParameters.getExplorerName(),
+                    explorerParameters
             );
             this.sqlbuilder = explorer.createSQLBuilder();
         } catch (Exception ex) {
             throw new RuntimeException("Can't retrieve the sqlbuilder", ex);
         }
         this.fillTablesList();
+
+        // set values from params
+        this.rdoCreateTable.setSelected(this.parameters.canCreatetable());
+        if (this.parameters.canCreatetable() == true) {
+            if (this.parameters.getSchema() != null) {
+                this.txtSchema.setText(this.parameters.getSchema());
+                this.txtTableName.setText(this.parameters.getTableName());
+            }
+        } else {
+            String schema = this.parameters.getSchema();
+            if (schema != null) {
+                //this.lstTables;
+                for (int i = 0; i < this.lstTables.getModel().getSize(); i++) {
+                    TableItem item = (TableItem) this.lstTables.getModel().getElementAt(i);
+                    JDBCStoreParameters tableParameter = item.getParams();
+                    if (tableParameter.getSchema() == null ? schema == null : tableParameter.getSchema().equals(schema)) {
+                        this.lstTables.setSelectedIndex(i);
+                    }
+                }
+            }
+        }
     }
 
     @Override
@@ -385,7 +391,7 @@
 
                     @Override
                     public void run() {
-                        if( sqlbuilder.support_schemas() ) {
+                        if (sqlbuilder.support_schemas()) {
                             txtSchema.setText(sqlbuilder.default_schema());
                         } else {
                             txtSchema.setText("");
@@ -426,15 +432,15 @@
                 if (status.isCancellationRequested()) {
                     status.cancel();
                 }
-                if (status.isRunning()) {                                
+                if (status.isRunning()) {
                     I18nManager i18nManager = ToolsLocator.getI18nManager();
                     ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
                     dialogs.messageDialog(
                             i18nManager.getTranslation("_There_have_been_problems_filling_data_in_panel")
-                                + " (" + getTitlePanel() + ")",
-                            null, 
+                            + " (" + getTitlePanel() + ")",
+                            null,
                             i18nManager.getTranslation("_Warning"),
-                            JOptionPane.WARNING_MESSAGE, 
+                            JOptionPane.WARNING_MESSAGE,
                             "ProblemsFillingTableNamePanel"
                     );
                 }
