Package com.dubture.getcomposer.packages

Examples of com.dubture.getcomposer.packages.AsyncPackagistDownloader


    this.factory = factory;
    this.target = target;
    this.composerPackage = composerPackage;
   
    // load package with versions
    AsyncPackageDownloader downloader = new AsyncPackagistDownloader();
    downloader.addPackageListener(new PackageListenerInterface() {
      public void packageLoaded(final RepositoryPackage repositoryPackage) {
        dataArrived = true;
        pkg = repositoryPackage;
       
        // get major and minor
        Versions versions = pkg.getVersions();
       
        majorVersion = versions.getRecentMajor();
        minorVersion = versions.getRecentMinor(majorVersion);
       
        if (!updatingTarget) {
          updateUI();
        }
      }
     
      public void errorOccured(Exception e) {
        e.printStackTrace();
      }

      public void aborted(String url) {}
    });
    downloader.loadPackage(name);
   
    create(parent, factory);
  }
View Full Code Here


  protected void loadVersionCombo() {

    versionCombo.setItems(new String[]{"Loading versions..."});
    versionCombo.select(0);
   
    AsyncPackagistDownloader dl = new AsyncPackagistDownloader();
    dl.addPackageListener(new PackageListenerInterface() {

      @Override
      public void errorOccured(Exception e) {
        isLoadingVersions = false;
      }

      @Override
      public void aborted(String url) {
        isLoadingVersions = false;
      }

      @Override
      public void packageLoaded(RepositoryPackage repositoryPackage) {
        Versions versions = repositoryPackage.getVersions();
        final List<String> versionNames = new ArrayList<String>();
        for (Entry<String, ComposerPackage> version : versions) {
          versionNames.add(version.getValue().getVersion());
        }

        getDisplay().asyncExec(new Runnable() {
          @Override
          public void run() {
            filterItem.setVersions(versionNames.toArray(new String[versionNames.size()]));
            loadVersionsFromCache();
          }
        });
        isLoadingVersions = false;
      }
    });

    dl.loadPackage(item.getName());
    isLoadingVersions = true;
  }
View Full Code Here

  protected void loadVersionCombo() {

    symfonyVersionSelector.setItems(new String[]{"Loading versions..."});
    symfonyVersionSelector.selectItem(0);
   
    AsyncPackagistDownloader dl = new AsyncPackagistDownloader();
    dl.addPackageListener(new PackageListenerInterface() {

      @Override
      public void errorOccured(Exception e) {
        Logger.logException(e);
      }

      @Override
      public void aborted(String url) {
       
      }

      @Override
      public void packageLoaded(RepositoryPackage repositoryPackage) {
        Versions versions = repositoryPackage.getVersions();
        final List<String> versionNames = new ArrayList<String>();
        for (Entry<String, ComposerPackage> version : versions) {
          versionNames.add(version.getValue().getVersion());
        }

        Display.getDefault().asyncExec(new Runnable() {
          @Override
          public void run() {
            symfonyVersionSelector.setItems(versionNames.toArray(new String[versionNames.size()]));
            symfonyVersionSelector.selectItem(0);
          }
        });
      }
    });

    dl.loadPackage(SymfonyCoreConstants.SYMFONY_STANDARD_EDITION);
  }
View Full Code Here

TOP

Related Classes of com.dubture.getcomposer.packages.AsyncPackagistDownloader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.