Revision 39279 branches/v2_0_0_prep/extensions/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerTableWizardPanel.java
FilesystemExplorerTableWizardPanel.java | ||
---|---|---|
31 | 31 |
import java.util.ArrayList; |
32 | 32 |
import java.util.List; |
33 | 33 |
|
34 |
import javax.swing.JOptionPane; |
|
35 |
|
|
34 | 36 |
import org.cresques.cts.IProjection; |
37 |
import org.slf4j.Logger; |
|
38 |
import org.slf4j.LoggerFactory; |
|
39 |
|
|
35 | 40 |
import org.gvsig.andami.PluginServices; |
36 | 41 |
import org.gvsig.andami.messages.NotificationManager; |
37 | 42 |
import org.gvsig.app.ApplicationLocator; |
... | ... | |
44 | 49 |
import org.gvsig.fmap.dal.DALLocator; |
45 | 50 |
import org.gvsig.fmap.dal.DataManager; |
46 | 51 |
import org.gvsig.fmap.dal.DataStoreParameters; |
52 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
47 | 53 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
54 |
import org.gvsig.i18n.Messages; |
|
48 | 55 |
|
49 | 56 |
public class FilesystemExplorerTableWizardPanel extends |
50 | 57 |
FilesystemExplorerWizardPanel { |
51 | 58 |
|
52 | 59 |
private static final long serialVersionUID = 8469934188826417698L; |
60 |
private static final Logger LOG = LoggerFactory.getLogger( |
|
61 |
FilesystemExplorerTableWizardPanel.class); |
|
53 | 62 |
|
54 | 63 |
private PrepareContext prepareDSContext = null; |
55 | 64 |
|
56 |
|
|
57 | 65 |
@Override |
58 | 66 |
public void execute() { |
59 | 67 |
executeWizard(); |
... | ... | |
70 | 78 |
DataStoreParameters[] parameters = this.getParameters(); |
71 | 79 |
List<TableDocument> tabledocs = |
72 | 80 |
new ArrayList<TableDocument>(parameters.length); |
81 |
|
|
82 |
String not_valid = ""; |
|
73 | 83 |
for (DataStoreParameters params : parameters) { |
74 | 84 |
store = null; |
85 |
|
|
86 |
/* |
|
87 |
* Try to validate. |
|
88 |
*/ |
|
75 | 89 |
try { |
90 |
params.validate(); |
|
91 |
} catch (ValidateDataParametersException ecx) { |
|
92 |
LOG.info("Unable to validate params: " + params.getDataStoreName()); |
|
93 |
if (not_valid.length() == 0) { |
|
94 |
not_valid = params.getDataStoreName(); |
|
95 |
} else { |
|
96 |
not_valid = not_valid + ", " + params.getDataStoreName(); |
|
97 |
} |
|
98 |
|
|
99 |
continue; |
|
100 |
} |
|
101 |
|
|
102 |
try { |
|
103 |
|
|
76 | 104 |
DataManager dataManager = DALLocator.getDataManager(); |
77 | 105 |
store = |
78 | 106 |
(FeatureStore) dataManager.openStore( |
... | ... | |
95 | 123 |
} |
96 | 124 |
|
97 | 125 |
} |
126 |
|
|
127 |
if (not_valid.length() > 0) { |
|
128 |
JOptionPane.showMessageDialog( |
|
129 |
this, |
|
130 |
Messages.getText("_These_sources_were_not_loaded") |
|
131 |
+ ": " + not_valid, |
|
132 |
Messages.getText("_Load_error"), |
|
133 |
JOptionPane.WARNING_MESSAGE); |
|
134 |
} |
|
98 | 135 |
return tabledocs; |
99 | 136 |
} |
100 | 137 |
|
Also available in: Unified diff