Package org.rssowl.core.model.reference

Examples of org.rssowl.core.model.reference.FolderReference


    List<IBookMark> emptyBookmarks = fAppLayer.loadBookMarks(feed);
    assertEquals(0, emptyBookmarks.size());

    IFolder root1 = fFactory.createFolder(null, null, "Root 1");
    FolderReference root1Ref = new FolderReference(fDao.saveFolder(root1).getId());

    IFolder childOfRoot1 = fFactory.createFolder(null, root1Ref.resolve(), "Child of Root 1");
    FolderReference childOfRoot1Ref = new FolderReference(fDao.saveFolder(childOfRoot1).getId());

    IBookMark bookmark1 = fFactory.createBookMark(null, root1Ref.resolve(),
        feed.getLink(), feedRef, "Bookmark 1");
    IBookMark bookmark2 = fFactory.createBookMark(null, root1Ref.resolve(),
        feed.getLink(), feedRef, "Bookmark 2");
    IBookMark bookmark3 = fFactory.createBookMark(null, childOfRoot1Ref.resolve(),
        feed.getLink(), feedRef, "Bookmark 3");

    BookMarkReference bookmarkRef1 = new BookMarkReference(fDao.saveBookMark(bookmark1).getId());
    BookMarkReference bookmarkRef2 = new BookMarkReference(fDao.saveBookMark(bookmark2).getId());
    BookMarkReference bookmarkRef3 = new BookMarkReference(fDao.saveBookMark(bookmark3).getId());
View Full Code Here


    IFolder root3 = fFactory.createFolder(null, null, "Root 3");

    fFactory.createFolder(null, root1, "Child of Root 1");
    fFactory.createFolder(null, root2, "Child of Root 2");

    FolderReference root1Ref = new FolderReference(fDao.saveFolder(root1).getId());
    FolderReference root2Ref = new FolderReference(fDao.saveFolder(root2).getId());
    FolderReference root3Ref = new FolderReference(fDao.saveFolder(root3).getId());

    List<IFolder> rootFolders = fAppLayer.loadRootFolders();
    assertEquals(3, rootFolders.size());
    for (IFolder folder : rootFolders) {
      if (root1Ref.resolve().equals(folder))
        assertEquals("Root 1", folder.getName());
      else if (root2Ref.resolve().equals(folder))
        assertEquals("Root 2", folder.getName());
      else if (root3Ref.resolve().equals(folder))
        assertEquals("Root 3", folder.getName());
      else
        fail();
    }
  }
View Full Code Here

      };
      NewsModel.getDefault().addFolderListener(folderListener);
      fModelDAO.saveFolder(initialFolder);
      assertTrue(folderAddedCalled[0]);
      assertTrue(folderUpdatedCalled[0]);
      fModelDAO.deleteFolder(new FolderReference(updatedFolder[0].getId()));
    } catch (PersistenceException e) {
      fail(e.getMessage());
    } finally {
      if (folderListener != null) {
        NewsModel.getDefault().removeFolderListener(folderListener);
View Full Code Here

      };
      NewsModel.getDefault().addFolderListener(folderListener);
      fModelDAO.saveFolder(initialFolder[0]);
      assertTrue(folderAddedCalled[0]);
      assertTrue(folderUpdatedCalled[0]);
      fModelDAO.deleteFolder(new FolderReference(updatedFolder[0].getId()));
    } catch (PersistenceException e) {
      fail(e.getMessage());
    } finally {
      if (folderListener != null) {
        NewsModel.getDefault().removeFolderListener(folderListener);
View Full Code Here

  private int countNews(IEntity entity) throws PersistenceException {
    int count = 0;

    if (entity instanceof IFolder) {
      IFolder folder = new FolderReference(entity.getId()).resolve();
      List<IMark> marks = folder.getMarks();
      for (IMark mark : marks) {
        if (mark instanceof IBookMark) {
          IFeed feed = ((IBookMark) mark).getFeedReference().resolve();
          count += feed.getVisibleNews().size();
View Full Code Here

  /**
   * @return a uncached reference to the parent folder.
   */
  protected FolderReference getFolderReference() {
    return getFolder() == null ? null : new FolderReference(getFolder().getId());
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.model.reference.FolderReference

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.