Revision 46542 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.geodb.app/org.gvsig.geodb.app.mainplugin/src/main/java/org/gvsig/geodb/vectorialdb/wizard/WizardDB.java
WizardDB.java | ||
---|---|---|
33 | 33 |
import java.util.List; |
34 | 34 |
import java.util.Map; |
35 | 35 |
import java.util.Map.Entry; |
36 |
|
|
37 |
import javax.swing.DefaultListModel; |
|
38 | 36 |
import javax.swing.JComboBox; |
39 | 37 |
import javax.swing.JOptionPane; |
40 | 38 |
import javax.swing.JPanel; |
... | ... | |
45 | 43 |
import javax.swing.event.AncestorListener; |
46 | 44 |
import javax.swing.event.ListSelectionEvent; |
47 | 45 |
import javax.swing.event.ListSelectionListener; |
48 |
|
|
49 |
import org.apache.commons.collections.map.HashedMap; |
|
50 | 46 |
import org.apache.commons.lang3.text.WordUtils; |
51 | 47 |
import org.cresques.cts.IProjection; |
52 |
import org.slf4j.Logger; |
|
53 |
import org.slf4j.LoggerFactory; |
|
54 |
|
|
55 | 48 |
import org.gvsig.andami.IconThemeHelper; |
56 | 49 |
import org.gvsig.andami.PluginServices; |
57 | 50 |
import org.gvsig.andami.PluginsLocator; |
... | ... | |
74 | 67 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
75 | 68 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorer; |
76 | 69 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorerParameters; |
77 |
import org.gvsig.fmap.dal.store.db.DBStoreParameters; |
|
70 |
import org.gvsig.fmap.dal.store.db.AbstractDBStoreParameters;
|
|
78 | 71 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
79 | 72 |
import org.gvsig.fmap.mapcontrol.MapControl; |
80 | 73 |
import org.gvsig.geodb.ExtDB_Spatial; |
81 | 74 |
import org.gvsig.gui.beans.swing.JButton; |
82 | 75 |
import org.gvsig.i18n.Messages; |
83 | 76 |
import org.gvsig.tools.dynobject.DynObject; |
77 |
import org.slf4j.Logger; |
|
78 |
import org.slf4j.LoggerFactory; |
|
84 | 79 |
|
85 | 80 |
public class WizardDB extends WizardPanel implements ActionListener, |
86 | 81 |
ListSelectionListener { |
... | ... | |
192 | 187 |
|
193 | 188 |
ApplicationManager appGvSIGMan = ApplicationLocator.getManager(); |
194 | 189 |
PrepareContext context = this.getPrepareDataStoreContext(); |
195 |
DBStoreParameters storeParams; |
|
190 |
AbstractDBStoreParameters storeParams;
|
|
196 | 191 |
List<TableDocument> tabledocs |
197 | 192 |
= new ArrayList<TableDocument>(tables.length); |
198 | 193 |
for ( TablesListItem table : tables ) { |
199 | 194 |
storeParams = getParameterForTable(table); |
200 | 195 |
|
201 | 196 |
try { |
202 |
storeParams = (DBStoreParameters) appGvSIGMan |
|
197 |
storeParams = (AbstractDBStoreParameters) appGvSIGMan
|
|
203 | 198 |
.prepareOpenDataStoreParameters(storeParams, context); |
204 | 199 |
} catch (Exception e2) { |
205 | 200 |
NotificationManager.addError(e2); |
... | ... | |
234 | 229 |
return tabledocs; |
235 | 230 |
} |
236 | 231 |
|
237 |
protected DBStoreParameters getParameterForTable(TablesListItem table) { |
|
238 |
DBStoreParameters parameters = table.getParameters(); |
|
232 |
protected AbstractDBStoreParameters getParameterForTable(TablesListItem table) {
|
|
233 |
AbstractDBStoreParameters parameters = table.getParameters();
|
|
239 | 234 |
|
240 | 235 |
UserTableSettingsPanel userTableSettingsPanel = table |
241 | 236 |
.getUserTableSettingsPanel(); |
... | ... | |
431 | 426 |
return myExplorer; |
432 | 427 |
} |
433 | 428 |
|
434 |
protected TablesListItem createTabeListItem(DBStoreParameters param) { |
|
429 |
protected TablesListItem createTabeListItem(AbstractDBStoreParameters param) {
|
|
435 | 430 |
return new TablesListItem(param, this); |
436 | 431 |
} |
437 | 432 |
|
... | ... | |
443 | 438 |
* @return |
444 | 439 |
* @throws DataException |
445 | 440 |
*/ |
446 |
protected List<DBStoreParameters> getTableList(DBServerExplorer explorer) throws DataException { |
|
447 |
List<DBStoreParameters> l = new ArrayList<>(); |
|
441 |
protected List<AbstractDBStoreParameters> getTableList(DBServerExplorer explorer) throws DataException {
|
|
442 |
List<AbstractDBStoreParameters> l = new ArrayList<>();
|
|
448 | 443 |
l.addAll((List) explorer.list()); |
449 |
l.sort(new Comparator<DBStoreParameters>() { |
|
444 |
l.sort(new Comparator<AbstractDBStoreParameters>() {
|
|
450 | 445 |
@Override |
451 |
public int compare(DBStoreParameters o1, DBStoreParameters o2) {
|
|
446 |
public int compare(AbstractDBStoreParameters o1, AbstractDBStoreParameters o2) {
|
|
452 | 447 |
try { |
453 | 448 |
return o1.getTable().compareToIgnoreCase(o2.getTable()); |
454 | 449 |
} catch(Exception ex) { |
... | ... | |
472 | 467 |
|
473 | 468 |
List parameters = getTableList(dbExplorer); |
474 | 469 |
List<TablesListItem> tableListItems = new ArrayList<>(); |
475 |
Iterator<DBStoreParameters> iter = parameters.iterator(); |
|
470 |
Iterator<AbstractDBStoreParameters> iter = parameters.iterator();
|
|
476 | 471 |
while ( iter.hasNext() ) { |
477 |
DBStoreParameters param = iter.next(); |
|
472 |
AbstractDBStoreParameters param = iter.next();
|
|
478 | 473 |
tableListItems.add(createTabeListItem(param)); |
479 | 474 |
} |
480 | 475 |
tableListItems.sort(null); |
... | ... | |
660 | 655 |
try { |
661 | 656 |
TablesListItem[] selected = getSelectedTables(); |
662 | 657 |
int count = selected.length; |
663 |
DBStoreParameters[] dbParameters = new DBStoreParameters[count];
|
|
658 |
AbstractDBStoreParameters[] dbParameters = new AbstractDBStoreParameters[count];
|
|
664 | 659 |
|
665 | 660 |
for ( int i = 0; i < count; i++ ) { |
666 | 661 |
TablesListItem item = selected[i]; |
Also available in: Unified diff