Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IMark


        DBHelper.putEventTemplate(eventTemplate);
      }

      /* Mark */
      else if (child instanceof IMark) {
        IMark mark = (IMark) child;
        MarkEvent markEvent;
        synchronized (mark) {
          removeChildFromFolder(mark);
          addMarkToFolder(newParent, mark, newPosition, reparentInfo.isAfter());
          if (newPosition != null) {
View Full Code Here


          eventsCounter[0]++;
        }
      };
      DynamicDAO.addEntityListener(IBookMark.class, bookmarkListener);

      IMark mark = folder.getMarks().get(0);

      IPreferenceScope bookmarkScope = Owl.getPreferenceService().getEntityScope(mark);
      bookmarkScope.putString("key10", "value1");
      bookmarkScope.flush();
View Full Code Here

    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

        if (element instanceof IFolderChild)
          selectedFolderChild = (IFolderChild) element;
      }

      IFolder folder = (IFolder) ((selectedFolderChild instanceof IFolder) ? selectedFolderChild : null);
      IMark position = null;
      if (folder == null && selectedFolderChild != null && selectedFolderChild instanceof IMark) {
        folder = selectedFolderChild.getParent();
        position = (IMark) selectedFolderChild;
      }
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

          Set<Entry<IMark, IFolder>> entries = reparentedMarks.entrySet();
          Set<IFolder> parentsToUpdate = new HashSet<IFolder>();
          try {
            fViewer.getControl().getParent().setRedraw(false);
            for (Entry<IMark, IFolder> entry : entries) {
              IMark reparentedMark = entry.getKey();
              IFolder oldParent = entry.getValue();

              /* Reparent while keeping the Selection */
              ISelection selection = fViewer.getSelection();
              fViewer.remove(oldParent, new Object[] { reparentedMark });
              fViewer.refresh(reparentedMark.getParent(), false);
              fViewer.setSelection(selection);

              /* Remember to update parents */
              parentsToUpdate.add(oldParent);
              parentsToUpdate.add(reparentedMark.getParent());
            }
          } finally {
            fViewer.getControl().getParent().setRedraw(true);
          }

View Full Code Here

        Action newBookmarkAction = new Action(Messages.BookMarkExplorer_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;
          }
        };
        newBookmarkAction.setId("org.rssowl.ui.actions.NewBookMark"); //$NON-NLS-1$
        newBookmarkAction.setActionDefinitionId("org.rssowl.ui.actions.NewBookMark"); //$NON-NLS-1$
        newMenu.add(newBookmarkAction);

        /* New NewsBin */
        Action newNewsBinAction = new Action(Messages.BookMarkExplorer_NEWSBIN) {
          @Override
          public void run() {
            IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
            IFolder parent = getParent(selection);
            IMark position = (IMark) ((selection.getFirstElement() instanceof IMark) ? selection.getFirstElement() : null);
            new NewNewsBinAction(fViewSite.getShell(), parent, position).run(null);
          }

          @Override
          public ImageDescriptor getImageDescriptor() {
            return OwlUI.NEWSBIN;
          }
        };
        newNewsBinAction.setId("org.rssowl.ui.actions.NewNewsBin"); //$NON-NLS-1$
        newNewsBinAction.setActionDefinitionId("org.rssowl.ui.actions.NewNewsBin"); //$NON-NLS-1$
        newMenu.add(newNewsBinAction);

        /* New Saved Search */
        Action newSavedSearchAction = new Action(Messages.BookMarkExplorer_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;
          }
        };
        newSavedSearchAction.setId("org.rssowl.ui.actions.NewSearchMark"); //$NON-NLS-1$
        newSavedSearchAction.setActionDefinitionId("org.rssowl.ui.actions.NewSearchMark"); //$NON-NLS-1$
        newMenu.add(newSavedSearchAction);

        /* New Folder */
        newMenu.add(new Separator());
        Action newFolderAction = new Action(Messages.BookMarkExplorer_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;
      }

      /* Dragged Mark */
      else if (draggedObject instanceof IMark) {
        IMark draggedMark = (IMark) draggedObject;
        if (!isValidDrop(draggedMark, dropTarget))
          return false;
      }

      /* Dragged News */
 
View Full Code Here

      }
    }

    /* Do not allow Re-Ordering over IMarks (when sorting or grouping) */
    if ((fExplorer.isSortByNameEnabled() || fExplorer.isGroupingEnabled()) && dropTarget instanceof IMark) {
      IMark target = (IMark) dropTarget;
      if (target.getParent().containsChild(dragSource))
        return false;
    }

    /* Do not allow dropping in Child of Drag-Folder */
    if (CoreUtils.hasChildRelation(dragSource, dropTarget))
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.