/** @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */ public void actionPerformed(ActionEvent e) { IpssProject curproj = graphpad.getCurrentProject(); ArrayList<IpssDocument> projdocs = curproj.getAllOpenedDocuments(); IpssEditorDocument[] docs = graphpad.getAllDocuments(); if ((docs != null) && (projdocs.size() > 0)) for (int i = 0; i < docs.length; i++) { if (projdocs.contains(docs[i])) { graphpad.closeDocument(docs[i]); } } graphpad.update(); }
public void init(IpssProject project, String aDocName) { setFilepath(project.getProjectPath()); setDocName(aDocName); // pack the form and display pack(); setLocationRelativeTo(parentFrame); setSize(new Dimension(629, 243)); setVisible(true); }
/** @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */ public void actionPerformed(ActionEvent e) { IpssProject curproj = graphpad.getCurrentProject(); String newname = JOptionPane.showInputDialog(Translator.getString("ProjectName"), curproj.getProjectName()); if (newname == null) return; if (!newname.equals(curproj.getProjectName())) { if (!Utilities.renameFile( curproj.getProjectPath(), curproj.getParentPath() + System.getProperty("file.separator") + newname)) { JOptionPane.showMessageDialog( this.getGraphpad().getFrame(), "Project already exists", "ERROR", JOptionPane.ERROR_MESSAGE); return; } } curproj.setProjectName(newname); }