Revision 47037 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/TableEditAttributes.java
TableEditAttributes.java | ||
---|---|---|
28 | 28 |
import java.io.File; |
29 | 29 |
import java.io.IOException; |
30 | 30 |
import java.nio.charset.StandardCharsets; |
31 |
import java.util.Iterator; |
|
31 | 32 |
import java.util.Objects; |
32 | 33 |
import javax.swing.AbstractAction; |
33 | 34 |
import javax.swing.Action; |
... | ... | |
56 | 57 |
import org.gvsig.fmap.dal.DataTypes; |
57 | 58 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
58 | 59 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
60 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
61 |
import org.gvsig.fmap.dal.feature.FeatureQueryOrder; |
|
59 | 62 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
60 | 63 |
import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory; |
61 | 64 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
237 | 240 |
} |
238 | 241 |
try { |
239 | 242 |
panel.fetch(editableFeatureType); |
243 |
|
|
244 |
FeatureQuery query = tablePanel.getTablePanel().getFeatureQuery(); |
|
245 |
if (query != null) { |
|
246 |
FeatureQueryOrder order = query.getOrder(); |
|
247 |
if (order != null) { |
|
248 |
Iterator<FeatureQueryOrder.FeatureQueryOrderMember> it = order.iterator(); |
|
249 |
while (it.hasNext()) { |
|
250 |
FeatureQueryOrder.FeatureQueryOrderMember orderMember = it.next(); |
|
251 |
String attrName = orderMember.getAttributeName(); |
|
252 |
if(editableFeatureType.getAttributeDescriptor(attrName)==null && !orderMember.hasEvaluator()){ |
|
253 |
// int n = ToolsSwingLocator.getThreadSafeDialogsManager().confirmDialog( |
|
254 |
// i18n.getTranslation( |
|
255 |
// "_You_are_trying_to_remove_the_column_XcolumnNameX_that_is_being_sorted_by_Do_you_wish_to_continue", |
|
256 |
// new String[]{attrName} |
|
257 |
// ), |
|
258 |
// i18n.getTranslation("_Rename_column"), |
|
259 |
// JOptionPane.OK_CANCEL_OPTION, |
|
260 |
// JOptionPane.QUESTION_MESSAGE, |
|
261 |
// "_You_are_trying_to_remove_the_column_XcolumnNameX_that_is_being_sorted_by_Do_you_wish_to_continue" |
|
262 |
// ); |
|
263 |
// if (n != JOptionPane.OK_OPTION) { |
|
264 |
// return; |
|
265 |
// } |
|
266 |
it.remove(); |
|
267 |
} |
|
268 |
} |
|
269 |
} |
|
270 |
} |
|
271 |
|
|
240 | 272 |
featureStore.update(editableFeatureType); |
241 | 273 |
dataMamager.clearAvailableValuesCache(); |
242 | 274 |
} catch (Exception ex) { |
Also available in: Unified diff