/**
  * Construit la liste des noms des categories
  *
  * @param categories
  */
 public void listerCategories(List<Category> categories) {
   for (Category c : categories) {
     listeCategories.add(c.getName());
   }
   category.removeAllItems();
   for (String s : listeCategories) {
     category.addItem(s);
   }
   listeCategories.clear();
   listeCategories.add("Nouvelle Categorie");
 }
Example #2
0
  private ArrayList<Category> buildCategoryList() {
    ArrayList<Category> categoryList = new ArrayList<Category>();
    Category category1 = new Category(1, "France");
    Category category2 = new Category(2, "Sport");
    Category category3 = new Category(3, "Culture");
    categoryList.add(category1);
    categoryList.add(category2);
    categoryList.add(category3);

    Feed feed1 = new Feed(1, "Le Monde", "www.lemonde.fr/rss/une/xml");
    Feed feed2 = new Feed(2, "Eurosport", "http://www.eurosport.fr/rss.xml");
    Feed feed3 = new Feed(3, "L'equipe", "http://www.lequipe.fr/rss/actu_rss.xml");
    category2.getListFeed().add(feed1);
    category2.getListFeed().add(feed2);
    category2.getListFeed().add(feed3);

    News news1 =
        new News(
            "nimportequoi",
            "http://www.eurosport.fr/football/ligue-1/2013-2014/l1-le-top-10-des-idees-recues.-battues-en-breche_sto4004002/story.shtml",
            "Ta mere",
            new GregorianCalendar(),
            "Championnat homogene, gardiens infranchissables, Paris et Monaco seuls au monde : la Ligue 1 charrie des cliches qui ne correspondent pas a sa realite. Notre top 10.",
            true,
            true);
    News news2 =
        new News(
            "autrenews",
            "http://www.eurosport.fr/football/ligue-1/2013-2014/l1-le-top-10-des-idees-recues.-battues-en-breche_sto4004000/story.shtml",
            "Ta m�re",
            new GregorianCalendar(),
            "Championnat homog�ne, gardiens infranchissables, Paris et Monaco seuls au monde : la Ligue 1 charrie des clich�s qui ne correspondent pas � sa r�alit�. Notre top 10.",
            false,
            false);
    feed2.getListNews().add(news1);
    feed2.getListNews().add(news2);

    return categoryList;
  }