예제 #1
0
  static {
    final String dirSubPath = ".JHelp" + File.separator + ".jhelpidl";
    File directory = null;
    final String[] paths = {
      System.getProperty("user.home"),
      System.getProperty("user.dir"),
      System.getProperty("java.home"),
      UtilIO.obtainOutsideDirectory().getAbsolutePath()
    };

    for (final String path : paths) {
      if ((path == null) || (path.trim().length() == 0)) {
        continue;
      }

      directory = new File(path, dirSubPath);

      if (UtilIO.createDirectory(directory) == true) {
        break;
      }
    }

    IDL_DIRECTORY = directory;
    COMPILE_DIRECTORY_BIN = new File(directory, ".compilebin");
    PIPE_DIRECTORY = new File(directory, ".pipe");

    Debug.println(DebugLevel.VERBOSE, "IDL_DIRECTORY=", JHelpIDL.IDL_DIRECTORY.getAbsolutePath());
  }
예제 #2
0
  /**
   * Change the start directory
   *
   * @param file Start directory
   */
  public void setStartDirectory(File file) {
    if (file == null) {
      file = UtilIO.obtainOutsideDirectory();
    }

    if (file.exists() == false) {
      throw new IllegalArgumentException("file must exists : " + file.getAbsolutePath());
    }

    if (file.isFile() == true) {
      file = file.getParentFile();
    }

    this.fileDialog.setDirectory(file.getAbsolutePath());
  }