else if (es == newProjectItem) {
newProjectDialog.setLocationRelativeTo(this);
newProjectDialog.setVisible(true);
String projectName = newProjectDialog.getProjectName();
if ((projectName != null) && (projectName.length() > 0)) {
Project project = newProjectDialog.getProject();
if (JSimLogic.getInstance().createProject(project)) {
pTree.insertProjectNode(newProjectDialog
.getProjectLocation(), project);
newFileTree.insertProjectNode(newProjectDialog
.getProjectLocation(), project);
JSimLogic.getInstance().saveProjectFile(project,
newProjectDialog.getProjectLocation());
JSimLogic.getInstance().saveRemoteProject(
newProjectDialog.getProjectLocation());
// pTree.setup();
// newFileTree.setup();
}
newProjectDialog.setProjectName("");
}
} else if (es == newFileItem) {
newFileDialog.setLocationRelativeTo(this);
newFileDialog.setVisible(true);
String fileName = newFileDialog.getFileName();
if ((fileName != null) && (fileName.length() > 0)) {
try {
String filePath = JSimLogic.getInstance().createFile(
fileName, newFileDialog.getSelectedNode());
if (filePath == null) {
JOptionPane.showMessageDialog(this,
"Can't create file", "File error",
JOptionPane.ERROR_MESSAGE);
} else
pTree.insertNode(newFileDialog.getSelectedNode(),
filePath);
// pTree.updateTree();
} catch (IOException e1) {
JOptionPane.showMessageDialog(this, "Can't create file",
"File error", JOptionPane.ERROR_MESSAGE);
}
}
} else if (es instanceof JSimMenuItem) {
JSimMenuItem item = (JSimMenuItem) es;
Project project = item.getProject();
try {
JSimLogic.getInstance().loadProjectAttributes(project);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();