* Saves Project Settings (XML)
* @param project
*/
public void saveProjectSettings(Project project) {
String projectFile = "";
SSHDataHandler handler = null;
if (project.getLocation() == ProjectLocation.LOCALE) {
projectFile = workspaceDir + project.getPathName()
+ JSimConstants.PROJECTCONFFILE;
} else {
RemoteProject rmProject = (RemoteProject) project;
handler = (SSHDataHandler) rmProject.getDataHandler();
projectFile = handler
.createTempPath(rmProject.getPath() + rmProject.getName()
+ "/" + JSimConstants.PROJECTCONFFILE);
projectFile += JSimConstants.PROJECTCONFFILE;
}
IXMLWriter projectWriter = new ProjectSettingSAXWriter(project);
try {
projectWriter.writeXML(projectFile);
} catch (Exception e) {
JOptionPane.showMessageDialog(frame, e.getMessage(), "Save error",
JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
if (project.getLocation() == ProjectLocation.SSH) {
try {
handler.copyToServer(new File(projectFile));
} catch (IOException e) {
JOptionPane.showMessageDialog(frame, e.getMessage(),
"Save error", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}