Exemplo n.º 1
0
  /*................................................................................................*/
  public boolean startJob(String arguments, Object condition, boolean hiredByName) {
    addMenuItem("Directory for Sample Trees From Directory...", makeCommand("setDirPath", this));
    fillerTasks = new Vector();
    if (!MesquiteThread
        .isScripting()) { // enclosed in conditional to avoid hiring query when opening file; should
      // be handled by snapshot/doCommand when file is opened.
      String directoryPath =
          MesquiteFile.chooseDirectory(
              "Choose directory containing tree files:",
              previousDirectory); // MesquiteFile.saveFileAsDialog("Base name for files (files will
      // be named <name>1.nex, <name>2.nex, etc.)", baseName);

      if (StringUtil.blank(directoryPath)) { // TODO: clean this up?
        return false;
      } else {
        directory = new File(directoryPath);
        previousDirectory = directory.getParent();
        if (directory.exists() && directory.isDirectory()) {
          return hireFillers(directoryPath);
        }
      }
    }
    return true; // Add something to make sure directory paths are set up correctly, when not
    // scripting...
  }