Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.ISearchMark


      }
    }

    /* Create Label for a SearchMark */
    else if (element instanceof ISearchMark) {
      ISearchMark searchmark = (ISearchMark) element;
      boolean hasMatchingNews = false;

      if (fIndicateState) {
        unreadNewsCount = searchmark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
        hasNew = searchmark.getResultCount(EnumSet.of(INews.State.NEW)) != 0;
        hasMatchingNews = unreadNewsCount > 0 || searchmark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED, INews.State.READ)) != 0;
      }

      /* Image */
      Image icon;
      if (hasNew)
        icon = fSearchMarkNewIcon;
      else if (hasMatchingNews || !fIndicateState)
        icon = fSearchMarkIcon;
      else
        icon = fSearchMarkEmptyIcon;

      cell.setImage(icon);

      /* Font */
      if (unreadNewsCount > 0)
        cell.setFont(fBoldFont);
      else
        cell.setFont(fDefaultFont);

      /* Text */
      StringBuilder str = new StringBuilder(searchmark.getName());
      if (unreadNewsCount > 0)
        str.append(" (").append(unreadNewsCount).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
      cell.setText(str.toString());

      /* Reset Foreground */
 
View Full Code Here


          count += getNewNewsCount(bookmark.getFeedLinkReference());
      }

      /* SearchMark */
      else if (child instanceof ISearchMark) {
        ISearchMark searchmark = (ISearchMark) child;

        if (unread)
          count += searchmark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED));
        else
          count += searchmark.getResultCount(EnumSet.of(INews.State.NEW));
      }

      /* Folder */
      else if (child instanceof IFolder)
        count += getNewsCount((IFolder) child, unread);
View Full Code Here

    }

    /* Filter Events based on other criterias otherwise */
    else {
      for (SearchMarkEvent event : events) {
        ISearchMark searchmark = event.getEntity();
        List<ISearchCondition> conditions = searchmark.getSearchConditions();

        /* Check for new *new* News matching now */
        if (!event.isAddedNewNews())
          continue;

View Full Code Here

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

    /* Today */
    IBookMark bookmark1 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "BookMark 1");
    bookmark1.setLastVisitDate(fToday);
    ISearchMark searchmark1 = fFactory.createSearchMark(null, root, "SearchMark 1");
    searchmark1.setLastVisitDate(fToday);

    /* Yesterday */
    IBookMark bookmark2 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "BookMark 2");
    bookmark2.setLastVisitDate(fYesterday);
    ISearchMark searchmark2 = fFactory.createSearchMark(null, root, "SearchMark 2");
    searchmark2.setLastVisitDate(fYesterday);

    /* Earlier this Week */
    IBookMark bookmark3 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "BookMark 3");
    bookmark3.setLastVisitDate(fEarlierThisWeek);
    ISearchMark searchmark3 = fFactory.createSearchMark(null, root, "SearchMark 3");
    searchmark3.setLastVisitDate(fEarlierThisWeek);

    /* Last Week */
    IBookMark bookmark4 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "BookMark 4");
    bookmark4.setLastVisitDate(fLastWeek);
    ISearchMark searchmark4 = fFactory.createSearchMark(null, root, "SearchMark 4");
    searchmark4.setLastVisitDate(fLastWeek);

    /* More than one Week ago */
    IBookMark bookmark5 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "BookMark 5");
    bookmark5.setLastVisitDate(new Date(0));

    /* Visited Never */
    ISearchMark searchmark5 = fFactory.createSearchMark(null, root, "SearchMark 5");

    /* Future */
    IBookMark bookmark6 = fFactory.createBookMark(null, root, new FeedLinkReference(feed.getLink()), "BookMark 6");
    bookmark6.setLastVisitDate(new Date(fToday.getTime() + 10000000));

View Full Code Here

    IBookMark bm1 = fFactory.createBookMark(null, root, new FeedLinkReference(feed1.getLink()), "FookMark 1");
    bm1.setErrorLoading(true);
    bm1.setPopularity(1);

    ISearchMark sm1 = fFactory.createSearchMark(null, root, "SearchMark 1");
    sm1.setPopularity(1);

    IBookMark bm2 = fFactory.createBookMark(null, root, new FeedLinkReference(feed2.getLink()), "BookMark 2");
    bm2.setPopularity(1);

    ISearchMark sm2 = fFactory.createSearchMark(null, root, "SearchMark 2");
    sm2.setPopularity(1);

    IBookMark bm3 = fFactory.createBookMark(null, root, new FeedLinkReference(feed1.getLink()), "BookMark 3");
    bm3.setPopularity(1);

    ISearchMark sm3 = fFactory.createSearchMark(null, root, "SearchMark 3");
    sm3.setPopularity(1);

    IBookMark bm4 = fFactory.createBookMark(null, root, new FeedLinkReference(feed2.getLink()), "BookMark 4");
    bm4.setPopularity(1);

    ISearchMark sm4 = fFactory.createSearchMark(null, root, "SearchMark 4");
    sm4.setPopularity(1);

    IBookMark bm5 = fFactory.createBookMark(null, root, new FeedLinkReference(feed1.getLink()), "BookMark 5");
    bm5.setPopularity(1);

    ISearchMark sm5 = fFactory.createSearchMark(null, root, "SearchMark 5");

    IBookMark bm6 = fFactory.createBookMark(null, root, new FeedLinkReference(feed2.getLink()), "BookMark 6");

    /* Fill into Array */
    Object elements[] = new Object[] { bm1, bm2, bm3, bm4, bm5, bm6, sm1, sm2, sm3, sm4, sm5 };
View Full Code Here

    /* Get selected Folder */
    fParent = fFolderChooser.getFolder();

    /* Create new Searchmark */
    ISearchMark searchMark = Owl.getModelFactory().createSearchMark(null, fParent, fNameInput.getText(), fPosition, fPosition != null ? true : null);
    searchMark.setMatchAllConditions(fMatchAllRadio.getSelection());

    /* Create Conditions and save in DB */
    fSearchConditionList.createConditions(searchMark);
    DynamicDAO.save(fParent);

View Full Code Here

        writer.write("<outline text=\"" + name + "\" xmlUrl=\"" + link + "\" />\n");
      }

      /* Export SearchMark */
      else if (mark instanceof ISearchMark) {
        ISearchMark searchMark = (ISearchMark) mark;
        List<ISearchCondition> conditions = searchMark.getSearchConditions();

        writer.write("<rssowl:savedsearch name=\"" + name + "\" matchAllConditions=\"" + searchMark.matchAllConditions() + "\">\n");
        for (ISearchCondition condition : conditions) {
          writer.write("\t<rssowl:searchcondition>\n");
          writer.write(toXML(condition));
          writer.write("\t</rssowl:searchcondition>\n");
        }
View Full Code Here

        return false;
    }

    /* Check if searchmark has unread if set as flag */
    else if (data instanceof ISearchMark) {
      ISearchMark searchmark = (ISearchMark) data;
      if (unread && searchmark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)) == 0)
        return false;
    }

    /* Folders are no valid navigation nodes */
    else if (data instanceof IFolder)
View Full Code Here

    else if (entity instanceof ISearchCondition)
      cascadeSearchConditionDeletion((ISearchCondition) entity);
  }

  private void cascadeSearchConditionDeletion(ISearchCondition searchCondition) {
    ISearchMark searchMark = getSearchMark(searchCondition);
    if (!itemsBeingDeletedContains(searchMark)) {
      if (searchMark.removeSearchCondition(searchCondition))
        fDb.ext().set(searchMark, 2);
    }
    fDb.delete(searchCondition.getField());
  }
View Full Code Here

      BookMarkEvent eventTemplate = (BookMarkEvent) template;
      IFolder oldParent = eventTemplate == null ? null : eventTemplate.getOldParent();
      modelEvent = new BookMarkEvent(mark, oldParent, root);
    }
    else if (entity instanceof ISearchMark) {
      ISearchMark mark = (ISearchMark) entity;
      SearchMarkEvent eventTemplate = (SearchMarkEvent) template;
      IFolder oldParent = eventTemplate == null ? null : eventTemplate.getOldParent();
      modelEvent = new SearchMarkEvent(mark, oldParent, root);
    }
    else if (entity instanceof IFolder) {
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.ISearchMark

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.