コード例 #1
0
    public void actionPerformed(ActionEvent e) {
      if ("true".equals(properties.getProperty("windows-x86.app.enabled"))
          || "true".equals(properties.getProperty("windows-x64.app.enabled"))
          || "true".equals(properties.getProperty("linux-x86.app.enabled"))
          || "true".equals(properties.getProperty("linux-x64.app.enabled"))
          || "true".equals(properties.getProperty("macosx-x64.app.enabled"))) {
        desktopDeployment.loadTargets(
            "nbres:/com/jme3/gde/desktop/executables/desktop-deployment-targets.xml");
        desktopDeployment.checkExtension(project);
        if ("true".equals(properties.getProperty("bundle.jre.enabled"))) {
          checkJreDownloads();
        }
      } else {
        desktopDeployment.removeExtension(project);
      }

      try {
        properties.store();
      } catch (IOException ioe) {
        Exceptions.printStackTrace(ioe);
      }
    }
コード例 #2
0
 public void checkJreDownloads() {
   String projectPath = project.getProjectDirectory().getPath();
   if ("true".equals(properties.getProperty("windows-x86.app.enabled"))) {
     String jreName =
         projectPath
             + File.separator
             + "resources"
             + File.separator
             + "desktop-deployment"
             + File.separator
             + "jre-windows-x86.tar.gz";
     if (!new File(jreName).exists()) {
       JreDownloader.downloadJre("windows-i586", jreName);
     }
   }
   if ("true".equals(properties.getProperty("windows-x64.app.enabled"))) {
     String jreName =
         projectPath
             + File.separator
             + "resources"
             + File.separator
             + "desktop-deployment"
             + File.separator
             + "jre-windows-x64.tar.gz";
     if (!new File(jreName).exists()) {
       JreDownloader.downloadJre("windows-x64", jreName);
     }
   }
   if ("true".equals(properties.getProperty("linux-x86.app.enabled"))) {
     String jreName =
         projectPath
             + File.separator
             + "resources"
             + File.separator
             + "desktop-deployment"
             + File.separator
             + "jre-linux-x86.tar.gz";
     if (!new File(jreName).exists()) {
       JreDownloader.downloadJre("linux-i586", jreName);
     }
   }
   if ("true".equals(properties.getProperty("linux-x64.app.enabled"))) {
     String jreName =
         projectPath
             + File.separator
             + "resources"
             + File.separator
             + "desktop-deployment"
             + File.separator
             + "jre-linux-x64.tar.gz";
     if (!new File(jreName).exists()) {
       JreDownloader.downloadJre("linux-x64", jreName);
     }
   }
   if ("true".equals(properties.getProperty("macosx-x64.app.enabled"))) {
     String jreName =
         projectPath
             + File.separator
             + "resources"
             + File.separator
             + "desktop-deployment"
             + File.separator
             + "jre-macosx-x64.tar.gz";
     if (!new File(jreName).exists()) {
       JreDownloader.downloadJre("macosx-x64", jreName);
     }
   }
 }