Revision 39486
branches/v2_0_0_prep/extensions/extGeoDB/src/org/gvsig/geodb/vectorialdb/wizard/TablesListItem.java | ||
---|---|---|
48 | 48 |
import javax.swing.JCheckBox; |
49 | 49 |
|
50 | 50 |
import org.cresques.cts.IProjection; |
51 |
import org.slf4j.Logger; |
|
52 |
import org.slf4j.LoggerFactory; |
|
51 | 53 |
|
52 | 54 |
import org.gvsig.andami.messages.NotificationManager; |
53 | 55 |
import org.gvsig.app.addlayer.AddLayerDialog; |
54 |
import org.gvsig.app.gui.panels.CRSSelectPanel; |
|
55 | 56 |
import org.gvsig.fmap.dal.exception.DataException; |
56 | 57 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
57 | 58 |
import org.gvsig.fmap.dal.feature.FeatureType; |
58 | 59 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorer; |
59 | 60 |
import org.gvsig.fmap.dal.store.db.DBStoreParameters; |
61 |
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters; |
|
60 | 62 |
|
61 | 63 |
|
62 | 64 |
|
... | ... | |
67 | 69 |
* |
68 | 70 |
*/ |
69 | 71 |
public class TablesListItem extends JCheckBox { |
72 |
|
|
73 |
private static Logger logger = LoggerFactory.getLogger(TablesListItem.class); |
|
74 |
|
|
70 | 75 |
protected String tableName = ""; |
76 |
protected String schemaName = ""; |
|
77 |
|
|
71 | 78 |
private UserSelectedFieldsPanel selectedFieldsPanel = null; |
72 | 79 |
protected WizardDB parent = null; |
73 | 80 |
private boolean activated = false; |
74 |
private CRSSelectPanel jPanelProj; |
|
81 |
// private CRSSelectPanel jPanelProj;
|
|
75 | 82 |
protected DBStoreParameters parameters; |
76 | 83 |
protected DBServerExplorer explorer; |
77 | 84 |
protected UserTableSettingsPanel tableSettingsPanel = null; |
... | ... | |
79 | 86 |
public TablesListItem(DBServerExplorer explorer, |
80 | 87 |
DBStoreParameters param, |
81 | 88 |
WizardDB _parent) { |
89 |
|
|
82 | 90 |
tableName = param.getTable(); |
83 |
setText(tableName); |
|
91 |
schemaName = getSchema(param); |
|
92 |
|
|
93 |
setText(toString()); |
|
84 | 94 |
this.parameters = param; |
85 | 95 |
this.explorer=explorer; |
86 | 96 |
parent = _parent; |
87 | 97 |
} |
98 |
|
|
88 | 99 |
|
100 |
|
|
101 |
/** |
|
102 |
* @param param |
|
103 |
* @return |
|
104 |
*/ |
|
105 |
private String getSchema(DBStoreParameters dynobj) { |
|
106 |
|
|
107 |
String resp = null; |
|
108 |
try { |
|
109 |
resp = (String) dynobj.getDynValue( |
|
110 |
JDBCConnectionParameters.SCHEMA_PARAMTER_NAME); |
|
111 |
} catch (Exception ex) { |
|
112 |
// logger.info("did not find schema in DB parameters."); |
|
113 |
} |
|
114 |
return resp; |
|
115 |
} |
|
116 |
|
|
89 | 117 |
public void activate() { |
90 | 118 |
activated = true; |
91 | 119 |
selectedFieldsPanel.loadValues(); |
... | ... | |
114 | 142 |
} |
115 | 143 |
|
116 | 144 |
public String toString() { |
117 |
return tableName; |
|
145 |
if (schemaName == null || schemaName.length() == 0) { |
|
146 |
return tableName; |
|
147 |
} else { |
|
148 |
return schemaName + "." + tableName; |
|
149 |
} |
|
150 |
|
|
118 | 151 |
} |
119 | 152 |
|
120 | 153 |
public String getTableName() { |
Also available in: Unified diff