Ejemplo n.º 1
0
  /**
   * Returns the list of installed packages, parsing them if this has not yet been done.
   *
   * <p>The package list is cached in the {@link LocalSdkParser} and will be reset when {@link
   * #reloadSdk()} is invoked.
   */
  public Package[] getInstalledPackages(ITaskMonitor monitor) {
    LocalSdkParser parser = getLocalSdkParser();

    Package[] packages = parser.getPackages();

    if (packages == null) {
      // load on demand the first time
      packages = parser.parseSdk(getOsSdkRoot(), getSdkManager(), monitor);
    }

    return packages;
  }