Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ProjectExtension.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ProjectExtension.java	(revision 43292)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ProjectExtension.java	(revision 43293)
@@ -318,82 +318,77 @@
 		this.execute(command, null);
 	}
 
-	public void execute(String actionCommand, Object[] args) {
-		if (actionCommand.equals("application-project-new")) {
-			if (!askSave()) {
-				return;
-			}
+    public void execute(String actionCommand, Object[] args) {
+        if (actionCommand.equals("application-project-new")) {
+            if (!askSave()) {
+                return;
+            }
 
-			projectPath = null;
-			PluginServices.getMDIManager().closeAllWindows();
-			setProject(ProjectManager.getInstance().createProject());
-			getProjectFrame().setProject(p);
-			showProjectWindow();
-			PluginServices.getMainFrame().setTitle(
-					PluginServices.getText(this, "sin_titulo"));
+            projectPath = null;
+            PluginServices.getMDIManager().closeAllWindows();
+            setProject(ProjectManager.getInstance().createProject());
 
-            } else if (actionCommand.equals("application-project-open")) {
-			if (!askSave()) {
-				return;
-			}
-                        File projectFile = (File) ArrayUtils.get(args, 0, DataTypes.FILE);
-                        if ( projectFile != null && !projectFile.exists() ) {
-                            LOG.warn("Can't load project '"
-                                    + projectFile.getAbsolutePath()
-                                    + "', file not exist.");
-                            projectFile = null;
-                        }
+            showProjectWindow();
+            PluginServices.getMainFrame().setTitle(PluginServices.getText(this, "sin_titulo"));
 
-			if (projectFile == null) {
-				Preferences prefs = Preferences.userRoot().node(
-						"gvsig.foldering");
-				JFileChooser jfc = new JFileChooser(PROJECT_FILE_CHOOSER_ID,
-						prefs.get("ProjectsFolder", null));
+        } else if (actionCommand.equals("application-project-open")) {
+            if (!askSave()) {
+                return;
+            }
 
-				GenericFileFilter projExtensionFilter = new GenericFileFilter(
-						Project.FILE_EXTENSION, PluginServices.getText(this,
-								"tipo_fichero_proyecto"));
-        jfc.addChoosableFileFilter(projExtensionFilter);
-				jfc.setFileFilter(projExtensionFilter);
+            setProject(ProjectManager.getInstance().createProject());
 
-				if (jfc.showOpenDialog((Component) PluginServices
-						.getMainFrame()) != JFileChooser.APPROVE_OPTION) {
-					return;
-				}
-				// ProjectDocument.initializeNUMS();
+            File projectFile = (File) ArrayUtils.get(args, 0, DataTypes.FILE);
+            if (projectFile != null && !projectFile.exists()) {
+                LOG.warn("Can't load project '" + projectFile.getAbsolutePath() + "', file not exist.");
+                projectFile = null;
+            }
 
+            if (projectFile == null) {
+                Preferences prefs = Preferences.userRoot().node("gvsig.foldering");
+                JFileChooser jfc = new JFileChooser(PROJECT_FILE_CHOOSER_ID, prefs.get("ProjectsFolder", null));
 
-				projectFile = jfc.getSelectedFile();
-			}
+                GenericFileFilter projExtensionFilter =
+                    new GenericFileFilter(Project.FILE_EXTENSION, PluginServices.getText(this, "tipo_fichero_proyecto"));
+                jfc.addChoosableFileFilter(projExtensionFilter);
+                jfc.setFileFilter(projExtensionFilter);
 
-			PluginServices.getMDIManager().closeAllWindows();
+                if (jfc.showOpenDialog((Component) PluginServices.getMainFrame()) != JFileChooser.APPROVE_OPTION) {
+                    return;
+                }
+                // ProjectDocument.initializeNUMS();
 
-			Project o = readProject(projectFile);
-			setPath(projectFile.getAbsolutePath());
-			// lastPath = getPath();
-			if (o != null) {
-				setProject(o);
-			}
+                projectFile = jfc.getSelectedFile();
+            }
 
-			getProjectFrame().setProject(p);
-			PluginServices.getMainFrame().setTitle(projectFile.getName());
-			getProjectFrame().refreshControls();
+            PluginServices.getMDIManager().closeAllWindows();
 
-			// p.restoreWindowProperties();
+            Project o = readProject(projectFile);
+            setPath(projectFile.getAbsolutePath());
+            // lastPath = getPath();
+            if (o != null) {
+                setProject(o);
+            }
 
-		} else if (actionCommand.equals("application-project-save")) {
-//			saveProject();
-			try {
+            getProjectFrame().setProject(p);
+            PluginServices.getMainFrame().setTitle(projectFile.getName());
+            getProjectFrame().refreshControls();
+
+            // p.restoreWindowProperties();
+
+        } else if (actionCommand.equals("application-project-save")) {
+            // saveProject();
+            try {
                 Launcher.manageUnsavedData("there_are_unsaved_resources");
             } catch (Exception e) {
                 LOG.warn("Can't manage unsaved data", e);
             }
-		} else if (actionCommand.equals("application-project-save-as")) {
-			File file = (File) ArrayUtils.get(args, 0, DataTypes.FILE);
-			saveAsProject(file);
-		}
+        } else if (actionCommand.equals("application-project-save-as")) {
+            File file = (File) ArrayUtils.get(args, 0, DataTypes.FILE);
+            saveAsProject(file);
+        }
 
-	}
+    }
 
 
     private void createEmptyProject() {
@@ -581,8 +576,8 @@
 	 * @param p
 	 */
 	public void setProject(Project p) {
-		getProjectFrame().setProject(p);
 		this.p = p;
+		getProjectFrame().setProject(p);
 	}
 
 	private void registerDocuments() {
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/gui/ProjectWindow.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/gui/ProjectWindow.java	(revision 43292)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/gui/ProjectWindow.java	(revision 43293)
@@ -151,7 +151,9 @@
      */
     public void setProject(Project project) {
         this.project = project;
-        project.addPropertyChangeListener(this);
+        if(project!=null){
+            project.addPropertyChangeListener(this);
+        }
         refreshControls();
     }
 
@@ -196,7 +198,7 @@
             if (selectedDoc!=null) {
             	lstDocs.setSelectedValue(selectedDoc, false);
             }
-            
+
             ((TitledBorder) getDocumentsPanel().getBorder())
                 .setTitle(tituloMarco);
             getDocumentsPanel().repaint(1);
@@ -421,7 +423,7 @@
         int res = application.confirmDialog(
                 i18n.getTranslation("confirmar_borrar"),
                 i18n.getTranslation("borrar"),
-                JOptionPane.YES_NO_OPTION, 
+                JOptionPane.YES_NO_OPTION,
                 JOptionPane.INFORMATION_MESSAGE,
                 "Confirm remove document from project"
         );
@@ -435,8 +437,8 @@
                 Document doc = documents.get(index);
                 if (doc.isLocked()) {
                     application.messageDialog(
-                        i18n.getTranslation("locked_element_it_cannot_be_deleted"), 
-                        i18n.getTranslation("Information"), 
+                        i18n.getTranslation("locked_element_it_cannot_be_deleted"),
+                        i18n.getTranslation("Information"),
                         JOptionPane.INFORMATION_MESSAGE
                     );
                     return;
@@ -547,7 +549,7 @@
                 if( ! identityManager.getCurrentIdentity().isAuthorized(Document.ACCESS_DOCUMENT_AUTHORIZATION, documentFactory, documentFactory.getTypeName()) ) {
                     // throw new UnauthorizedException(Document.ACCESS_DOCUMENT_AUTHORIZATION, documentFactory, documentFactory.getTypeName());
                     continue;
-                }                
+                }
                 JRadioButton rb = new JRadioButton();
 
                 rb.setIcon(documentFactory.getIcon());
