Revision 25089 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableFieldOperations.java
TableFieldOperations.java | ||
---|---|---|
60 | 60 |
* Table to operate |
61 | 61 |
*/ |
62 | 62 |
protected void doExecute(String actionCommand,FeatureTableDocumentPanel table){ |
63 |
int fieldIndex = table.getSelectedFieldIndices().nextSetBit(0); |
|
64 |
FeatureStore fs=table.getModel().getStore(); |
|
65 |
// DataSource sds=null; |
|
66 |
// try { |
|
67 |
// sds = table.getModel().getModelo().getRecordset(); |
|
68 |
// String dsName = sds.getName(); |
|
69 |
|
|
70 |
String fieldName=null; |
|
71 |
try { |
|
72 |
fieldName = ((FeatureAttributeDescriptor)fs.getDefaultFeatureType().get(fieldIndex)).getName(); |
|
73 |
} catch (DataException e) { |
|
74 |
// TODO Auto-generated catch block |
|
75 |
e.printStackTrace(); |
|
76 |
} |
|
77 |
String sql = fieldName; |
|
78 |
if ("ORDERASC".equals(actionCommand)){ |
|
79 |
sql += " ASC"; |
|
80 |
}else{ |
|
81 |
sql += " DESC"; |
|
82 |
} |
|
83 |
// DataSource ds = sds.getDataSourceFactory().executeSQL(sql, DataSourceFactory.MANUAL_OPENING); |
|
84 |
table.setOrder(sql); |
|
85 |
// } catch (ReadDriverException e) { |
|
86 |
// NotificationManager.addError("No se pudo ordenar", e); |
|
87 |
// } catch (ParseException e) { |
|
88 |
// throw new RuntimeException(e); |
|
89 |
// } catch (DriverLoadException e) { |
|
90 |
// NotificationManager.addError("Error con la carga de drivers", e); |
|
91 |
// } catch (SemanticException e) { |
|
92 |
// throw new RuntimeException(e); |
|
93 |
// } catch (IOException e) { |
|
94 |
// throw new RuntimeException(e); |
|
95 |
// } catch (EvaluationException e) { |
|
96 |
// throw new RuntimeException(e); |
|
97 |
// } |
|
63 |
// FIXME |
|
64 |
// int fieldIndex = table.getSelectedFieldIndices().nextSetBit(0); |
|
65 |
// FeatureStore fs=table.getModel().getStore(); |
|
66 |
//// DataSource sds=null; |
|
67 |
//// try { |
|
68 |
//// sds = table.getModel().getModelo().getRecordset(); |
|
69 |
//// String dsName = sds.getName(); |
|
70 |
// |
|
71 |
// String fieldName=null; |
|
72 |
// try { |
|
73 |
// fieldName = ((FeatureAttributeDescriptor)fs.getDefaultFeatureType().get(fieldIndex)).getName(); |
|
74 |
// } catch (DataException e) { |
|
75 |
// // TODO Auto-generated catch block |
|
76 |
// e.printStackTrace(); |
|
77 |
// } |
|
78 |
// String sql = fieldName; |
|
79 |
// if ("ORDERASC".equals(actionCommand)){ |
|
80 |
// sql += " ASC"; |
|
81 |
// }else{ |
|
82 |
// sql += " DESC"; |
|
83 |
// } |
|
84 |
//// DataSource ds = sds.getDataSourceFactory().executeSQL(sql, DataSourceFactory.MANUAL_OPENING); |
|
85 |
// table.setOrder(sql); |
|
86 |
//// } catch (ReadDriverException e) { |
|
87 |
//// NotificationManager.addError("No se pudo ordenar", e); |
|
88 |
//// } catch (ParseException e) { |
|
89 |
//// throw new RuntimeException(e); |
|
90 |
//// } catch (DriverLoadException e) { |
|
91 |
//// NotificationManager.addError("Error con la carga de drivers", e); |
|
92 |
//// } catch (SemanticException e) { |
|
93 |
//// throw new RuntimeException(e); |
|
94 |
//// } catch (IOException e) { |
|
95 |
//// throw new RuntimeException(e); |
|
96 |
//// } catch (EvaluationException e) { |
|
97 |
//// throw new RuntimeException(e); |
|
98 |
//// } |
|
98 | 99 |
} |
99 | 100 |
|
100 | 101 |
/** |
... | ... | |
108 | 109 |
} |
109 | 110 |
|
110 | 111 |
if (v instanceof FeatureTableDocumentPanel) { |
111 |
FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) v; |
|
112 |
BitSet indices = t.getSelectedFieldIndices(); |
|
113 |
if (indices.cardinality() == 1){ |
|
114 |
return true; |
|
115 |
} |
|
112 |
// FIXME |
|
113 |
// FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) v; |
|
114 |
// BitSet indices = t.getSelectedFieldIndices(); |
|
115 |
// if (indices.cardinality() == 1){ |
|
116 |
// return true; |
|
117 |
// } |
|
116 | 118 |
} |
117 | 119 |
return false; |
118 | 120 |
} |
Also available in: Unified diff