Revision 17441 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java

View differences:

ProjectExtension.java
60 60
import java.util.prefs.Preferences;
61 61

  
62 62
import javax.swing.ImageIcon;
63
import javax.swing.JFileChooser;
64 63
import javax.swing.JOptionPane;
65 64

  
66 65
import org.exolab.castor.xml.MarshalException;
67 66
import org.exolab.castor.xml.Marshaller;
68 67
import org.exolab.castor.xml.ValidationException;
68
import org.gvsig.gui.beans.swing.JFileChooser;
69 69

  
70 70
import com.iver.andami.Launcher;
71 71
import com.iver.andami.PluginServices;
......
116 116
	private String lastSavePath;
117 117
	private String templatesPath;
118 118
	private WindowInfo seedProjectWindow;
119
	public static final String LAYOUT_TEMPLATE_FILECHOOSER_ID = "LAYOUT_TEMPLATE_FILECHOOSER_ID";
120
	public static final String PROJECT_FILE_CHOOSER_ID = "PROJECT_FILECHOOSER_ID";
119 121
	/**
120 122
	 * Use UTF-8 for encoding, as it can represent characters from
121 123
	 * any language.
......
285 287
		if (lastSavePath == null)
286 288
			lastSavePath = projectPath;
287 289

  
288
		if (lastSavePath == null) {
289
			Preferences prefs = Preferences.userRoot().node( "gvsig.foldering" );
290
			lastSavePath = prefs.get("ProjectsFolder", null);
291
		}
292 290

  
293
		JFileChooser jfc = new JFileChooser(lastSavePath);
291
		Preferences prefs = Preferences.userRoot().node( "gvsig.foldering");
292
		JFileChooser jfc = new JFileChooser(PROJECT_FILE_CHOOSER_ID, prefs.get("ProjectsFolder", null));
293

  
294 294
		jfc.setDialogTitle(PluginServices.getText(this, "guardar_proyecto"));
295 295
		jfc.addChoosableFileFilter(new GenericFileFilter("gvp",
296 296
				PluginServices.getText(this, "tipo_fichero_proyecto")));
......
352 352
			showProjectWindow();
353 353
			PluginServices.getMainFrame().setTitle(PluginServices.getText(this, "sin_titulo"));
354 354
		} else if (actionCommand.equals("ABRIR")) {
355
			if (!askSave()) {
355
			if (!askSave()) 
356 356
				return;
357
			}
358 357

  
359
			if (lastPath == null) {
360
				Preferences prefs = Preferences.userRoot().node( "gvsig.foldering" );
361
				lastPath = prefs.get("ProjectsFolder", null);
362
			}
363

  
364
			JFileChooser jfc = new JFileChooser(lastPath);
358
			Preferences prefs = Preferences.userRoot().node( "gvsig.foldering" );
359
			JFileChooser jfc = new JFileChooser(PROJECT_FILE_CHOOSER_ID, prefs.get("ProjectsFolder", null));
365 360
			jfc.addChoosableFileFilter(new GenericFileFilter("gvp",
366 361
					PluginServices.getText(this, "tipo_fichero_proyecto")));
367 362

  
......
406 401
			templatesPath = prefs.get("TemplatesFolder", null);
407 402
		}
408 403

  
409
		JFileChooser jfc = new JFileChooser(templatesPath);
404
		JFileChooser jfc = new JFileChooser(LAYOUT_TEMPLATE_FILECHOOSER_ID, templatesPath);
410 405
		jfc.addChoosableFileFilter(new GenericFileFilter("gvt",
411 406
				PluginServices.getText(this, "plantilla")));
412 407

  

Also available in: Unified diff