Package com.dubture.getcomposer.core.repositories

Examples of com.dubture.getcomposer.core.repositories.Repository


  public Repository getRepository() {
    if (repository != null) {
      return repository;
    }
   
    Repository repo = RepositoryFactory.create((String) repos.getKey(type));
    repo.setUrl(url);
    repo.setName(name);
   
    return repo;
  }
View Full Code Here


      composerPackage.getRepositories().add(diag.getRepository());
    }
  }
 
  private void handleEdit() {
    Repository repo = (Repository)((StructuredSelection)repositoryViewer.getSelection()).getFirstElement();
    RepositoryDialog diag = new RepositoryDialog(repositoryViewer.getTable().getShell(), repo.clone());
    if (diag.open() == Dialog.OK) {
      Repository newRepo = diag.getRepository();
      repo.setName(newRepo.getName());
      repo.setUrl(newRepo.getUrl());
    }
  }
View Full Code Here

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

    for (int i = 0; it.hasNext(); i++) {
      Repository repo = (Repository)it.next();
      repos.add(repo);
      names[i] = repo.getName();
    }
   
    MessageDialog diag = new MessageDialog(
        repositoryViewer.getTable().getShell(),
        "Remove Repositor" + (selection.size() > 1 ? "ies" : "y"),
View Full Code Here

    }
   
    @Override
    public String getText(Object element) {
      if (element instanceof Repository) {
        Repository repo = (Repository)element;
        String name;
       
        // name
        if (repo.has("name")) {
          name = repo.getAsString("name");
        } else {
          name = repo.getUrl();
        }
       
        return name;
      }
View Full Code Here

    clear();
    if (obj instanceof JSONArray) {
      for (Object repo : (JSONArray) obj) {
        if (repo instanceof JSONObject && ((JSONObject)repo).containsKey("type")) {
          String type = (String)((JSONObject)repo).get("type");
          Repository r = RepositoryFactory.create(type);
          r.fromJson(repo);
          add(r);
        }
      }
    }
  }
View Full Code Here

    clear();
    if (obj instanceof LinkedList) {
      for (Object repo : (LinkedList) obj) {
        if (repo instanceof LinkedHashMap && ((LinkedHashMap)repo).containsKey("type")) {
          String type = (String)((LinkedHashMap)repo).get("type");
          Repository r = RepositoryFactory.create(type);
          r.fromJson(repo);
          add(r);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.dubture.getcomposer.core.repositories.Repository

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.