Ejemplo n.º 1
0
  /**
   * Select the JRE to choose. The selection algorithm will try to match based on the order
   * specified in the JNLP file. For example,
   *
   * <p><j2se version="1.3 1.2"/> <j2se version="1.4"/>
   *
   * <p>If a wildcard is used, e.g., 1.2+ or 1.2*, we will try to match on the current running or
   * highest version installed
   *
   * <p>Will match on the platform versions 1.3 1.2 1.4 in that given order
   */
  static ConfigProperties.JREInformation selectJRE(LaunchDesc ld) {
    final JREDesc selectedJREDesc[] = new JREDesc[1];
    final ConfigProperties.JREInformation selectedJRE[] = new ConfigProperties.JREInformation[1];

    // Iterate through all JREDesc's
    ResourcesDesc rdescs = ld.getResources();
    rdescs.visit(
        new ResourceVisitor() {
          public void visitJARDesc(JARDesc jad) {
            /* ignore */
          }

          public void visitPropertyDesc(PropertyDesc prd) {
            /* ignore */
          }

          public void visitPackageDesc(PackageDesc pad) {
            /* ignore */
          }

          public void visitExtensionDesc(ExtensionDesc ed) {
            /* ignore */
          }

          public void visitJREDesc(JREDesc jre) {
            if (selectedJRE[0] == null) {
              handleJREDesc(jre, selectedJRE, selectedJREDesc);
            }
          }
        });
    // Mark the selected JRE in launchDesc
    selectedJREDesc[0].markAsSelected();
    return selectedJRE[0];
  }
 public void initialize(LaunchDesc paramLaunchDesc) {
   ResourcesDesc localResourcesDesc = paramLaunchDesc.getResources();
   if (localResourcesDesc != null) {
     JNLPUtils.sortResourcesForClasspath(
         localResourcesDesc, this._jarsInURLClassLoader, this._jarsNotInURLClassLoader);
     for (int i = 0; i < this._jarsInURLClassLoader.size(); i++) {
       JARDesc localJARDesc = (JARDesc) this._jarsInURLClassLoader.get(i);
       addURL(localJARDesc.getLocation());
     }
   }
 }
  public static int showDTIDialog(Frame owner, LaunchDesc ld) {

    String appTitle = ld.getInformation().getTitle();
    ShortcutDesc sd = ld.getInformation().getShortcut();

    boolean doDesktop = (sd == null) ? true : sd.getDesktop();
    boolean doMenu = (sd == null) ? true : sd.getMenu();

    LookAndFeel lookAndFeel = DeployUIManager.setLookAndFeel();

    DesktopIntegration pane = new DesktopIntegration(owner, appTitle, doDesktop, doMenu);
    JDialog dialog = pane.createDialog(owner, ResourceManager.getString("install.title", appTitle));
    DialogFactory.positionDialog(dialog);
    SplashScreen.hide();
    dialog.setVisible(true);

    DeployUIManager.restoreLookAndFeel(lookAndFeel);

    return pane._answer;
  }
Ejemplo n.º 4
0
 public boolean canLaunchOffline() {
   if (getLaunchDesc().isApplicationDescriptor()) {
     return _ld.getInformation().supportsOfflineOperation();
   }
   return false;
 }
Ejemplo n.º 5
0
 public boolean hasHref() {
   if (getLaunchDesc().isApplicationDescriptor()) {
     return (_ld.getLocation() != null);
   }
   return false;
 }