/** @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();
  }
示例#2
0
 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);
 }
示例#3
0
  /** @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);
  }