Package com.dubture.getcomposer.core

Examples of com.dubture.getcomposer.core.VersionedPackage


  }
 
  public Dependencies getDependencies() {
    Dependencies deps = new Dependencies();
    for (PackageSearchPart psp : packageControls.values()) {
      VersionedPackage pkg = ((DependencySearchPart)psp).getPackage();
     
      if (!pkg.getVersion().isEmpty()) {
        deps.add(pkg);
      }
    }
    return deps;
  }
View Full Code Here


    suggestion.getBody().setVisible(expanded);
    ((GridData)suggestion.getBody().getLayoutData()).exclude = !expanded;
  }
 
  public VersionedPackage getPackage() {
    VersionedPackage pkg = new VersionedPackage();
    pkg.setName(name);
    pkg.setVersion(version.getText());
   
    return pkg;
  }
View Full Code Here

      Logger.debug("composer.json already exists in the location");
      return;
    }

    ComposerPackage composerPackage = firstPage.getPackage();
    VersionedPackage phpVersion = new VersionedPackage();
    phpVersion.setName("php");
    phpVersion.setVersion(">=" + firstPage.getPHPVersionValue().getAlias().replace("php", ""));
    composerPackage.getRequire().add(phpVersion);

    ByteArrayInputStream bis = new ByteArrayInputStream(composerPackage.toJson().getBytes());
    file.create(bis, true, monitor);
    getProject().refreshLocal(0, monitor);
View Full Code Here

    return deps.toArray();
  }
 
  public void updateText(MinimalPackage pkg, StyledString styledString) {
    if (pkg instanceof VersionedPackage) {
      VersionedPackage vpkg = (VersionedPackage)pkg;

      super.updateText(pkg, styledString);
     
      if (vpkg.getVersion() != null && vpkg.getVersion().trim() != "" && !vpkg.getVersion().trim().isEmpty()) {
        styledString.append(" : " + vpkg.getVersion().trim(), StyledString.QUALIFIER_STYLER);
      }
    }
  }
View Full Code Here

    manager.add(removeAction);
    manager.add(updateAction);
  }
 
  private void handleEdit() {
    VersionedPackage dep = (VersionedPackage)((StructuredSelection)dependencyViewer.getSelection()).getFirstElement();
    DependencyDialog diag = new DependencyDialog(dependencyViewer.getTable().getShell(), dep.clone());
    if (diag.open() == Dialog.OK) {
      dep.setVersion(diag.getDependency().getVersion());
//      refresh();
    }
  }
View Full Code Here

    Iterator<Object> it = selection.iterator();
    String[] names = new String[selection.size()];
    List<VersionedPackage> deps = new ArrayList<VersionedPackage>();

    for (int i = 0; it.hasNext(); i++) {
      VersionedPackage dep = (VersionedPackage)it.next();
      deps.add(dep);
      names[i] = dep.getName();
    }

    MessageDialog diag = new MessageDialog(
        dependencyViewer.getTable().getShell(),
        "Remove Dependenc" + (selection.size() > 1 ? "ies" : "y"),
View Full Code Here

    Iterator<Object> it = selection.iterator();
    String[] names = new String[selection.size()];
    List<VersionedPackage> deps = new ArrayList<VersionedPackage>();

    for (int i = 0; it.hasNext(); i++) {
      VersionedPackage dep = (VersionedPackage)it.next();
      deps.add(dep);
      names[i] = dep.getName();
    }
   
    updateJob.setPackages(names);
    updateJob.schedule();
  }
View Full Code Here

 
  private boolean hasDevDepsInstalled() {
    // is there like a more performant way to keep this list?
    // keep in mind a composer update command can be run from outside eclipse
    if (composerPackage.getRequireDev().size() > 0) {
      VersionedPackage dev = composerPackage.getRequireDev().toArray()[0];
      ComposerPackages installed = composerProject.getInstalledPackages();
      return installed.has(dev.getName());
    }
    return false;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  protected void parse(Object obj) {
    clear();
    if (obj instanceof JSONObject) {
      for (Entry<String, Object> entry : ((Map<String, Object>)((JSONObject)obj)).entrySet()) {
        VersionedPackage dep = new VersionedPackage();
        dep.setName(entry.getKey());
        dep.setVersion((String)entry.getValue());
        add(dep);
      }
    }
  }
View Full Code Here

  @SuppressWarnings({ "unchecked", "rawtypes" })
  protected void doParse(Object obj) {
    clear();
    if (obj instanceof LinkedHashMap) {
      for (Entry<String, Object> entry : ((Map<String, Object>)((LinkedHashMap)obj)).entrySet()) {
        VersionedPackage dep = new VersionedPackage();
        dep.setName(entry.getKey());
        dep.setVersion((String)entry.getValue());
        add(dep);
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.dubture.getcomposer.core.VersionedPackage

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.