Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IMark


    EntityGroup gNever = new EntityGroup(Group.NEVER.ordinal(), GROUP_CATEGORY_ID, Group.NEVER.getName());

    /* Group Input */
    for (Object object : input) {
      if (object instanceof IMark) {
        IMark mark = (IMark) object;
        Date lastVisitDate = mark.getLastVisitDate();

        /* Feed was never visited */
        if (lastVisitDate == null)
          new EntityGroupItem(gNever, mark);

View Full Code Here


    /* Get the Max. Popularity */
    float maxPopularity = -1;
    for (Object object : input) {
      if (object instanceof IMark) {
        IMark bookmark = (IMark) object;
        maxPopularity = Math.max(maxPopularity, bookmark.getPopularity());
      }
    }

    /* Group Input */
    for (Object object : input) {
      if (object instanceof IMark) {
        IMark bookmark = (IMark) object;

        float popularity = bookmark.getPopularity();
        float ratio = maxPopularity > 0 ? popularity / maxPopularity : 0;

        /* Feed is Very Popular */
        if (ratio >= VERY_POPULAR_RATIO)
          new EntityGroupItem(gVeryPopular, bookmark);
View Full Code Here

    JobRunner.runInBackgroundThread(new Runnable() {
      public void run() {
        if (fInput == null)
          return;

        IMark mark = fInput.getMark();

        /* Trigger a reload if this is the first time open */
        if (mark instanceof IBookMark) {
          IBookMark bookmark = (IBookMark) mark;
          if ((bookmark.getLastVisitDate() == null && !fContentProvider.hasCachedNews()))
            new ReloadTypesAction(new StructuredSelection(mark), getEditorSite().getShell()).run();
        }

        /* Update some fields due to displaying the mark */
        mark.setPopularity(mark.getPopularity() + 1);
        mark.setLastVisitDate(new Date(System.currentTimeMillis()));

        DynamicDAO.save(mark);
      }
    });
  }
View Full Code Here

        return folder.getParent();
      }

      /* Parent Folder of Mark */
      else if (element instanceof IMark) {
        IMark mark = (IMark) element;
        return mark.getParent();
      }
    }

    return null;
  }
View Full Code Here

          return false;
      }

      /* Dragged Mark */
      else if (draggedObject instanceof IMark) {
        IMark draggedMark = (IMark) draggedObject;
        if (ModelUtils.hasChildRelation(dropFolder, draggedMark))
          return false;
      }
    }

View Full Code Here

    /* Open Editors for the given Selection */
    for (int i = 0; i < list.size() && openedEditors < maxOpenEditors; i++) {
      Object object = list.get(i);
      if (object instanceof IMark) {
        IMark mark = ((IMark) object);
        try {
          fViewSite.getPage().openEditor(new FeedViewInput(mark), FeedView.ID, activateEditor);
          openedEditors++;
        } catch (PartInitException e) {
          Activator.getDefault().getLog().log(e.getStatus());
View Full Code Here

    newMenu.add(new Action("Bookmark") {
      @Override
      public void run() {
        IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
        IFolder parent = getParent(selection);
        IMark position = (IMark) ((selection.getFirstElement() instanceof IMark) ? selection.getFirstElement() : null);
        new NewBookMarkAction(fViewSite.getShell(), parent, position).run(null);
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        return OwlUI.BOOKMARK;
      }
    });

    /* New Saved Search */
    newMenu.add(new Action("Saved Search") {
      @Override
      public void run() {
        IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
        IFolder parent = getParent(selection);
        IMark position = (IMark) ((selection.getFirstElement() instanceof IMark) ? selection.getFirstElement() : null);
        new NewSearchMarkAction(fViewSite.getShell(), parent, position).run(null);
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        return OwlUI.SEARCHMARK;
      }
    });

    /* New Folder */
    newMenu.add(new Separator());
    newMenu.add(new Action("Folder") {
      @Override
      public void run() {
        IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
        IFolder parent = getParent(selection);
        IMark position = (IMark) ((selection.getFirstElement() instanceof IMark) ? selection.getFirstElement() : null);
        new NewFolderAction(fViewSite.getShell(), parent, position).run(null);
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
View Full Code Here

    return false;
  }

  private void performNavigation(ITreeNode targetNode, boolean newsScoped, boolean unread) {
    IMark mark = (IMark) targetNode.getData();

    /* Set Selection to Mark */
    ISelection selection = new StructuredSelection(mark);
    fViewer.setSelection(selection);

View Full Code Here

          return false;
      }

      /* Dragged Mark */
      else if (draggedObject instanceof IMark) {
        IMark draggedMark = (IMark) draggedObject;
        if (ModelUtils.hasChildRelation(dropFolder, draggedMark))
          return false;
      }
    }

View Full Code Here

        }
        FolderEvent eventTemplate = new FolderEvent(folder, oldParent, true);
        folderEvents.add(eventTemplate);
        DBHelper.putEventTemplate(eventTemplate);
      } else if (child instanceof IMark) {
        IMark mark = (IMark) child;
        synchronized (mark) {
          removeChildFromFolder(mark);
          addMarkToFolder(newParent, mark, newPosition, reparentInfo.isAfter());
          if (newPosition != null) {
            List<IMark> markList = Collections.singletonList(mark);
View Full Code Here

TOP

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

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.