Revision 44437 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/ShowTable.java
ShowTable.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.app.extension; |
24 | 24 |
|
25 |
import javax.swing.JOptionPane; |
|
25 | 26 |
import org.gvsig.andami.IconThemeHelper; |
26 |
import org.gvsig.andami.PluginServices; |
|
27 | 27 |
import org.gvsig.andami.plugins.Extension; |
28 | 28 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
29 | 29 |
import org.gvsig.app.ApplicationLocator; |
... | ... | |
34 | 34 |
import org.gvsig.app.project.documents.table.TableManager; |
35 | 35 |
import org.gvsig.app.project.documents.view.ViewDocument; |
36 | 36 |
import org.gvsig.app.project.documents.view.ViewManager; |
37 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
38 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
37 | 39 |
import org.gvsig.fmap.mapcontext.MapContext; |
38 | 40 |
import org.gvsig.fmap.mapcontext.layers.CancelationException; |
39 | 41 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
42 | 44 |
import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener; |
43 | 45 |
import org.gvsig.fmap.mapcontext.layers.LayerPositionEvent; |
44 | 46 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
47 |
import org.gvsig.tools.ToolsLocator; |
|
48 |
import org.gvsig.tools.i18n.I18nManager; |
|
49 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
50 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
45 | 51 |
import org.gvsig.tools.util.ArrayUtils; |
46 | 52 |
|
47 | 53 |
/** |
... | ... | |
95 | 101 |
|
96 | 102 |
for (FLayer layer : layers) { |
97 | 103 |
if (layer instanceof FLyrVect) { |
98 |
FLyrVect layerVect = (FLyrVect) layer; |
|
104 |
FLyrVect layerVect = (FLyrVect) layer;
|
|
99 | 105 |
TableDocument tableDoc = tableManager.getTableDocument(layerVect); |
100 | 106 |
if (tableDoc == null) { |
101 | 107 |
tableDoc = (TableDocument) tableManager.createDocument(); |
... | ... | |
105 | 111 |
layerVect.getParentLayer().addLayerCollectionListener(this); |
106 | 112 |
project.addDocument(tableDoc); |
107 | 113 |
} |
114 |
try { |
|
115 |
FeatureStore store = tableDoc.getDataStore(); |
|
116 |
FeatureType type = store.getDefaultFeatureType(); |
|
117 |
if( ! type.supportReferences() ) { |
|
118 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
119 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
120 |
dialogs.messageDialog( |
|
121 |
"\""+ store.getName() + "\"\n"+ |
|
122 |
i18n.getTranslation("_The_table_has_no_primary_key_or_OID") +"\n" + |
|
123 |
i18n.getTranslation("_Many_features_selection_deletion_modification_will_not_be_available_as_they_require_it_for_proper_operation"), |
|
124 |
null, |
|
125 |
i18n.getTranslation("_Warning"), |
|
126 |
JOptionPane.WARNING_MESSAGE, |
|
127 |
"TableDoNotSupportReferences" |
|
128 |
); |
|
129 |
} |
|
130 |
} catch (Exception ex) { |
|
131 |
|
|
132 |
} |
|
133 |
|
|
108 | 134 |
IWindow tablePanel = tableManager.getMainWindow(tableDoc); |
109 | 135 |
tableDoc.setModified(true); |
110 | 136 |
application.getUIManager().addWindow(tablePanel); |
Also available in: Unified diff