private IFolder getSameParent(List<IEntity> entities) {
    IFolder parent = null;

    for (IEntity entity : entities) {
      if (!(entity instanceof IFolderChild)) return null;

      IFolderChild folderChild = (IFolderChild) entity;
      IFolder folder = folderChild.getParent();
      if (parent == null) parent = folder;
      else if (parent != folder) return null;
    }

    return parent;
  }
Example #2
0
  private boolean wordMatches(IFolderChild node) {

    /* Return early if node is a Bookmark-Set */
    if (node.getParent() == null) return false;

    /* Search Name */
    if (fSearchTarget == SearchTarget.NAME) return wordMatches(node.getName());

    /* Search Link */
    if (fSearchTarget == SearchTarget.LINK && node instanceof IBookMark)
      return wordMatches(((IBookMark) node).getFeedLinkReference().getLinkAsText());

    return false;
  }