Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/gui/FPopupMenu.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/gui/FPopupMenu.java	(revision 44600)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/gui/FPopupMenu.java	(revision 44601)
@@ -124,7 +124,7 @@
         this.extensionPoint =
             ToolsLocator.getExtensionPointManager().get("View_TocActions");
         this.selecteds = this.mapContext.getLayers().getActives();
-
+        
         List<IContextMenuAction> actions = this.getActionList();
         if (actions == null) {
             return;
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 44600)
+++ 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 44601)
@@ -22,16 +22,15 @@
  */
 package org.gvsig.app.extension;
 
+import java.util.List;
 import org.gvsig.andami.IconThemeHelper;
 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.mapcontext.layers.FLayer;
-import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
 import org.gvsig.fmap.mapcontrol.MapControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,6 +45,7 @@
     private static final Logger logger = LoggerFactory
             .getLogger(ViewSelectionControls.class);
 
+    @Override
     public void initialize() {
         registerIcons();
     }
@@ -90,20 +90,15 @@
         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) {
-                }
-            }
+        List<FLayer> layers = document.getMapContext().getLayers().getLayers(
+                FLayers.LAYER_ACTIVE
+                        .and(FLayers.LAYER_AVALAIBLE)
+                        .and(FLayers.LAYER_SELECTION_AVAILABLE)
+        );
+        if (layers.size()>=1) {
+            return true;
         }
-        return hasActiveVectorLayers ;
+        return false;
     }
 
     @Override
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 44600)
+++ 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 44601)
@@ -23,6 +23,7 @@
 package org.gvsig.app.extension;
 
 import java.util.Iterator;
+import java.util.List;
 
 import javax.swing.JOptionPane;
 
@@ -44,8 +45,8 @@
 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.FLayers;
 import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.gvsig.i18n.Messages;
 import org.gvsig.tools.swing.api.windowmanager.WindowManager;
@@ -78,7 +79,7 @@
         if ("selection-by-attributes-layer".equals(actionCommand)) {
             ViewDocument document = view.getViewDocument();
 
-            FLayer layer = document.getMapContext().getLayers().getActives()[0];
+            FLayer layer = document.getMapContext().getLayers().getFirstActiveVectorLayer();
             filterTitle = layer.getName();
             featureStore = ((FLyrVect) layer).getFeatureStore();
             document.setModified(true);
@@ -124,23 +125,29 @@
             return false;
         }
         ViewDocument document = view.getViewDocument();
-        if( document == null ) {
+        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) {
-                }
-            }
+       
+        FLayers layers = document.getMapContext().getLayers();
+        List<FLayer> activeLayers = layers.getLayers(
+                FLayers.LAYER_ACTIVE
+                        .and(FLayers.LAYER_AVALAIBLE)
+                        .and(FLayers.LAYER_FLYRVECT)
+        );
+        if (activeLayers.size() != 1) {
+            return false;
         }
-        return hasActiveVectorLayers;
+        List<FLayer> selectivedLayers = document.getMapContext().getLayers().getLayers(
+                FLayers.LAYER_ACTIVE
+                        .and(FLayers.LAYER_AVALAIBLE)
+                        .and(FLayers.LAYER_SELECTION_AVAILABLE)
+        );
+        if (selectivedLayers.size()==1) {
+            return true;
+        }
+
+        return false;
     }
 
     @Override
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 44600)
+++ 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 44601)
@@ -22,6 +22,7 @@
  */
 package org.gvsig.app.extension;
 
+import java.util.List;
 import org.gvsig.andami.IconThemeHelper;
 import org.gvsig.andami.plugins.Extension;
 import org.gvsig.app.ApplicationLocator;
@@ -34,6 +35,7 @@
 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.FLayers;
 import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.i18n.I18nManager;
@@ -96,20 +98,15 @@
         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) {
-                }
-            }
+         List<FLayer> layers = document.getMapContext().getLayers().getLayers(
+                FLayers.LAYER_ACTIVE
+                        .and(FLayers.LAYER_AVALAIBLE)
+                        .and(FLayers.LAYER_SELECTION_AVAILABLE)
+        );
+        if (layers.size()>=1) {
+            return true;
         }
-        return hasActiveVectorLayers;
+        return false;
     }
 
     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/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 44600)
+++ 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 44601)
@@ -22,6 +22,7 @@
  */
 package org.gvsig.app.extension;
 
+import java.util.List;
 import org.gvsig.andami.IconThemeHelper;
 import org.gvsig.andami.messages.NotificationManager;
 import org.gvsig.andami.plugins.Extension;
@@ -33,11 +34,10 @@
 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.FLayers;
 import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer;
-import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,17 +48,20 @@
  */
 public class ViewInvertSelection extends Extension {
 
-    private static final Logger logger = LoggerFactory
+    private static final Logger LOGGER = LoggerFactory
             .getLogger(ViewInvertSelection.class);
     private DefaultViewPanel vista;
 
+    @Override
     public void initialize() {
         IconThemeHelper.registerIcon("action", "selection-reverse", this);
     }
 
+    @Override
     public void postInitialize() {
     }
 
+    @Override
     public void execute(String actionCommand) {
         ApplicationManager application = ApplicationLocator.getManager();
 
@@ -101,22 +104,18 @@
         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) {
-                }
-            }
+        List<FLayer> layers = document.getMapContext().getLayers().getLayers(
+                FLayers.LAYER_ACTIVE
+                        .and(FLayers.LAYER_AVALAIBLE)
+                        .and(FLayers.LAYER_SELECTION_AVAILABLE)
+        );
+        if (layers.size()>=1) {
+            return true;
         }
-        return hasActiveVectorLayers;
+        return false;
     }
 
+    @Override
     public boolean isVisible() {
         ApplicationManager application = ApplicationLocator.getManager();
 
