Examples of IBookmark


Examples of org.rssowl.core.persist.IBookMark

      DynamicDAO.addEntityListener(IFeed.class, feedListener);

      /* Save Feed since a IBookMark now doesn't contain a feed */
      DynamicDAO.save(feed);

      final IBookMark bookMark1 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "Root BookMark");
      final IBookMark bookMark2 = fFactory.createBookMark(null, rootChild, new FeedLinkReference(feed.getLink()), "Root Child BookMark");
      final IBookMark bookMark3 = fFactory.createBookMark(null, rootChildChild1Child, new FeedLinkReference(feed.getLink()), "Root Child Child #1 BookMark");

      final boolean bookMarkEventsIssued[] = new boolean[3];

      bookMarkListener = new BookMarkAdapter() {
        @Override
        public void entitiesAdded(Set<BookMarkEvent> events) {
          for (BookMarkEvent event : events) {
            assertFalse("Expected this Event to be no Root Event", event.isRoot());

            IBookMark bookMark = event.getEntity();

            if ("Root BookMark".equals(bookMark.getName()))
              assertEquals("Root", bookMark.getParent().getName());
            else if ("Root Child BookMark".equals(bookMark.getName()))
              assertEquals("Root Child", bookMark.getParent().getName());
            else if ("Root Child Child #1 BookMark".equals(bookMark.getName()))
              assertEquals("Root Child Child #1 Child", bookMark.getParent().getName());

            if (bookMark.getName().equals(bookMark1.getName()))
              bookMarkEventsIssued[0] = true;

            else if (bookMark.getName().equals(bookMark2.getName()))
              bookMarkEventsIssued[1] = true;

            else if (bookMark.getName().equals(bookMark3.getName()))
              bookMarkEventsIssued[2] = true;
          }
        }
      };
      DynamicDAO.addEntityListener(IBookMark.class, bookMarkListener);
View Full Code Here

Examples of org.rssowl.core.persist.IBookMark

      feed = DynamicDAO.getDAO(IFeedDAO.class).save(feed);
    }

    /* Create the BookMark */
    FeedLinkReference feedLinkRef = new FeedLinkReference(uriObj);
    IBookMark bookmark = factory.createBookMark(null, parent, feedLinkRef, name);

    /* Copy all Properties from Parent into this Mark */
    Map<String, ?> properties = parent.getProperties();

    for (Map.Entry<String, ?> property : properties.entrySet())
      bookmark.setProperty(property.getKey(), property.getValue());

    parent = DynamicDAO.getDAO(IFolderDAO.class).save(parent);

    /* Auto-Reload added BookMark */
    for (IMark mark : parent.getMarks()) {
View Full Code Here

Examples of org.rssowl.core.persist.IBookMark

   */
  @Override
  public String getToolTipText(Object element) {
    INews news = (INews) element;
    FeedLinkReference feedRef = news.getFeedReference();
    IBookMark bookMark = Controller.getDefault().getCacheService().getBookMark(feedRef);
    if (bookMark != null)
      return bookMark.getName();

    return null;
  }
View Full Code Here

Examples of org.rssowl.core.persist.IBookMark

      }

      /* Feed Column */
      else if (columnIndex == NewsTableControl.COL_FEED && !(fViewer.getInput() instanceof FeedLinkReference)) {
        FeedLinkReference feedRef = news.getFeedReference();
        IBookMark bookMark = Controller.getDefault().getCacheService().getBookMark(feedRef);
        if (bookMark != null) {
          ImageDescriptor favicon = OwlUI.getFavicon(bookMark);
          return OwlUI.getImage(fResources, favicon != null ? favicon : OwlUI.BOOKMARK);
        }
      }
View Full Code Here

Examples of org.rssowl.core.persist.IBookMark

  private boolean isInputRelatedTo(INews news, EventType type) {
    for (IMark mark : fInput) {

      /* Check if BookMark references the News' Feed */
      if (mark instanceof IBookMark) {
        IBookMark bookmark = (IBookMark) mark;
        if (bookmark.getFeedLinkReference().equals(news.getFeedReference()))
          return true;
      }

      /* TODO This is a workaround! */
      else if (type != EventType.PERSIST && mark instanceof ISearchMark) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.