Package org.rssowl.ui.internal

Examples of org.rssowl.ui.internal.FolderNewsMark


    if (fNewsMarkReference instanceof NewsBinReference)
      return (INewsBin) fNewsMarkReference.resolve();

    if (fNewsMarkReference instanceof FolderReference)
      return new FolderNewsMark((IFolder) fNewsMarkReference.resolve());

    return null;
  }
View Full Code Here


    DynamicDAO.save(feed);

    IBookMark bookMark = fFactory.createBookMark(null, childFolder, new FeedLinkReference(feed.getLink()), "Mark");
    folder = DynamicDAO.save(folder);

    FolderNewsMark mark = new FolderNewsMark(childFolder);
    assertEquals(childFolder.getId(), mark.getId());
    assertEquals(childFolder, mark.getFolder());
    assertEquals("bar", mark.getProperty("foo"));
    assertTrue(Long.valueOf(mark.toReference().getId()).equals(childFolder.getId()));
    assertTrue(mark.contains(bookMark));

    waitForIndexer();
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);

    assertEquals(2, mark.getNews().size());
  }
View Full Code Here

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    FolderNewsMark mark = new FolderNewsMark(childFolder);
    assertTrue(mark.contains(bookMark1));
    assertFalse(mark.contains(bookMark2));
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);

    {
      List<INews> news = mark.getNews();
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
      assertTrue(news.contains(othernews1));
    }

    {
      List<INews> news = mark.getNews(INews.State.getVisible());
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
      assertTrue(news.contains(othernews1));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW));
      assertTrue(news.contains(news1));
      assertTrue(news.contains(othernews1));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(othernews1));
    }

    {
      assertEquals(7, mark.getNewsCount(INews.State.getVisible()));
      assertEquals(7, mark.getNewsCount(EnumSet.of(INews.State.NEW)));
      assertEquals(7, mark.getNewsCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)));
    }

    {
      List<NewsReference> news = mark.getNewsRefs();
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(INews.State.getVisible());
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW));
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      assertTrue(mark.containsNews(news1));
      assertTrue(mark.containsNews(news2));
      assertTrue(mark.containsNews(news3));
      assertTrue(mark.containsNews(copiedNews1));
      assertTrue(mark.containsNews(copiedNews2));
      assertTrue(mark.containsNews(copiedNews3));
      assertTrue(mark.containsNews(othernews1));
    }

    {
      assertTrue(mark.isRelatedTo(news1));
      assertTrue(mark.isRelatedTo(news2));
      assertTrue(mark.isRelatedTo(news3));
      assertTrue(mark.isRelatedTo(copiedNews1));
      assertTrue(mark.isRelatedTo(copiedNews2));
      assertTrue(mark.isRelatedTo(copiedNews3));
    }

    {
      assertTrue(mark.isRelatedTo(search));
    }
  }
View Full Code Here

    IFolder folder = fFactory.createFolder(null, null, "Root");
    IFolder childFolder = fFactory.createFolder(null, folder, "Child");

    DynamicDAO.save(folder);

    FolderNewsMark mark = new FolderNewsMark(childFolder);
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);

    IFeed feed = fFactory.createFeed(null, new URI("feed"));
    INews news1 = fFactory.createNews(null, feed, new Date());
    news1.setState(INews.State.NEW);
    INews news2 = fFactory.createNews(null, feed, new Date());
    news2.setState(INews.State.UNREAD);
    INews news3 = fFactory.createNews(null, feed, new Date());
    news3.setState(INews.State.READ);
    DynamicDAO.save(feed);

    fFactory.createBookMark(null, childFolder, new FeedLinkReference(feed.getLink()), "Mark");

    IFeed otherFeed = fFactory.createFeed(null, new URI("otherfeed"));
    INews othernews1 = fFactory.createNews(null, otherFeed, new Date());
    othernews1.setState(INews.State.NEW);
    INews othernews2 = fFactory.createNews(null, otherFeed, new Date());
    othernews2.setState(INews.State.UNREAD);
    INews othernews3 = fFactory.createNews(null, otherFeed, new Date());
    othernews3.setState(INews.State.READ);
    DynamicDAO.save(otherFeed);

    fFactory.createBookMark(null, folder, new FeedLinkReference(otherFeed.getLink()), "Other Mark");

    INewsBin bin = fFactory.createNewsBin(null, childFolder, "bin");
    DynamicDAO.save(bin);
    INews copiedNews1 = fFactory.createNews(news1, bin);
    INews copiedNews2 = fFactory.createNews(news2, bin);
    INews copiedNews3 = fFactory.createNews(news3, bin);
    DynamicDAO.save(copiedNews1);
    DynamicDAO.save(copiedNews2);
    DynamicDAO.save(copiedNews3);

    ISearchField stateField = fFactory.createSearchField(INews.STATE, INews.class.getName());
    ISearchCondition condition = fFactory.createSearchCondition(stateField, SearchSpecifier.IS, EnumSet.of(INews.State.NEW));
    ISearchMark search = fFactory.createSearchMark(null, childFolder, "search");
    search.addSearchCondition(condition);

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    mark.add(Collections.singleton(news1));
    mark.add(Collections.singleton(news2));
    mark.add(Collections.singleton(news3));
    mark.add(Collections.singleton(copiedNews1));
    mark.add(Collections.singleton(copiedNews2));
    mark.add(Collections.singleton(copiedNews3));
    mark.add(Collections.singleton(othernews1));

    {
      List<INews> news = mark.getNews();
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
      assertTrue(news.contains(othernews1));
    }

    {
      List<INews> news = mark.getNews(INews.State.getVisible());
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
      assertTrue(news.contains(othernews1));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW));
      assertTrue(news.contains(news1));
      assertTrue(news.contains(othernews1));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(othernews1));
    }

    {
      assertEquals(7, mark.getNewsCount(INews.State.getVisible()));
      assertEquals(7, mark.getNewsCount(EnumSet.of(INews.State.NEW)));
      assertEquals(7, mark.getNewsCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)));
    }

    {
      List<NewsReference> news = mark.getNewsRefs();
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(INews.State.getVisible());
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW));
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(othernews1.toReference()));
    }

    {
      assertTrue(mark.containsNews(news1));
      assertTrue(mark.containsNews(news2));
      assertTrue(mark.containsNews(news3));
      assertTrue(mark.containsNews(copiedNews1));
      assertTrue(mark.containsNews(copiedNews2));
      assertTrue(mark.containsNews(copiedNews3));
      assertTrue(mark.containsNews(othernews1));
    }

    {
      assertTrue(mark.isRelatedTo(news1));
      assertTrue(mark.isRelatedTo(news2));
      assertTrue(mark.isRelatedTo(news3));
      assertTrue(mark.isRelatedTo(copiedNews1));
      assertTrue(mark.isRelatedTo(copiedNews2));
      assertTrue(mark.isRelatedTo(copiedNews3));
    }
  }
View Full Code Here

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    FolderNewsMark mark = new FolderNewsMark(childFolder);
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);

    List<NewsEvent> events = new ArrayList<NewsEvent>();
    News oldNews = new News((News) news1, -1);
    oldNews.setId(news1.getId());
    NewsEvent event1 = new NewsEvent(oldNews, news1, true);
    news1.setState(INews.State.HIDDEN);
    News oldNews2 = new News((News) copiedNews1, -1);
    oldNews2.setId(copiedNews1.getId());
    NewsEvent event2 = new NewsEvent(oldNews2, copiedNews1, true);
    copiedNews1.setState(INews.State.HIDDEN);
    News oldNews3 = new News((News) otherNews1, -1);
    oldNews3.setId(otherNews1.getId());
    NewsEvent event3 = new NewsEvent(oldNews3, otherNews1, true);
    otherNews1.setState(INews.State.HIDDEN);
    events.add(event1);
    events.add(event2);
    events.add(event3);

    mark.remove(Arrays.asList(news1, copiedNews1, otherNews1));

    {
      List<INews> news = mark.getNews();
      assertEquals(4, news.size());
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
    }

    {
      List<INews> news = mark.getNews(INews.State.getVisible());
      assertEquals(4, news.size());
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW));
      assertEquals(4, news.size());
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertEquals(4, news.size());
      assertTrue(news.contains(news2));
      assertTrue(news.contains(copiedNews2));
    }

    {
      assertEquals(4, mark.getNewsCount(INews.State.getVisible()));
      assertEquals(4, mark.getNewsCount(EnumSet.of(INews.State.NEW)));
      assertEquals(4, mark.getNewsCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)));
    }

    {
      List<NewsReference> news = mark.getNewsRefs();
      assertEquals(4, news.size());
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(INews.State.getVisible());
      assertEquals(4, news.size());
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW));
      assertEquals(4, news.size());
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertEquals(4, news.size());
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
    }

    {
      assertFalse(mark.containsNews(news1));
      assertTrue(mark.containsNews(news2));
      assertTrue(mark.containsNews(news3));
      assertFalse(mark.containsNews(copiedNews1));
      assertTrue(mark.containsNews(copiedNews2));
      assertTrue(mark.containsNews(copiedNews3));
      assertFalse(mark.containsNews(otherNews1));
    }

    {
      assertTrue(mark.isRelatedTo(news1));
      assertTrue(mark.isRelatedTo(news2));
      assertTrue(mark.isRelatedTo(news3));
      assertTrue(mark.isRelatedTo(copiedNews1));
      assertTrue(mark.isRelatedTo(copiedNews2));
      assertTrue(mark.isRelatedTo(copiedNews3));
    }
  }
View Full Code Here

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    FolderNewsMark mark = new FolderNewsMark(childFolder);
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);

    List<NewsEvent> events = new ArrayList<NewsEvent>();

    News oldNews = new News((News) news1, -1);
    oldNews.setId(news1.getId());
    NewsEvent event1 = new NewsEvent(oldNews, news1, true);
    news1.setState(INews.State.READ);

    News oldNews2 = new News((News) copiedNews1, -1);
    oldNews2.setId(copiedNews1.getId());
    NewsEvent event2 = new NewsEvent(oldNews2, copiedNews1, true);
    copiedNews1.setState(INews.State.NEW);

    News oldNews3 = new News((News) otherNews1, -1);
    oldNews3.setId(otherNews1.getId());
    NewsEvent event3 = new NewsEvent(oldNews3, otherNews1, true);
    otherNews1.setState(INews.State.UNREAD);

    events.add(event1);
    events.add(event2);
    events.add(event3);

    {
      List<INews> news = mark.getNews();
      assertEquals(7, news.size());
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
      assertTrue(news.contains(otherNews1));
    }

    {
      List<INews> news = mark.getNews(INews.State.getVisible());
      assertEquals(7, news.size());
      assertTrue(news.contains(news1));
      assertTrue(news.contains(news2));
      assertTrue(news.contains(news3));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(copiedNews3));
      assertTrue(news.contains(otherNews1));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW));
      assertEquals(7, news.size());
      assertTrue(news.contains(copiedNews1));
    }

    {
      List<INews> news = mark.getNews(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertEquals(7, news.size());
      assertTrue(news.contains(news2));
      assertTrue(news.contains(copiedNews1));
      assertTrue(news.contains(copiedNews2));
      assertTrue(news.contains(otherNews1));
    }

    {
      assertEquals(7, mark.getNewsCount(INews.State.getVisible()));
      assertEquals(7, mark.getNewsCount(EnumSet.of(INews.State.NEW)));
      assertEquals(7, mark.getNewsCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)));
    }

    {
      List<NewsReference> news = mark.getNewsRefs();
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
      assertTrue(news.contains(otherNews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(INews.State.getVisible());
      assertTrue(news.contains(news1.toReference()));
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(news3.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(copiedNews3.toReference()));
      assertTrue(news.contains(otherNews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW));
      assertEquals(7, news.size());
      assertTrue(news.contains(copiedNews1.toReference()));
    }

    {
      List<NewsReference> news = mark.getNewsRefs(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
      assertEquals(7, news.size());
      assertTrue(news.contains(news2.toReference()));
      assertTrue(news.contains(copiedNews1.toReference()));
      assertTrue(news.contains(copiedNews2.toReference()));
      assertTrue(news.contains(otherNews1.toReference()));
    }

    {
      assertTrue(mark.containsNews(news1));
      assertTrue(mark.containsNews(news2));
      assertTrue(mark.containsNews(news3));
      assertTrue(mark.containsNews(copiedNews1));
      assertTrue(mark.containsNews(copiedNews2));
      assertTrue(mark.containsNews(copiedNews3));
      assertTrue(mark.containsNews(otherNews1));
    }

    {
      assertTrue(mark.isRelatedTo(news1));
      assertTrue(mark.isRelatedTo(news2));
      assertTrue(mark.isRelatedTo(news3));
      assertTrue(mark.isRelatedTo(copiedNews1));
      assertTrue(mark.isRelatedTo(copiedNews2));
      assertTrue(mark.isRelatedTo(copiedNews3));
    }
  }
View Full Code Here

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    FolderNewsMark mark = new FolderNewsMark(childFolder);

    /* All */
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);
    assertEquals(7, mark.getNewsCount(INews.State.getVisible()));

    /* New */
    mark.resolve(NewsFilter.Type.SHOW_NEW, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));

    /* Unread */
    mark.resolve(NewsFilter.Type.SHOW_UNREAD, null);
    assertEquals(4, mark.getNewsCount(INews.State.getVisible()));

    /* Recent */
    mark.resolve(NewsFilter.Type.SHOW_RECENT, null);
    assertEquals(7, mark.getNewsCount(INews.State.getVisible()));

    /* Last 5 Days */
    mark.resolve(NewsFilter.Type.SHOW_LAST_5_DAYS, null);
    assertEquals(7, mark.getNewsCount(INews.State.getVisible()));

    /* Sticky */
    mark.resolve(NewsFilter.Type.SHOW_STICKY, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));

    /* Labeled */
    mark.resolve(NewsFilter.Type.SHOW_LABELED, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));
  }
View Full Code Here

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    FolderNewsMark mark = new FolderNewsMark(childFolder);

    /* All */
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);
    assertEquals(7, mark.getNewsCount(INews.State.getVisible()));

    /* New */
    mark.resolve(NewsFilter.Type.SHOW_NEW, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));

    /* Unread */
    mark.resolve(NewsFilter.Type.SHOW_UNREAD, null);
    assertEquals(4, mark.getNewsCount(INews.State.getVisible()));

    /* Recent */
    mark.resolve(NewsFilter.Type.SHOW_RECENT, null);
    assertEquals(7, mark.getNewsCount(INews.State.getVisible()));

    /* Last 5 Days */
    mark.resolve(NewsFilter.Type.SHOW_LAST_5_DAYS, null);
    assertEquals(7, mark.getNewsCount(INews.State.getVisible()));

    /* Sticky */
    mark.resolve(NewsFilter.Type.SHOW_STICKY, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));

    /* Labeled */
    mark.resolve(NewsFilter.Type.SHOW_LABELED, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));
  }
View Full Code Here

    folder = DynamicDAO.save(folder);

    waitForIndexer();
    Controller.getDefault().getSavedSearchService().updateSavedSearches(true);

    FolderNewsMark mark = new FolderNewsMark(childFolder);

    /* All */
    mark.resolve(NewsFilter.Type.SHOW_ALL, null);
    assertEquals(9, mark.getNewsCount(INews.State.getVisible()));

    /* New */
    mark.resolve(NewsFilter.Type.SHOW_NEW, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));

    /* Unread */
    mark.resolve(NewsFilter.Type.SHOW_UNREAD, null);
    assertEquals(5, mark.getNewsCount(INews.State.getVisible()));

    /* Recent */
    mark.resolve(NewsFilter.Type.SHOW_RECENT, null);
    assertEquals(9, mark.getNewsCount(INews.State.getVisible()));

    /* Last 5 Days */
    mark.resolve(NewsFilter.Type.SHOW_LAST_5_DAYS, null);
    assertEquals(9, mark.getNewsCount(INews.State.getVisible()));

    /* Sticky */
    mark.resolve(NewsFilter.Type.SHOW_STICKY, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));

    /* Labeled */
    mark.resolve(NewsFilter.Type.SHOW_LABELED, null);
    assertEquals(2, mark.getNewsCount(INews.State.getVisible()));
  }
View Full Code Here

    else
      fillNewsBySearch(folder, news);
  }

  private void fillNewsBySearch(IFolder folder, Collection<INews> news) {
    FolderNewsMark folderNewsMark = new FolderNewsMark(folder);
    folderNewsMark.resolve(Type.SHOW_UNREAD, new NullProgressMonitor());
    List<NewsReference> newsRefs = folderNewsMark.getNewsRefs();
    for (NewsReference reference : newsRefs) {
      INews item = reference.resolve();
      if (item != null)
        news.add(item);
      else
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.FolderNewsMark

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.