Revision 11012 branches/v10/extensions/extSDE/src/com/iver/cit/gvsig/sde/gui/sdewizard2/TablesListItem.java
TablesListItem.java | ||
---|---|---|
47 | 47 |
import javax.swing.JCheckBox; |
48 | 48 |
|
49 | 49 |
import com.esri.sde.sdk.client.SeConnection; |
50 |
import com.esri.sde.sdk.client.SeException; |
|
51 |
import com.esri.sde.sdk.client.SeRegisteredColumn; |
|
52 |
import com.esri.sde.sdk.client.SeTable; |
|
50 | 53 |
import com.iver.cit.gvsig.fmap.MapControl; |
51 |
import com.iver.cit.gvsig.fmap.drivers.VectorialSDEDriver; |
|
52 | 54 |
import com.iver.cit.gvsig.fmap.drivers.sde.ArcSdeDriver; |
55 |
import com.iver.cit.gvsig.fmap.drivers.sde.VectorialSDEDriver; |
|
53 | 56 |
|
54 | 57 |
|
55 | 58 |
/** |
... | ... | |
121 | 124 |
public UserSelectedFieldsPanel getUserSelectedFieldsPanel() |
122 | 125 |
throws SQLException { |
123 | 126 |
if (selectedFieldsPanel == null) { |
124 |
String[] allf = driver.getAllFields(conn, tableName);
|
|
125 |
String[] allt = driver.getAllFieldTypeNames(conn, tableName);
|
|
127 |
String[] allf = getAllFields(conn, tableName); |
|
128 |
String[] allt = getAllFieldTypeNames(conn, tableName); |
|
126 | 129 |
selectedFieldsPanel = new UserSelectedFieldsPanel(allf, allt, true, |
127 | 130 |
parent); |
128 | 131 |
} |
... | ... | |
133 | 136 |
public UserTableSettingsPanel getUserTableSettingsPanel() |
134 | 137 |
throws SQLException { |
135 | 138 |
if (tableSettingsPanel == null) { |
136 |
String[] ids = driver.getIdFieldsCandidates(conn, tableName);
|
|
137 |
String[] geos = driver.getGeometryFieldsCandidates(conn, tableName);
|
|
139 |
String[] ids = getIdFieldsCandidates(conn, tableName); |
|
140 |
String[] geos = getGeometryFieldsCandidates(conn, tableName); |
|
138 | 141 |
|
139 | 142 |
int ids_size = ids.length; |
140 | 143 |
FieldComboItem[] ids_ci = new FieldComboItem[ids_size]; |
... | ... | |
154 | 157 |
|
155 | 158 |
return tableSettingsPanel; |
156 | 159 |
} |
160 |
|
|
161 |
|
|
162 |
|
|
163 |
public String[] getAllFields(Object conex, String tableName) { |
|
164 |
try { |
|
165 |
SeTable table = new SeTable(((SeConnection)conex),tableName); |
|
166 |
SeRegisteredColumn[] columns=table.getColumnList(); |
|
167 |
String[] fieldNames=new String[columns.length]; |
|
168 |
for (int i=0; i < columns.length; i++){ |
|
169 |
fieldNames[i]=columns[i].getName(); |
|
170 |
} |
|
171 |
return fieldNames; |
|
172 |
} catch (SeException e) { |
|
173 |
e.printStackTrace(); |
|
174 |
} |
|
175 |
return null; |
|
176 |
} |
|
177 |
public String[] getAllFieldTypeNames(Object conex, String tableName) { |
|
178 |
try { |
|
179 |
SeTable table = new SeTable(((SeConnection)conex),tableName); |
|
180 |
SeRegisteredColumn[] columns=table.getColumnList(); |
|
181 |
String[] fieldNames=new String[columns.length]; |
|
182 |
for (int i=0; i < columns.length; i++){ |
|
183 |
fieldNames[i]=String.valueOf(columns[i].getType()); |
|
184 |
} |
|
185 |
return fieldNames; |
|
186 |
} catch (SeException e) { |
|
187 |
e.printStackTrace(); |
|
188 |
} |
|
189 |
return null; |
|
190 |
} |
|
191 |
public String[] getIdFieldsCandidates(Object conn2, String tableName) { |
|
192 |
return new String[]{"OBJECTID"};//getAllFields(conn2,tableName); |
|
193 |
} |
|
194 |
public String[] getGeometryFieldsCandidates(Object conn2, String tableName) { |
|
195 |
return new String[]{"SHAPE"};//getAllFields(conn2,tableName); |
|
196 |
} |
|
197 |
|
|
157 | 198 |
} |
Also available in: Unified diff