Revision 33261 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java
ProjectExtension.java | ||
---|---|---|
67 | 67 |
import org.exolab.castor.xml.Marshaller; |
68 | 68 |
import org.exolab.castor.xml.ValidationException; |
69 | 69 |
import org.gvsig.gui.beans.swing.JFileChooser; |
70 |
import org.gvsig.tools.file.PathGenerator; |
|
70 | 71 |
|
71 | 72 |
import com.iver.andami.Launcher; |
72 | 73 |
import com.iver.andami.PluginServices; |
... | ... | |
123 | 124 |
private WindowInfo seedProjectWindow; |
124 | 125 |
public static final String LAYOUT_TEMPLATE_FILECHOOSER_ID = "LAYOUT_TEMPLATE_FILECHOOSER_ID"; |
125 | 126 |
public static final String PROJECT_FILE_CHOOSER_ID = "PROJECT_FILECHOOSER_ID"; |
127 |
|
|
128 |
private static PathGenerator pathGenerator=PathGenerator.getInstance(); |
|
126 | 129 |
/** |
127 | 130 |
* Use UTF-8 for encoding, as it can represent characters from |
128 | 131 |
* any language. |
... | ... | |
475 | 478 |
* @param askConfirmation boolean |
476 | 479 |
*/ |
477 | 480 |
public boolean writeProject(File file, Project p, boolean askConfirmation) { |
481 |
pathGenerator.setBasePath(file.getParent()); |
|
478 | 482 |
if( askConfirmation && file.exists()){ |
479 | 483 |
int resp = JOptionPane.showConfirmDialog( |
480 | 484 |
(Component) PluginServices.getMainFrame(),PluginServices.getText(this,"fichero_ya_existe_seguro_desea_guardarlo"), |
... | ... | |
515 | 519 |
} |
516 | 520 |
|
517 | 521 |
public Project readProject(String path) { |
522 |
pathGenerator.setBasePath(new File(path).getParent()); |
|
518 | 523 |
BufferedReader reader =null; |
519 | 524 |
try { |
520 | 525 |
URL url=null; |
... | ... | |
580 | 585 |
* |
581 | 586 |
*/ |
582 | 587 |
public Project readProject(File file) { |
588 |
pathGenerator.setBasePath(file.getParent()); |
|
583 | 589 |
File xmlFile = new File(file.getAbsolutePath()); |
584 | 590 |
try { |
585 | 591 |
String encoding = XMLEncodingUtils.getEncoding(new FileInputStream(xmlFile)); |
Also available in: Unified diff