Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44437)
@@ -1377,4 +1377,6 @@
 _Add=A\u00f1adir
 _Update=Actualizar
 _Remove=Eliminar
+_The_table_has_no_primary_key_or_OID=La tabla no tiene clave primario ni OID.
+_Many_features_selection_deletion_modification_will_not_be_available_as_they_require_it_for_proper_operation=Muchas funcionalidades (selecci\u00f3n, borrado, modificaci\u00f3n...) no estar\u00e1n disponibles ya que lo requieren para su correcto funcionamiento.
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44437)
@@ -1296,3 +1296,5 @@
 _Add=Add
 _Update=Update
 _Remove=Remove
+_The_table_has_no_primary_key_or_OID=The table has no primary key or OID.
+_Many_features_selection_deletion_modification_will_not_be_available_as_they_require_it_for_proper_operation=Many features (selection, deletion, modification ...) will not be available as they require it for proper operation.
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ZoomToSelectExtension.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ZoomToSelectExtension.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ZoomToSelectExtension.java	(revision 44437)
@@ -29,6 +29,9 @@
 import org.gvsig.app.ApplicationManager;
 import org.gvsig.app.project.documents.view.ViewDocument;
 import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.geom.primitive.Envelope;
 import org.gvsig.fmap.mapcontext.MapContext;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
@@ -81,6 +84,7 @@
         return document.getMapContext().getLayers().getLayersCount() > 0;
     }
 
+    @Override
     public boolean isEnabled() {
         ApplicationManager application = ApplicationLocator.getManager();
 
@@ -89,20 +93,28 @@
             return false;
         }
         ViewDocument document = view.getViewDocument();
-        FLayer[] selected = document.getMapContext().getLayers().getActives();
-        if (selected.length == 1 && selected[0] instanceof FLyrVect && selected[0].isAvailable()) {
-            FLyrVect layer = (FLyrVect) selected[0];
-            try {
-                if (!layer.getFeatureStore().getFeatureSelection().isEmpty()) {
-                    return true;
+        if( document == null ) {
+            return false;
+        }
+        boolean hasActiveVectorLayers = false;
+        boolean hasSelection = false;
+        for (FLayer layer : document.getMapContext().getLayers()) {
+            if( layer.isActive() && layer.isAvailable() && layer instanceof FLyrVect ) {
+                try {
+                    hasActiveVectorLayers = true;
+                    FeatureStore store = ((FLyrVect)layer).getFeatureStore();
+                    FeatureSelection selection = store.getFeatureSelection();
+                    if( !selection.isAvailable() ) {
+                        return false;
+                    }
+                    if( !selection.isEmpty() ) {
+                        hasSelection = true;
+                    }
+                } catch (Exception ex) {
                 }
-            } catch (Exception e) {
-                String msg = "Can't check if selection if empty in layer '" + layer.getName() + "'.";
-                logger.warn(msg, e);
-                application.message(msg, JOptionPane.WARNING_MESSAGE);
             }
         }
-        return false;
+        return hasActiveVectorLayers && hasSelection;
     }
 
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowLayerAsForm.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowLayerAsForm.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowLayerAsForm.java	(revision 44437)
@@ -68,9 +68,13 @@
                 if (layer.isAvailable() && layer instanceof FLyrVect) {
                     try {
                         FLyrVect vectLayer = (FLyrVect) layer;
-                        JFeaturesForm form = this.createform(vectLayer.getFeatureStore());
-                        form.addAction(new SelectFeatureInTheViewAction(doc, form, layer));
-                        form.showForm(WindowManager.MODE.WINDOW);
+                        FeatureStore featureStore = vectLayer.getFeatureStore();
+                        FeatureType type = featureStore.getDefaultFeatureType();
+                        if( type.supportReferences() ) {
+                            JFeaturesForm form = this.createform(featureStore);
+                            form.addAction(new SelectFeatureInTheViewAction(doc, form, layer));
+                            form.showForm(WindowManager.MODE.WINDOW);
+                        }
                     } catch (Exception ex) {
                         String msg = "Can't show form for layer '" + layer.getName() + "'.";
                         logger.warn(msg, ex);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ClearSelectionExtension.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ClearSelectionExtension.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ClearSelectionExtension.java	(revision 44437)
@@ -31,7 +31,9 @@
 import org.gvsig.app.project.documents.view.gui.IView;
 import org.gvsig.fmap.dal.exception.DataException;
 import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.mapcontext.MapContext;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.layers.FLayers;
@@ -114,8 +116,25 @@
             return false;
         }
         ViewDocument document = view.getViewDocument();
-        MapContext mapa = document.getMapContext();
-        return hasVectorLayersWithSelection(mapa.getLayers());
+        if( document == null ) {
+            return false;
+        }
+        boolean hasActiveVectorLayers = false;
+        boolean hasSelection = false;
+        for (FLayer layer : document.getMapContext().getLayers()) {
+            if( layer.isActive() && layer.isAvailable() && layer instanceof FLyrVect ) {
+                try {
+                    hasActiveVectorLayers = true;
+                    FeatureStore store = ((FLyrVect)layer).getFeatureStore();
+                    FeatureSelection selection = store.getFeatureSelection();
+                    if( !selection.isAvailable() || selection.isEmpty() ) {
+                        return false;
+                    }
+                } catch (Exception ex) {
+                }
+            }
+        }
+        return hasActiveVectorLayers && hasSelection;
     }
 
     private boolean hasVectorLayersWithSelection(FLayers layers) {
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewSelectionByTheme.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewSelectionByTheme.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewSelectionByTheme.java	(revision 44437)
@@ -31,6 +31,10 @@
 import org.gvsig.app.gui.selectionByTheme.SelectionByTheme;
 import org.gvsig.app.project.documents.view.ViewDocument;
 import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.i18n.I18nManager;
 import org.gvsig.tools.swing.api.ToolsSwingLocator;
@@ -80,6 +84,7 @@
         }
     }
 
+    @Override
     public boolean isEnabled() {
         ApplicationManager application = ApplicationLocator.getManager();
 
@@ -88,8 +93,23 @@
             return false;
         }
         ViewDocument document = view.getViewDocument();
-
-        return document.getMapContext().hasActiveVectorLayers();
+        if( document == null ) {
+            return false;
+        }
+        boolean hasActiveVectorLayers = false;
+        for (FLayer layer : document.getMapContext().getLayers()) {
+            if( layer.isActive() && layer.isAvailable() && layer instanceof FLyrVect ) {
+                try {
+                    hasActiveVectorLayers = true;
+                    FeatureStore store = ((FLyrVect)layer).getFeatureStore();
+                    if( !store.getFeatureSelection().isAvailable() ) {
+                        return false;
+                    }
+                } catch (Exception ex) {
+                }
+            }
+        }
+        return hasActiveVectorLayers;
     }
 
     public boolean isVisible() {
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewSelectionControls.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewSelectionControls.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewSelectionControls.java	(revision 44437)
@@ -28,6 +28,10 @@
 import org.gvsig.app.ApplicationManager;
 import org.gvsig.app.project.documents.view.ViewDocument;
 import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.gvsig.fmap.mapcontrol.MapControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,6 +56,7 @@
         IconThemeHelper.registerIcon("action", "selection-clear", this);
     }
 
+    @Override
     public void execute(String actionCommand) {
         ApplicationManager application = ApplicationLocator.getManager();
 
@@ -73,6 +78,7 @@
         }
     }
 
+    @Override
     public boolean isEnabled() {
         ApplicationManager application = ApplicationLocator.getManager();
 
@@ -81,9 +87,26 @@
             return false;
         }
         ViewDocument document = view.getViewDocument();
-        return document.getMapContext().hasActiveVectorLayers();
+        if( document == null ) {
+            return false;
+        }
+        boolean hasActiveVectorLayers = false;
+        for (FLayer layer : document.getMapContext().getLayers()) {
+            if( layer.isActive() && layer.isAvailable() && layer instanceof FLyrVect ) {
+                try {
+                    hasActiveVectorLayers = true;
+                    FeatureStore store = ((FLyrVect)layer).getFeatureStore();
+                    if( !store.getFeatureSelection().isAvailable() ) {
+                        return false;
+                    }
+                } catch (Exception ex) {
+                }
+            }
+        }
+        return hasActiveVectorLayers ;
     }
 
+    @Override
     public boolean isVisible() {
         ApplicationManager application = ApplicationLocator.getManager();
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SelectByAttributesExtension.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SelectByAttributesExtension.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SelectByAttributesExtension.java	(revision 44437)
@@ -44,6 +44,7 @@
 import org.gvsig.fmap.dal.feature.FeatureSelection;
 import org.gvsig.fmap.dal.feature.FeatureSet;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.gvsig.i18n.Messages;
@@ -116,7 +117,30 @@
 
     @Override
     public boolean isEnabled() {
-        return true;
+        ApplicationManager application = ApplicationLocator.getManager();
+
+        IView view = (IView) application.getActiveComponent(ViewDocument.class);
+        if (view == null) {
+            return false;
+        }
+        ViewDocument document = view.getViewDocument();
+        if( document == null ) {
+            return false;
+        }
+        boolean hasActiveVectorLayers = false;
+        for (FLayer layer : document.getMapContext().getLayers()) {
+            if( layer.isActive() && layer.isAvailable() && layer instanceof FLyrVect ) {
+                try {
+                    hasActiveVectorLayers = true;
+                    FeatureStore store = ((FLyrVect)layer).getFeatureStore();
+                    if( !store.getFeatureSelection().isAvailable() ) {
+                        return false;
+                    }
+                } catch (Exception ex) {
+                }
+            }
+        }
+        return hasActiveVectorLayers;
     }
 
     @Override
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SearchByAttributesExtension.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SearchByAttributesExtension.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SearchByAttributesExtension.java	(revision 44437)
@@ -1,17 +1,22 @@
 package org.gvsig.app.extension;
 
+import javax.swing.JOptionPane;
 import org.gvsig.andami.plugins.Extension;
 import org.gvsig.app.ApplicationLocator;
 import org.gvsig.app.ApplicationManager;
 import org.gvsig.app.project.documents.view.ViewDocument;
 import org.gvsig.app.project.documents.view.gui.IView;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.dal.swing.DALSwingLocator;
 import org.gvsig.fmap.dal.swing.DataSwingManager;
 import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
 import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
 import org.gvsig.tools.swing.api.windowmanager.WindowManager;
 
 /**
@@ -42,6 +47,23 @@
             String title = "Search: " + layer.getName();
             FeatureStore featureStore = ((FLyrVect) layer).getFeatureStore();
             
+            try {
+                FeatureType type = featureStore.getDefaultFeatureType();
+                if( ! type.supportReferences() ) {
+                    I18nManager i18n = ToolsLocator.getI18nManager();
+                    ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
+                    dialogs.messageDialog(
+                           i18n.getTranslation("_The_table_has_no_primary_key_or_OID") +"\n" +
+                                   i18n.getTranslation("_Many_features_selection_deletion_modification_will_not_be_available_as_they_require_it_for_proper_operation"),
+                           null, 
+                           i18n.getTranslation("_Warning"),
+                            JOptionPane.WARNING_MESSAGE, 
+                           "TableDoNotSupportReferences"
+                   );
+                }
+            } catch (Exception ex) {
+            }
+            
             FeatureStoreSearchPanel panel = dataSwingManager.createFeatureStoreSearchPanel(featureStore);
             winManager.showWindow(
                     panel.asJComponent(), 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewInvertSelection.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewInvertSelection.java	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewInvertSelection.java	(revision 44437)
@@ -33,9 +33,11 @@
 import org.gvsig.fmap.dal.DataStore;
 import org.gvsig.fmap.dal.exception.DataException;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.mapcontext.MapContext;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -87,6 +89,7 @@
         }
     }
 
+    @Override
     public boolean isEnabled() {
         ApplicationManager application = ApplicationLocator.getManager();
 
@@ -95,7 +98,23 @@
             return false;
         }
         ViewDocument document = view.getViewDocument();
-        return document.getMapContext().hasActiveVectorLayers();
+        if( document == null ) {
+            return false;
+        }
+        boolean hasActiveVectorLayers = false;
+        for (FLayer layer : document.getMapContext().getLayers()) {
+            if( layer.isActive() && layer.isAvailable() && layer instanceof FLyrVect ) {
+                try {
+                    hasActiveVectorLayers = true;
+                    FeatureStore store = ((FLyrVect)layer).getFeatureStore();
+                    if( !store.getFeatureSelection().isAvailable() ) {
+                        return false;
+                    }
+                } catch (Exception ex) {
+                }
+            }
+        }
+        return hasActiveVectorLayers;
     }
 
     public boolean isVisible() {
Index: 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/project/documents/table/TableManager.java
===================================================================
--- 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/project/documents/table/TableManager.java	(revision 44436)
+++ 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/project/documents/table/TableManager.java	(revision 44437)
@@ -30,6 +30,7 @@
 import java.util.function.Function;
 
 import javax.swing.ImageIcon;
+import javax.swing.JOptionPane;
 
 import org.gvsig.andami.IconThemeHelper;
 import org.gvsig.andami.PluginServices;
@@ -58,6 +59,7 @@
 import org.gvsig.fmap.dal.feature.FeatureQuery;
 import org.gvsig.fmap.dal.feature.FeatureQueryOrder;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.dal.serverexplorer.filesystem.swing.FilesystemExplorerWizardPanel;
 import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.gvsig.fmap.mapcontext.layers.vectorial.VectorLayer;
@@ -65,7 +67,10 @@
 import org.gvsig.tools.dynobject.DynObjectManager;
 import org.gvsig.tools.dynobject.DynStruct;
 import org.gvsig.tools.evaluator.Evaluator;
+import org.gvsig.tools.i18n.I18nManager;
 import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
 import org.gvsig.tools.util.MappedIterator;
 import org.gvsig.tools.util.UnmodifiableBasicSet;
 
@@ -206,6 +211,27 @@
                 @SuppressWarnings("unchecked")
                 List<TableDocument> docs =
                     (List<TableDocument>) panel.executeWizard();
+                for (TableDocument doc : docs) {
+                    try {
+                        FeatureStore store = ((TableDocument)doc).getDataStore();
+                        FeatureType type = store.getDefaultFeatureType();
+                        if( ! type.supportReferences() ) {
+                            I18nManager i18n = ToolsLocator.getI18nManager();
+                            ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
+                            dialogs.messageDialog(
+                                    "\""+ doc.getName() + "\"\n"+
+                                    i18n.getTranslation("_The_table_has_no_primary_key_or_OID") +"\n" +
+                                           i18n.getTranslation("_Many_features_selection_deletion_modification_will_not_be_available_as_they_require_it_for_proper_operation"),
+                                    null, 
+                                    i18n.getTranslation("_Warning"),
+                                    JOptionPane.WARNING_MESSAGE, 
+                                    "TableDoNotSupportReferences"
+                           );
+                        }
+                    } catch (Exception ex) {
+
+                    }
+                }
                 return docs.iterator();
             }
         } catch (Exception e) {
Index: 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/TableOperations.java
===================================================================
--- 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/TableOperations.java	(revision 44436)
+++ 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/TableOperations.java	(revision 44437)
@@ -23,7 +23,6 @@
  */
 package org.gvsig.app.extension;
 
-import java.awt.Component;
 import java.awt.Dimension;
 import java.util.List;
 
@@ -73,6 +72,7 @@
 
     private FeatureStore featureStore = null;
 
+    @Override
     public void execute(String actionCommand) {
         
         I18nManager i18n = ToolsLocator.getI18nManager();
Index: 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/ShowTableAsForm.java
===================================================================
--- 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/ShowTableAsForm.java	(revision 44436)
+++ 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/ShowTableAsForm.java	(revision 44437)
@@ -1,7 +1,6 @@
 package org.gvsig.app.extension;
 
 import java.awt.Dimension;
-import javax.swing.JComponent;
 import javax.swing.JOptionPane;
 import org.gvsig.andami.plugins.Extension;
 import org.gvsig.app.ApplicationLocator;
@@ -14,6 +13,7 @@
 import org.gvsig.featureform.swing.JFeaturesForm;
 import org.gvsig.fmap.dal.exception.DataException;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.dal.swing.DALSwingLocator;
 import org.gvsig.fmap.dal.swing.DataSwingManager;
 import org.gvsig.tools.service.ServiceException;
@@ -23,8 +23,6 @@
 
 public class ShowTableAsForm extends Extension {
 
-    private static final Logger logger = LoggerFactory.getLogger(ShowTableAsForm.class);
-
     @Override
     public void initialize() {
     }
@@ -62,7 +60,9 @@
 
     @Override
     public boolean isEnabled() {
-        return true;
+        ApplicationManager application = ApplicationLocator.getManager();
+        TableDocument doc = (TableDocument) application.getActiveDocument(TableManager.TYPENAME);
+        return doc != null;
     }
 
     @Override
Index: 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/TableRowsOperations.java
===================================================================
--- 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/TableRowsOperations.java	(revision 44436)
+++ 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/TableRowsOperations.java	(revision 44437)
@@ -23,21 +23,19 @@
  */
 package org.gvsig.app.extension;
 
-import javax.swing.JOptionPane;
 
 import org.gvsig.andami.IconThemeHelper;
 import org.gvsig.andami.PluginServices;
-import org.gvsig.andami.messages.NotificationManager;
 import org.gvsig.andami.plugins.Extension;
 import org.gvsig.andami.ui.mdiManager.IWindow;
-import org.gvsig.app.ApplicationLocator;
 import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel;
 import org.gvsig.fmap.dal.exception.DataException;
 import org.gvsig.fmap.dal.feature.FeatureStore;
-import org.gvsig.i18n.Messages;
+import org.gvsig.fmap.dal.feature.FeatureType;
 
 public class TableRowsOperations extends Extension {
 
+    @Override
     public void initialize() {
         registerIcons();
     }
@@ -48,6 +46,7 @@
     	IconThemeHelper.registerIcon("action", "selection-reverse", this);    
     }
 
+    @Override
     public void execute(String actionCommand) {
         FeatureTableDocumentPanel tableDocument = getTableDocument();
         if (actionCommand.equalsIgnoreCase("selection-disable-move-up") ) {
@@ -83,19 +82,28 @@
             FeatureStore fs = getTableDocument().getModel().getStore();
             fs.getFeatureSelection().reverse();
         } catch (DataException e) {
-            e.printStackTrace();
-            NotificationManager.addError(e);
+            logger.warn("Can't invert selecction", e);
         }
     }
 
-//    private void showsSelectedRows(FeatureTableDocumentPanel table) {
-//        table.setSelectionUp(true);
-//    }
-
+    @Override
     public boolean isEnabled() {
-        return getTableDocument() != null;
+        FeatureTableDocumentPanel panel = getTableDocument();
+        if( panel == null ) {
+            return false;
+        }
+        FeatureStore store = panel.getFeatureStore();
+        try {
+            if( !store.getFeatureSelection().isAvailable() ) {
+                return false;
+            }
+        } catch (Exception ex) {
+        }                        
+        
+        return  true;
     }
 
+    @Override
     public boolean isVisible() {
         return getTableDocument() != null;
     }
@@ -114,8 +122,8 @@
             try {
                 return !tabledoc.getModel().getStore()
                     .getFeatureSelection().isEmpty();
-            } catch (DataException e) {
-                NotificationManager.addError(e);
+            } catch (Exception e) {
+                logger.warn("Can't check if table has a selecction", e);
             }
         }
         return false;
Index: 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/TableEditStartExtension.java
===================================================================
--- 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/TableEditStartExtension.java	(revision 44436)
+++ 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/TableEditStartExtension.java	(revision 44437)
@@ -32,21 +32,19 @@
 import org.gvsig.fmap.dal.EditingNotificationManager;
 import org.gvsig.fmap.dal.exception.DataException;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.dal.swing.DALSwingLocator;
 import org.gvsig.tools.util.ArrayUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class TableEditStartExtension extends AbstractTableEditExtension {
 
-    private static final Logger logger = LoggerFactory.getLogger(TableEditStartExtension.class);
-
     @Override
     public void initialize() {
         super.initialize();
         IconThemeHelper.registerIcon("action", "table-start-editing", this);
     }
 
+    @Override
     public void execute(String actionCommand) {
         this.execute(actionCommand,null);
     }
@@ -81,6 +79,7 @@
         }
     }
 
+    @Override
     public boolean isEnabled() {
         IWindow v = PluginServices.getMDIManager().getActiveWindow();
 
@@ -88,13 +87,21 @@
             return false;
         }
         if (v instanceof FeatureTableDocumentPanel) {
-            FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) v;
-            FeatureStore fs = t.getModel().getStore();
-            return fs.allowWrite();
+            try {
+                FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) v;
+                FeatureStore fs = t.getModel().getStore();
+                if( ! fs.allowWrite() || !fs.supportReferences() ) {
+                    return false;
+                }
+                return true;
+            } catch (Exception ex) {
+                return false;
+            }
         }
         return false;
     }
 
+    @Override
     public boolean isVisible() {
         IWindow v = PluginServices.getMDIManager().getActiveWindow();
 
Index: 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/SelectByAttributesInTableExtension.java
===================================================================
--- 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/SelectByAttributesInTableExtension.java	(revision 44436)
+++ 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/SelectByAttributesInTableExtension.java	(revision 44437)
@@ -32,8 +32,11 @@
 import org.gvsig.andami.plugins.Extension;
 import org.gvsig.andami.ui.mdiManager.IWindow;
 import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
 import org.gvsig.app.gui.filter.ExpressionListener;
 import org.gvsig.app.gui.filter.FilterDialog;
+import org.gvsig.app.project.documents.table.TableDocument;
+import org.gvsig.app.project.documents.table.TableManager;
 import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel;
 import org.gvsig.fmap.dal.DALLocator;
 import org.gvsig.fmap.dal.DataManager;
@@ -43,6 +46,7 @@
 import org.gvsig.fmap.dal.feature.FeatureSelection;
 import org.gvsig.fmap.dal.feature.FeatureSet;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.i18n.Messages;
 import org.gvsig.tools.dispose.DisposeUtils;
 import org.gvsig.tools.swing.api.windowmanager.WindowManager;
@@ -113,7 +117,24 @@
 
     @Override
     public boolean isEnabled() {
-        return isVisible();
+        ApplicationManager application = ApplicationLocator.getManager();
+        TableDocument doc = (TableDocument) application.getActiveDocument(TableManager.TYPENAME);
+        if (doc == null) {
+            return false;
+        }
+        FeatureTableDocumentPanel tablePanel = (FeatureTableDocumentPanel) doc.getMainComponent();
+        if( tablePanel == null ) {
+            return false;
+        }
+        FeatureStore store = tablePanel.getFeatureStore();
+        try {
+            if( ! store.getFeatureSelection().isAvailable() ) {
+                return false;
+            }
+        } catch (Exception ex) {
+        }                        
+        
+        return  true;
     }
 
     @Override
Index: 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
===================================================================
--- 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	(revision 44436)
+++ 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	(revision 44437)
@@ -22,8 +22,8 @@
  */
 package org.gvsig.app.extension;
 
+import javax.swing.JOptionPane;
 import org.gvsig.andami.IconThemeHelper;
-import org.gvsig.andami.PluginServices;
 import org.gvsig.andami.plugins.Extension;
 import org.gvsig.andami.ui.mdiManager.IWindow;
 import org.gvsig.app.ApplicationLocator;
@@ -34,6 +34,8 @@
 import org.gvsig.app.project.documents.table.TableManager;
 import org.gvsig.app.project.documents.view.ViewDocument;
 import org.gvsig.app.project.documents.view.ViewManager;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.mapcontext.MapContext;
 import org.gvsig.fmap.mapcontext.layers.CancelationException;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
@@ -42,6 +44,10 @@
 import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener;
 import org.gvsig.fmap.mapcontext.layers.LayerPositionEvent;
 import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
 import org.gvsig.tools.util.ArrayUtils;
 
 /**
@@ -95,7 +101,7 @@
 
             for (FLayer layer : layers) {
                 if (layer instanceof FLyrVect) {
-                    FLyrVect layerVect = (FLyrVect) layer;
+                    FLyrVect layerVect = (FLyrVect) layer;                    
                     TableDocument tableDoc = tableManager.getTableDocument(layerVect);
                     if (tableDoc == null) {
                         tableDoc = (TableDocument) tableManager.createDocument();
@@ -105,6 +111,26 @@
                         layerVect.getParentLayer().addLayerCollectionListener(this);
                         project.addDocument(tableDoc);
                     }
+                    try {
+                        FeatureStore store = tableDoc.getDataStore();
+                        FeatureType type = store.getDefaultFeatureType();
+                        if( ! type.supportReferences() ) {
+                            I18nManager i18n = ToolsLocator.getI18nManager();
+                            ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
+                            dialogs.messageDialog(
+                                    "\""+ store.getName() + "\"\n"+
+                                    i18n.getTranslation("_The_table_has_no_primary_key_or_OID") +"\n" +
+                                           i18n.getTranslation("_Many_features_selection_deletion_modification_will_not_be_available_as_they_require_it_for_proper_operation"),
+                                    null, 
+                                    i18n.getTranslation("_Warning"),
+                                    JOptionPane.WARNING_MESSAGE, 
+                                    "TableDoNotSupportReferences"
+                           );
+                        }
+                    } catch (Exception ex) {
+
+                    }
+                    
                     IWindow tablePanel = tableManager.getMainWindow(tableDoc);
                     tableDoc.setModified(true);
                     application.getUIManager().addWindow(tablePanel);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources-plugin/i18n/text.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44437)
@@ -59,4 +59,3 @@
 _Select_table_duplicates=Seleccionar duplicados tabla
 _Select_all_duplicates=Seleccionar todos los duplicados
 _Select_all_duplicates_in_the_table=Seleccionar todos los duplicados de la tabla
-
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44436)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44437)
@@ -58,4 +58,4 @@
 _Column_information_XcolonX=Column information\:
 _Select_table_duplicates=Select table duplicates
 _Select_all_duplicates=Select all duplicates
-_Select_all_duplicates_in_the_table=Select all duplicates in the table
\ No newline at end of file
+_Select_all_duplicates_in_the_table=Select all duplicates in the table
