Package org.rssowl.ui.internal

Examples of org.rssowl.ui.internal.FolderNewsMark


    DynamicDAO.save(feed);

    Owl.getModelFactory().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()));

    assertEquals(2, mark.getNews().size());
    assertEquals(2, mark.getNews(EnumSet.of(INews.State.NEW, INews.State.READ)).size());
    assertEquals(1, mark.getNews(EnumSet.of(INews.State.NEW)).size());
    assertEquals(1, mark.getNews(EnumSet.of(INews.State.READ)).size());
    assertEquals(2, mark.getNewsCount(EnumSet.of(INews.State.NEW, INews.State.READ)));
    assertEquals(1, mark.getNewsCount(EnumSet.of(INews.State.NEW)));
    assertEquals(1, mark.getNewsCount(EnumSet.of(INews.State.READ)));
  }
View Full Code Here


      public void run() {
        if (!(fInput.getMark() instanceof FolderNewsMark))
          return;

        final IEditorPart activeFeedView = fEditorSite.getPage().getActiveEditor();
        FolderNewsMark folderNewsMark = (FolderNewsMark) (fInput.getMark());
        for (FolderEvent event : events) {
          final IFolder folder = event.getEntity();
          if (folder.equals(folderNewsMark.getFolder())) {
            setPartName(folder.getName());
            if (activeFeedView == FeedView.this)
              OwlUI.updateWindowTitle(new IMark[] { fInput.getMark() });

            break;
View Full Code Here

  private void onFoldersDeleted(Set<FolderEvent> events) {
    if (!(fInput.getMark() instanceof FolderNewsMark))
      return;

    FolderNewsMark folderNewsMark = (FolderNewsMark) (fInput.getMark());
    for (FolderEvent event : events) {
      final IFolder folder = event.getEntity();
      if (folder.equals(folderNewsMark.getFolder())) {
        fInput.setDeleted();
        JobRunner.runInUIThread(fParent, new Runnable() {
          public void run() {
            fEditorSite.getPage().closeEditor(FeedView.this, false);
          }
View Full Code Here

      public void run() {
        if (!(fInput.getMark() instanceof FolderNewsMark))
          return;

        final IEditorPart activeFeedView = fEditorSite.getPage().getActiveEditor();
        FolderNewsMark folderNewsMark = (FolderNewsMark) (fInput.getMark());
        for (FolderEvent event : events) {
          final IFolder folder = event.getEntity();
          if (folder.equals(folderNewsMark.getFolder())) {
            setPartName(folder.getName());
            if (activeFeedView == FeedView.this)
              OwlUI.updateWindowTitle(fInput.getMark());

            break;
View Full Code Here

  private void onFoldersDeleted(Set<FolderEvent> events) {
    if (!(fInput.getMark() instanceof FolderNewsMark))
      return;

    FolderNewsMark folderNewsMark = (FolderNewsMark) (fInput.getMark());
    for (FolderEvent event : events) {
      final IFolder folder = event.getEntity();
      if (folder.equals(folderNewsMark.getFolder())) {
        fInput.setDeleted();
        JobRunner.runInUIThread(fParent, new Runnable() {
          public void run() {
            fEditorSite.getPage().closeEditor(FeedView.this, false);
          }
View Full Code Here

    if (fInput == null)
      return;

    /* Folder News Mark might require cache refresh if sorting has changed and limit reached */
    if (fInput.getMark() instanceof FolderNewsMark && fInput.getMark().getNewsCount(INews.State.getVisible()) > NewsContentProvider.MAX_FOLDER_ELEMENTS) {
      FolderNewsMark folderMark = (FolderNewsMark) fInput.getMark();
      IPreferenceScope preferences = Owl.getPreferenceService().getEntityScope(folderMark.getFolder());
      NewsComparator comparator = getComparator();

      NewsColumn oldSortBy = comparator.getSortBy();
      boolean oldIsAscending = comparator.isAscending();

View Full Code Here

      }
    }

    /* Update Folder News Mark from Events (we only add news, never remove) */
    else if (fInput instanceof FolderNewsMark) {
      FolderNewsMark folderNewsMark = (FolderNewsMark) fInput;
      Set<Long> newsIds = extractNewsIds(eventsRelatedToInput);
      for (Long newsId : newsIds) {

        /* Skip already cached news */
        if (hasCachedNews(newsId) || folderNewsMark.containsNews(newsId))
          continue;

        /* Resolve News */
        INews news = fNewsDao.load(newsId);
        if (news != null && news.isVisible())
View Full Code Here

          }

          /* Resolve news counts from folder */
          else if (entity instanceof IFolder) {
            IFolder folder = (IFolder) entity;
            FolderNewsMark resolver = new FolderNewsMark(folder);

            NewsContainer newsContainer = resolver.resolveNewsContainer(monitor);
            totalCount = newsContainer.getNewsCount(INews.State.getVisible());
            newCount = newsContainer.getNewsCount(EnumSet.of(INews.State.NEW));
            unreadCount = newsContainer.getNewsCount(EnumSet.of(INews.State.UNREAD));
            updatedCount = newsContainer.getNewsCount(EnumSet.of(INews.State.UPDATED));
          }
View Full Code Here

  /* Create in-memory Newsmark */
  private void aggregateFolder(final IFolder folder) {
    BusyIndicator.showWhile(PlatformUI.getWorkbench().getDisplay(), new Runnable() {
      public void run() {
        FolderNewsMark folderNewsMark = new FolderNewsMark(folder);
        StructuredSelection newSelection = new StructuredSelection(folderNewsMark);

        /* Open in Feedview */
        OwlUI.openInFeedView(fTargetPart.getSite().getPage(), newSelection);
      }
View Full Code Here

      /* Special Case Folders */
      if (FolderNewsMark.class.getName().equals(inputClass)) {
        IFolder folder = DynamicDAO.load(IFolder.class, Long.valueOf(inputId));
        if (folder != null)
          return new FeedViewInput(new FolderNewsMark(folder));
      }

      /* Normal NewsMark */
      else {
        try {
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.