Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/AutomaticDetectionOfTypes.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/AutomaticDetectionOfTypes.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/AutomaticDetectionOfTypes.java	(revision 44455)
@@ -16,9 +16,10 @@
 public class AutomaticDetectionOfTypes {
 
     public interface Rows {
+
         public List<String> nextRowValues();
     }
-    
+
     private static class PossibleDataType {
 
         public boolean possibleInt = true;
@@ -43,7 +44,7 @@
     private String getFullFileName() {
         return this.filename;
     }
-    
+
     @SuppressWarnings({"UseSpecificCatch", "ResultOfObjectAllocationIgnored"})
     public int[] detect(int columns, Rows rows, boolean isFirstLineHeader, Locale locale) throws IOException {
         List<PossibleDataType> possibleDataTypes;
@@ -210,5 +211,5 @@
             return false;
         }
     }
-    
+
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContextLibrary.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContextLibrary.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContextLibrary.java	(revision 44455)
@@ -42,11 +42,9 @@
 import org.gvsig.fmap.mapcontext.tools.persistence.FontPersistenceFactory;
 import org.gvsig.fmap.mapcontext.tools.persistence.Point2DPersistenceFactory;
 import org.gvsig.fmap.mapcontext.tools.persistence.Rectangle2DPersistenceFactory;
-import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.library.AbstractLibrary;
 import org.gvsig.tools.library.LibraryException;
 import org.gvsig.tools.locator.ReferenceNotRegisteredException;
-import org.gvsig.tools.persistence.PersistenceManager;
 import org.gvsig.tools.util.Caller;
 import org.gvsig.tools.util.impl.DefaultCaller;
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/ExtendedPropertiesHelper.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/ExtendedPropertiesHelper.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/ExtendedPropertiesHelper.java	(revision 44455)
@@ -25,21 +25,18 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.gvsig.tools.ToolsLocator;
-import org.gvsig.tools.dynobject.DynStruct;
-import org.gvsig.tools.persistence.PersistenceManager;
 import org.gvsig.tools.persistence.Persistent;
-import org.gvsig.tools.persistence.PersistentState;
-import org.gvsig.tools.persistence.exception.PersistenceException;
 import org.gvsig.tools.util.Callable;
+import org.gvsig.tools.util.PropertiesSupportHelper;
 
-public class ExtendedPropertiesHelper implements ExtendedPropertiesSupport, Persistent {
+public class ExtendedPropertiesHelper extends PropertiesSupportHelper implements ExtendedPropertiesSupport, Persistent {
 
     private static final Logger logger = LoggerFactory.getLogger(ExtendedPropertiesHelper.class);
 
@@ -75,70 +72,29 @@
 
         state.set("propertiesHelper",propertiesHelper);
 
-    */
-    private Map properties = new HashMap();
-
-	@Override
+     */
+    @Override
     public Object getProperty(Object key) {
-        return properties.get(key);
+        return this.getProperty((String) key);
     }
 
-	@Override
+    @Override
     public void setProperty(Object key, Object val) {
-        properties.put(key, val);
+        this.setProperty((String) key, val);
     }
 
-	@Override
+    @Override
     public Map getExtendedProperties() {
-        return properties;
+        return this.getProperties();
     }
 
     public void setExtendedProperties(Map properties) {
-        this.properties = new HashMap();
-		if( properties!=null ) {
-			// this.properties.putAll(properties);
-			this.copyFrom(properties);
-		}
+        this.setProperties(properties);
     }
 
-	private void copyFrom(Map properties) {
-		for(Entry entry : (Set<Entry>)properties.entrySet() ) {
-			Object key = entry.getKey();
-			if( key == null ) {
-				continue;
-			}
-			Object value;
-			try {
-				value = entry.getValue();
-			} catch(Throwable th) {
-                if( logger.isDebugEnabled() ) {
-                    logger.warn("Can't get property "+key.toString()+".",th);
-                } else {
-                    logger.warn("Can't get property "+key.toString()+".");
-                }
-				value = null;
-			}
-			this.properties.put(key, value);
-		}
-	}
-	
-	@Override
-    public void saveToState(PersistentState state) throws PersistenceException {
-        state.set("properties", properties);
-    }
-
-	@Override
-    public void loadFromState(PersistentState state) throws PersistenceException {
-        this.properties = new HashMap();
-        Map props = (Map) state.get("properties");
-		if( props != null) {
-			copyFrom(props);
-		}
-    }
-
     public static class RegisterPersistence implements Callable {
 
-		@Override
+        @Override
         public Object call() {
             PersistenceManager manager = ToolsLocator.getPersistenceManager();
             DynStruct definition = manager.addDefinition(
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/DefaultViewDocument.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/DefaultViewDocument.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/DefaultViewDocument.java	(revision 44455)
@@ -21,7 +21,6 @@
  * For any additional information, do not hesitate to contact us
  * at info AT gvsig.com, or visit our website www.gvsig.com.
  */
-
 package org.gvsig.app.project.documents.view;
 
 import javax.swing.JOptionPane;
@@ -50,40 +49,37 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-
 /**
  * Clase que representa una vista del proyecto
- * 
+ *
  */
-
 public class DefaultViewDocument extends BaseViewDocument {
 
-	private static Logger logger = LoggerFactory.getLogger(DefaultViewDocument.class);
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 676711512482334764L;
+    private static Logger logger = LoggerFactory.getLogger(DefaultViewDocument.class);
+    /**
+     *
+     */
+    private static final long serialVersionUID = 676711512482334764L;
 
-	public static final String PERSISTENCE_DEFINITION_NAME = "DefaultViewDocument";
-	
+    public static final String PERSISTENCE_DEFINITION_NAME = "DefaultViewDocument";
+
     private class SetViewPortExtentWhenAddLayerListener extends BaseLayerCollectionListener {
 
         private Thread th = null;
         private final ViewPort viewPort;
-        
+
         public SetViewPortExtentWhenAddLayerListener(ViewPort viewPort) {
             this.viewPort = viewPort;
         }
-        
+
         @Override
         public synchronized void layerAdded(LayerCollectionEvent e) {
-            if( th != null ) {
+            if (th != null) {
                 return;
             }
             if (viewPort.getEnvelope() == null) {
                 final FLayer layer = e.getAffectedLayer();
-                if (layer.isAvailable() )  {
+                if (layer.isAvailable()) {
                     th = new Thread(new Runnable() {
                         @Override
                         public void run() {
@@ -91,8 +87,8 @@
                                 ApplicationManager application = ApplicationLocator.getManager();
                                 I18nManager i18n = ToolsLocator.getI18nManager();
                                 application.message(
-                                    i18n.getTranslation("_Calculating_envelope"),
-                                    JOptionPane.INFORMATION_MESSAGE
+                                        i18n.getTranslation("_Calculating_envelope"),
+                                        JOptionPane.INFORMATION_MESSAGE
                                 );
                                 Envelope envelope = layer.getFullEnvelope();
                                 // Si nadie le ha asignado un envelope mientras se
@@ -101,8 +97,8 @@
                                     viewPort.setEnvelope(envelope);
                                 }
                                 application.message(
-                                    "",
-                                    JOptionPane.INFORMATION_MESSAGE
+                                        "",
+                                        JOptionPane.INFORMATION_MESSAGE
                                 );
                             } catch (ReadException ex) {
                             }
@@ -119,113 +115,109 @@
                 }
             }
         }
-            
+
     }
 
-	public DefaultViewDocument() {
-		this(null);
-	}
-	
-	public DefaultViewDocument(DocumentManager factory) {
-		super(factory); 
+    public DefaultViewDocument() {
+        this(null);
+    }
 
-		ViewPort vp;
-	
-		ProjectPreferences preferences = (ProjectPreferences) ApplicationLocator.getManager().getPreferences("project");
-    	
-    	MapContext viewMapContext = new MapContext(
-				new ViewPort( preferences.getDefaultProjection() )
-		);
-		vp = viewMapContext.getViewPort();
-		vp.setBackColor(preferences.getDefaultViewBackColor());
-		vp.setDistanceUnits(preferences.getDefaultDistanceUnits());
-		vp.setDistanceArea(preferences.getDefaultDistanceArea());
-		
-		/*
+    public DefaultViewDocument(DocumentManager factory) {
+        super(factory);
+
+        ViewPort vp;
+
+        ProjectPreferences preferences = (ProjectPreferences) ApplicationLocator.getManager().getPreferences("project");
+
+        MapContext viewMapContext = new MapContext(
+                new ViewPort(preferences.getDefaultProjection())
+        );
+        vp = viewMapContext.getViewPort();
+        vp.setBackColor(preferences.getDefaultViewBackColor());
+        vp.setDistanceUnits(preferences.getDefaultDistanceUnits());
+        vp.setDistanceArea(preferences.getDefaultDistanceArea());
+
+        /*
 		 * Another user preference: the order manager
-		 */
-		LayerOrderManager lom = getCurrentOrderManager();
-		viewMapContext.setOrderManager(lom);
-		
-		
-		/*
+         */
+        LayerOrderManager lom = getCurrentOrderManager();
+        viewMapContext.setOrderManager(lom);
+
+        /*
 		 * Not very elegant but we are forcing meters if projected
-		 */
-		if (viewMapContext.getProjection().isProjected()) {
-		    vp.setMapUnits(1);
-		} else {
+         */
+        if (viewMapContext.getProjection().isProjected()) {
+            vp.setMapUnits(1);
+        } else {
             vp.setMapUnits(8);
-		}
-		
-		
-		this.setMapContext(viewMapContext);
-		
-		MapContext overviewMapContext = new MapContext(
-				new ViewPort( viewMapContext.getProjection() )
-		);
-		vp = viewMapContext.getViewPort();
-		vp.setBackColor(preferences.getDefaultViewBackColor());
-		this.setMapOverViewContext(overviewMapContext);
-        
+        }
+
+        this.setMapContext(viewMapContext);
+
+        MapContext overviewMapContext = new MapContext(
+                new ViewPort(viewMapContext.getProjection())
+        );
+        vp = viewMapContext.getViewPort();
+        vp.setBackColor(preferences.getDefaultViewBackColor());
+        this.setMapOverViewContext(overviewMapContext);
+
         this.getMapContext().getLayers().addLayerCollectionListener(
-            new SetViewPortExtentWhenAddLayerListener(this.getMapContext().getViewPort())
+                new SetViewPortExtentWhenAddLayerListener(this.getMapContext().getViewPort())
         );
         this.getMapOverViewContext().getLayers().addLayerCollectionListener(
-            new SetViewPortExtentWhenAddLayerListener(this.getMapOverViewContext().getViewPort())
+                new SetViewPortExtentWhenAddLayerListener(this.getMapOverViewContext().getViewPort())
         );
-	}
-	
-	/**
-	 * Get current order manager from persistence
-	 * 
-	 * @return
-	 */
-	private LayerOrderManager getCurrentOrderManager() {
-		
-		DynObject props = this.getPluginProperties();
-		// current_layer_order_manager
-		Object val_obj = null;
-		if (props.hasDynValue(LayerOrderPage.PREFERENCES_ID)) {
-			val_obj = props.getDynValue(LayerOrderPage.PREFERENCES_ID);
-		}
-		if (val_obj != null && val_obj instanceof LayerOrderManager) {
-			LayerOrderManager lom = (LayerOrderManager) val_obj;
-			return lom;
-		} else {
-			logger.info("No order manager found in persistence.");
-			return MapContextLocator.getDefaultOrderManager();
-		}
-		
-	}
-	
-	private DynObject getPluginProperties() {
+    }
+
+    /**
+     * Get current order manager from persistence
+     *
+     * @return
+     */
+    private LayerOrderManager getCurrentOrderManager() {
+
+        DynObject props = this.getPluginProperties();
+        // current_layer_order_manager
+        Object val_obj = null;
+        if (props.hasDynValue(LayerOrderPage.PREFERENCES_ID)) {
+            val_obj = props.getDynValue(LayerOrderPage.PREFERENCES_ID);
+        }
+        if (val_obj != null && val_obj instanceof LayerOrderManager) {
+            LayerOrderManager lom = (LayerOrderManager) val_obj;
+            return lom;
+        } else {
+            logger.info("No order manager found in persistence.");
+            return MapContextLocator.getDefaultOrderManager();
+        }
+
+    }
+
+    private DynObject getPluginProperties() {
         PluginsManager pluginsManager = PluginsLocator.getManager();
         return pluginsManager.getPlugin(AddLayer.class).getPluginProperties();
-	}
-	
-	
-	public void saveToState(PersistentState state) throws PersistenceException {
-		super.saveToState(state);
-	}
-	
-	public void loadFromState(PersistentState state) throws PersistenceException {
-		super.loadFromState(state);
-	}
+    }
 
-	public String exportDocumentAsText() {
-		// FIXME: jjdc PersistentManager getStateAsText o similar
+    public void saveToState(PersistentState state) throws PersistenceException {
+        super.saveToState(state);
+    }
+
+    public void loadFromState(PersistentState state) throws PersistenceException {
+        super.loadFromState(state);
+    }
+
+    public String exportDocumentAsText() {
+        // FIXME: jjdc PersistentManager getStateAsText o similar
 //		 PersistenceManager manager = ToolsLocator.getPersistenceManager();
 //		 PersistentState state = manager.getState(this);
 //		 return manager.getStateAsText(state);
-		return null;
-	}
+        return null;
+    }
 
-	public void setStateFromText(String text) {
-		// FIXME: jjdc PersistentManager getStateFromText o similar
+    public void setStateFromText(String text) {
+        // FIXME: jjdc PersistentManager getStateFromText o similar
 //		 PersistenceManager manager = ToolsLocator.getPersistenceManager();
 //		 PersistentState state = manager.getStateFromText(text);
 //		 this.loadFromState(state);
-	}
+    }
 
-	
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/develtools/PersistenceDevelTool.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/develtools/PersistenceDevelTool.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/develtools/PersistenceDevelTool.java	(revision 44455)
@@ -23,12 +23,14 @@
  */
 package org.gvsig.app.extension.develtools;
 
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
+import java.util.logging.Level;
 
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.dataTypes.DataTypesManager;
@@ -37,241 +39,278 @@
 import org.gvsig.tools.persistence.PersistenceFactory;
 import org.gvsig.tools.persistence.PersistenceManager;
 import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.PersistentState;
 import org.gvsig.tools.swing.api.windowmanager.WindowManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class PersistenceDevelTool {
-	private static Logger logger = LoggerFactory.getLogger(PersistenceDevelTool.class);
 
-	public void showPersistenceFactories() {
-		String html = this.getPersistenceFactories();
-		InfoPanel.save2file("persistenceinfo", html);
-		InfoPanel.showPanel("Persistence factories", WindowManager.MODE.WINDOW, html);
-	}
-	
+    private static Logger logger = LoggerFactory.getLogger(PersistenceDevelTool.class);
 
-	public class PersistenceInfo implements Comparable<PersistenceInfo> {
-		PersistenceFactory factory;
-		@SuppressWarnings("rawtypes")
-		Class theClass;
-		DynStruct definition;
+    public void showPersistenceFactories() {
+        String html = this.getPersistenceFactories();
+        InfoPanel.save2file("persistenceinfo", html);
+        InfoPanel.showPanel("Persistence factories", WindowManager.MODE.WINDOW, html);
+    }
 
-		PersistenceInfo(PersistenceFactory factory,
-				@SuppressWarnings("rawtypes") Class theClass,
-				DynStruct definition) {
-			this.factory = factory;
-			this.theClass = theClass;
-			this.definition = definition;
-		}
+    public class PersistenceInfo implements Comparable<PersistenceInfo> {
 
-		String getDefinitionName() {
-			if (definition == null) {
-				return "";
-			}
-			return definition.getFullName();
-		}
+        PersistenceFactory factory;
+        @SuppressWarnings("rawtypes")
+        Class theClass;
+        DynStruct definition;
 
-		String getDefinitionDescription() {
-			if (definition == null) {
-				return "";
-			}
-			return definition.getDescription();
-		}
+        PersistenceInfo(PersistenceFactory factory,
+                @SuppressWarnings("rawtypes") Class theClass,
+                DynStruct definition) {
+            this.factory = factory;
+            this.theClass = theClass;
+            this.definition = definition;
+        }
 
-		String getClassName() {
-			if (theClass == null) {
-				return "";
-			}
-			return theClass.getName();
-		}
+        boolean hasSaveToState() {
+            try {
+                Method method = theClass.getMethod("saveToState", PersistentState.class);
+                if (method == null) {
+                    return false;
+                }
+            } catch (NoSuchMethodException | SecurityException ex) {
+                return false;
+            }
+            return true;
+        }
 
-		String getFactoryName() {
-			if (factory == null) {
-				return "";
-			}
-			return factory.getClass().getName();
-		}
+        boolean hasLoadFromState() {
+            try {
+                Method method = theClass.getMethod("loadFromState", PersistentState.class);
+                if (method == null) {
+                    return false;
+                }
+            } catch (NoSuchMethodException | SecurityException ex) {
+                return false;
+            }
+            return true;
+        }
 
-		public int compareTo(PersistenceInfo other) {
-			int r = this.factory.getClass().getName()
-					.compareTo(other.factory.getClass().getName());
-			if (r == 0) {
-				return this.theClass.getName().compareTo(
-						other.theClass.getName());
-			}
-			return r;
-		}
-	}
+        String getDefinitionName() {
+            if (definition == null) {
+                return "";
+            }
+            return definition.getFullName();
+        }
 
-	@SuppressWarnings("rawtypes")
-	public class ClassComparator implements Comparator {
+        String getDefinitionDescription() {
+            if (definition == null) {
+                return "";
+            }
+            return definition.getDescription();
+        }
 
-		public int compare(Object o1, Object o2) {
-			if (o1 == null || o2 == null || ((Class) o1).getName() == null) {
-				logger.warn("Esto no deberia estar pasando.");
-				return 0; // FIXME
-			}
-			return ((Class) o1).getName().compareTo(((Class) o2).getName());
-		}
+        String getClassName() {
+            if (theClass == null) {
+                return "";
+            }
+            return theClass.getName();
+        }
 
-	}
+        String getFactoryName() {
+            if (factory == null) {
+                return "";
+            }
+            return factory.getClass().getName();
+        }
 
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public String getPersistenceFactories() {
-		int warningsCounter = 0;
-		List<PersistenceInfo> classes = new ArrayList<PersistenceInfo>();
-		Set<Class> referencedClasses = new TreeSet<Class>(new ClassComparator());
+        public int compareTo(PersistenceInfo other) {
+            int r = this.factory.getClass().getName()
+                    .compareTo(other.factory.getClass().getName());
+            if (r == 0) {
+                return this.theClass.getName().compareTo(
+                        other.theClass.getName());
+            }
+            return r;
+        }
+    }
 
-		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+    @SuppressWarnings("rawtypes")
+    public class ClassComparator implements Comparator {
 
-		List<PersistenceFactory> factories = manager.getFactories();
-		for (PersistenceFactory factory : factories) {
-			List<Class> theClasses = factory.getManagedClasses();
-			for (Class theClass : theClasses) {
+        public int compare(Object o1, Object o2) {
+            if (o1 == null || o2 == null || ((Class) o1).getName() == null) {
+                logger.warn("Esto no deberia estar pasando.");
+                return 0; // FIXME
+            }
+            return ((Class) o1).getName().compareTo(((Class) o2).getName());
+        }
 
-				DynStruct definition = manager.getDefinition(theClass);
-				List defs = factory.getDefinitions();
-				if (definition == null && defs != null && !defs.isEmpty()) {
-					for (int i = 0; i < defs.size(); i++) {
-						definition = (DynStruct) defs.get(i);
-						classes.add(new PersistenceInfo(factory, theClass,
-								definition));
-					}
-				} else {
-					classes.add(new PersistenceInfo(factory, theClass,
-							definition));
-				}
-			}
-		}
-		Collections.sort(classes);
+    }
 
-		StringBuffer buffer = new StringBuffer();
-		StringBuffer warnings = new StringBuffer();
+    @SuppressWarnings({"unchecked", "rawtypes"})
+    public String getPersistenceFactories() {
+        int warningsCounter = 0;
+        List<PersistenceInfo> classes = new ArrayList<PersistenceInfo>();
+        Set<Class> referencedClasses = new TreeSet<Class>(new ClassComparator());
 
-		buffer.append("<html>\n");
-		buffer.append("<body>\n");
-		buffer.append("<h2>Supported persistent classes</h2>\n");
-		buffer.append("<br>\n");
+        PersistenceManager manager = ToolsLocator.getPersistenceManager();
 
-		buffer.append("<ol>\n");
-		for (PersistenceInfo classInfo : classes) {
-			StringBuffer classBuffer = new StringBuffer();
-			boolean warning = false;
-			classBuffer.append("  <li>\n    ");
-			classBuffer.append("Class: <i>");
-			classBuffer.append(classInfo.getClassName());
-			classBuffer.append("</i><br>\n    Persistent: <i>");
-			if (Persistent.class.isAssignableFrom(classInfo.theClass)) {
-				classBuffer.append(" yes.");
-			} else {
-				classBuffer.append(" through a factory.");
-			}
-			classBuffer.append("<br>\n    Factory: <i>");
-			classBuffer.append(classInfo.getFactoryName()).append(
-					"</i><br>\n    Definition name: <i>");
-			classBuffer.append(classInfo.getDefinitionName()).append(
-					"</i><br>\n    Description: \n");
-			classBuffer.append(classInfo.getDefinitionDescription()).append(
-					"<br>\n    ");
-			DataTypesManager dataTypesManager = ToolsLocator
-					.getDataTypesManager();
-			DynStruct definition = classInfo.definition;
-			if (definition == null) {
-				classBuffer.append("Definition for ")
-						.append(classInfo.getClassName())
-						.append(" is null.<br>\n    ");
-				warningsCounter++;
-				warning = true;
-			} else {
-				DynField[] fields = definition.getDynFields();
-				for (int i = 0; i < fields.length; i++) {
-					DynField field = fields[i];
-					if (dataTypesManager.isContainer(field.getType())) {
-						if (field.getClassOfItems() == null) {
-							classBuffer
-									.append("Field <b>")
-									.append(field.getName())
-									.append("</b> as container (")
-                                                                        .append(field.getDataType().getName())
-                                                                        .append("),  can't has class for value of items.<br>\n    ");
-							warningsCounter++;
-							warning = true;
-						} else {
-							classBuffer.append("Field ")
-									.append(field.getName())
-									.append(" as container (")
-                                                                        .append(field.getDataType().getName())
-                                                                        .append(") of '")
-									.append(field.getClassOfItems().getName())
-									.append("'.<br>\n    ");
-							referencedClasses.add(field.getClassOfItems());
-						}
-					} else if (dataTypesManager.isObject(field.getType())) {
-						if (field.getClassOfValue() == null) {
-							classBuffer
-									.append("Field <b>")
-									.append(field.getName())
-									.append(" as object </b> can't has class of value.<br>\n    ");
-							warningsCounter++;
-							warning = true;
-						} else {
-							classBuffer.append("Field ")
-									.append(field.getName()).append(" as object '")
-									.append(field.getClassOfValue())
-									.append("'.<br>\n    ");
-							referencedClasses.add(field.getClassOfValue());
-						}
-					} else {
-                                                classBuffer.append("Field ")
-                                                    .append(field.getName()).append(" as '")
-                                                    .append(field.getDataType().getName())
-                                                    .append("'.<br>\n    ");
-                                        }
-				}
-			}
-			classBuffer.append("<br>\n  </li>\n");
-			buffer.append(classBuffer);
-			if (warning) {
-				warnings.append(classBuffer);
-			}
-		}
-		buffer.append("</ol>\n");
-		buffer.append("<br>\n");
-		buffer.append("<br>\n");
+        List<PersistenceFactory> factories = manager.getFactories();
+        for (PersistenceFactory factory : factories) {
+            List<Class> theClasses = factory.getManagedClasses();
+            for (Class theClass : theClasses) {
 
-		buffer.append("<h2>Persistent classes with problems</h2>\n");
-		buffer.append("<ol>\n");
-		buffer.append(warnings);
-		buffer.append("</ol>\n");
-		buffer.append("<br>\n<p>Total warnigs: ").append(warningsCounter)
-				.append("</p>");
+                DynStruct definition = manager.getDefinition(theClass);
+                List defs = factory.getDefinitions();
+                if (definition == null && defs != null && !defs.isEmpty()) {
+                    for (int i = 0; i < defs.size(); i++) {
+                        definition = (DynStruct) defs.get(i);
+                        classes.add(new PersistenceInfo(factory, theClass,
+                                definition));
+                    }
+                } else {
+                    classes.add(new PersistenceInfo(factory, theClass,
+                            definition));
+                }
+            }
+        }
+        Collections.sort(classes);
 
-		buffer.append("<h2>Not persistents used classes</h2>\n");
-		buffer.append("<ol>\n");
-		for (Class theClass : referencedClasses) {
-			// if( manager.canPersist(theClass) ) {
-			// continue;
-			// }
-			if (Persistent.class.isAssignableFrom(theClass)) {
-				continue;
-			}
-			if (manager.getFactories().get(theClass) != null) {
-				continue;
-			}
-			buffer.append("  <li>\n");
-			buffer.append("    <i>").append(theClass.getName())
-					.append("</i><br>\n");
-			buffer.append("  </li>\n");
-			warningsCounter++;
-		}
-		buffer.append("</ol>\n");
+        StringBuffer buffer = new StringBuffer();
+        StringBuffer warnings = new StringBuffer();
 
-		buffer.append("</body>\n");
-		buffer.append("</html>\n");
+        buffer.append("<html>\n");
+        buffer.append("<body>\n");
+        buffer.append("<h2>Supported persistent classes</h2>\n");
+        buffer.append("<br>\n");
 
-		return buffer.toString();
-	}
+        buffer.append("<ol>\n");
+        for (PersistenceInfo classInfo : classes) {
+            StringBuffer classBuffer = new StringBuffer();
+            boolean warning = false;
+            classBuffer.append("  <li>\n    ");
+            classBuffer.append("Class: <i>");
+            classBuffer.append(classInfo.getClassName());
+            classBuffer.append("</i><br>\n    Persistent: <i>");
 
+            if (Persistent.class.isAssignableFrom(classInfo.theClass)) {
+                classBuffer.append(" yes.");
+                if (!classInfo.hasSaveToState()) {
+                    classBuffer.append("<br>\n    <b>This class doesn't implement saveToState</b>");
+                    warningsCounter++;
+                    warning = true;
+                }
+                if (!classInfo.hasLoadFromState()) {
+                    classBuffer.append("<br>\n    <b>This class doesn't implement loadFromState</b>");
+                    warningsCounter++;
+                    warning = true;
+                }
+            } else {
+                classBuffer.append(" through a factory.");
+            }
 
+            classBuffer.append("<br>\n    Factory: <i>");
+            classBuffer.append(classInfo.getFactoryName()).append(
+                    "</i><br>\n    Definition name: <i>");
+            classBuffer.append(classInfo.getDefinitionName()).append(
+                    "</i><br>\n    Description: \n");
+            classBuffer.append(classInfo.getDefinitionDescription()).append(
+                    "<br>\n    ");
+            DataTypesManager dataTypesManager = ToolsLocator
+                    .getDataTypesManager();
+            DynStruct definition = classInfo.definition;
+            if (definition == null) {
+                classBuffer.append("Definition for ")
+                        .append(classInfo.getClassName())
+                        .append(" is null.<br>\n    ");
+                warningsCounter++;
+                warning = true;
+            } else {
+                DynField[] fields = definition.getDynFields();
+                for (int i = 0; i < fields.length; i++) {
+                    DynField field = fields[i];
+                    if (dataTypesManager.isContainer(field.getType())) {
+                        if (field.getClassOfItems() == null) {
+                            classBuffer
+                                    .append("Field <b>")
+                                    .append(field.getName())
+                                    .append("</b> as container (")
+                                    .append(field.getDataType().getName())
+                                    .append("),  can't has class for value of items.<br>\n    ");
+                            warningsCounter++;
+                            warning = true;
+                        } else {
+                            classBuffer.append("Field ")
+                                    .append(field.getName())
+                                    .append(" as container (")
+                                    .append(field.getDataType().getName())
+                                    .append(") of '")
+                                    .append(field.getClassOfItems().getName())
+                                    .append("'.<br>\n    ");
+                            referencedClasses.add(field.getClassOfItems());
+                        }
+                    } else if (dataTypesManager.isObject(field.getType())) {
+                        if (field.getClassOfValue() == null) {
+                            classBuffer
+                                    .append("Field <b>")
+                                    .append(field.getName())
+                                    .append(" as object </b> can't has class of value.<br>\n    ");
+                            warningsCounter++;
+                            warning = true;
+                        } else {
+                            classBuffer.append("Field ")
+                                    .append(field.getName()).append(" as object '")
+                                    .append(field.getClassOfValue())
+                                    .append("'.<br>\n    ");
+                            referencedClasses.add(field.getClassOfValue());
+                        }
+                    } else {
+                        classBuffer.append("Field ")
+                                .append(field.getName()).append(" as '")
+                                .append(field.getDataType().getName())
+                                .append("'.<br>\n    ");
+                    }
+                }
+            }
+            classBuffer.append("<br>\n  </li>\n");
+            buffer.append(classBuffer);
+            if (warning) {
+                warnings.append(classBuffer);
+            }
+        }
+        buffer.append("</ol>\n");
+        buffer.append("<br>\n");
+        buffer.append("<br>\n");
+
+        buffer.append("<h2>Persistent classes with problems</h2>\n");
+        buffer.append("<ol>\n");
+        buffer.append(warnings);
+        buffer.append("</ol>\n");
+        buffer.append("<br>\n<p>Total warnigs: ").append(warningsCounter)
+                .append("</p>");
+
+        buffer.append("<h2>Not persistents used classes</h2>\n");
+        buffer.append("<ol>\n");
+        for (Class theClass : referencedClasses) {
+            // if( manager.canPersist(theClass) ) {
+            // continue;
+            // }
+            if (Persistent.class.isAssignableFrom(theClass)) {
+                continue;
+            }
+            if (manager.getFactories().get(theClass) != null) {
+                continue;
+            }
+            buffer.append("  <li>\n");
+            buffer.append("    <i>").append(theClass.getName())
+                    .append("</i><br>\n");
+            buffer.append("  </li>\n");
+            warningsCounter++;
+        }
+        buffer.append("</ol>\n");
+
+        buffer.append("</body>\n");
+        buffer.append("</html>\n");
+
+        return buffer.toString();
+    }
+
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DefaultDynamicVectorLegend.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DefaultDynamicVectorLegend.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DefaultDynamicVectorLegend.java	(revision 44455)
@@ -208,7 +208,8 @@
             //TODO: Optimizar por obtener solo los campos que usan las expresiones
             FeatureStore featureStore) throws DataException {
         if (requiredAttributes == null) {
-            requiredAttributes = new String[]{};
+            int arraySize = featureStore.getDefaultFeatureType().size();
+            requiredAttributes = new String[arraySize];
             for (int i = 0; i < featureStore.getDefaultFeatureType().size(); i++) {
                 FeatureAttributeDescriptor att = featureStore.getDefaultFeatureType().get(i);
                 requiredAttributes[i] = att.getName();
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/swing/JComboBoxFonts.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/swing/JComboBoxFonts.java	(revision 44454)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/swing/JComboBoxFonts.java	(revision 44455)
@@ -30,23 +30,33 @@
 /**
  * @author jaume dominguez faus - jaume.dominguez@iver.es
  */
-public class JComboBoxFonts extends JComboBox{
-  private static final long serialVersionUID = -1096327332248927959L;
+public class JComboBoxFonts extends JComboBox {
 
-	public JComboBoxFonts() {
-		super();
-		initialize();
-	}
+    private static final long serialVersionUID = -1096327332248927959L;
 
-	private void initialize() {
-		//	Font info is obtained from the current graphics environment.
-		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+    public JComboBoxFonts() {
+        super();
+        initialize();
+    }
 
-		// --- Get an array of font names (smaller than the number of fonts)
-		String[] fontNames = ge.getAvailableFontFamilyNames();
-		for (int i = 0; i < fontNames.length; i++) {
-			addItem(fontNames[i]);
-		};
-	}
+    private void initialize() {
+        //	Font info is obtained from the current graphics environment.
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
 
+        // --- Get an array of font names (smaller than the number of fonts)
+        String[] fontNames = ge.getAvailableFontFamilyNames();
+        for (int i = 0; i < fontNames.length; i++) {
+            addItem(fontNames[i]);
+        };
+        try {
+            this.setSelectedItem("Arial");
+            this.setSelectedItem("DejaVu Sans");
+            this.setSelectedItem("Liberation Sans");
+            this.setSelectedItem("Serif");
+            
+        } catch (Exception ex) {
+
+        }
+    }
+
 }
