Package org.rssowl.ui.internal

Examples of org.rssowl.ui.internal.EntityGroup


      }
    }

    /* EntityGroup Image */
    else if (element instanceof EntityGroup && columnIndex == NewsTableControl.COL_TITLE) {
      EntityGroup group = (EntityGroup) element;
      if (group.getImage() != null)
        return OwlUI.getImage(fResources, group.getImage());

      return fGroupIcon;
    }

    return null;
View Full Code Here


        }
      }

      /* This is a EntityGroup */
      else if (object instanceof EntityGroup) {
        EntityGroup group = (EntityGroup) object;

        List<EntityGroupItem> items = group.getItems();
        for (EntityGroupItem item : items) {
          if (((INews) item.getEntity()).isVisible())
            elements.add(item.getEntity());
        }
      }
View Full Code Here

  void restoreExpandedElements() {
    for (Long expandedNodeId : fExpandedNodes) {
      if (fBookMarkGrouping.getType() == BookMarkGrouping.Type.NO_GROUPING)
        fViewer.setExpandedState(new FolderReference(expandedNodeId), true);
      else
        fViewer.setExpandedState(new EntityGroup(expandedNodeId, BookMarkGrouping.GROUP_CATEGORY_ID), true);
    }
  }
View Full Code Here

            selectedBookMarks.add(relatedBookmarks.iterator().next());
        }
      }

      else if (selection instanceof EntityGroup) {
        EntityGroup group = (EntityGroup) selection;
        List<EntityGroupItem> items = group.getItems();
        for (EntityGroupItem item : items) {
          IEntity entity = item.getEntity();
          if (entity instanceof IBookMark) {
            IBookMark bookMark = (IBookMark) entity;
            selectedBookMarks.add(bookMark);
View Full Code Here

        normalizedNews.add((INews) object);
      }

      /* Group */
      else if (object instanceof EntityGroup) {
        EntityGroup group = (EntityGroup) object;
        if (NewsGrouping.GROUP_CATEGORY_ID.equals(group.getCategory())) {
          List<IEntity> entities = group.getEntities();
          for (IEntity entity : entities) {
            if (!normalizedNews.contains(entity))
              normalizedNews.add((INews) entity);
          }
        }
View Full Code Here

        cell.setImage(getIconForNewsBin((INewsBin) newsmark, hasNew, unreadNewsCount));
    }

    /* Create Label for EntityGroup */
    else if (element instanceof EntityGroup) {
      EntityGroup group = (EntityGroup) element;

      /* Text */
      cell.setText(group.getName());

      /* Image */
      cell.setImage(fGroupIcon);

      /* Foreground */
 
View Full Code Here

    List<?> elements = fSelection.toList();
    for (Object element : elements) {
      if (element instanceof INews)
        return true;
      else if (element instanceof EntityGroup) {
        EntityGroup group = (EntityGroup) element;
        if (NewsGrouping.GROUP_CATEGORY_ID.equals(group.getCategory()))
          return true;
      }
    }

    /* Create Dialog and open if confirmation required */
 
View Full Code Here

        str.append(folderchild.getName()).append("\n"); //$NON-NLS-1$
      }

      /* Entity Group */
      else if (selectedObject instanceof EntityGroup) {
        EntityGroup entitygroup = (EntityGroup) selectedObject;
        str.append(entitygroup.getName()).append("\n"); //$NON-NLS-1$
      }
    }

    if (str.length() > 0)
      event.data = str.toString();
View Full Code Here

        return isValidDrop(draggedNews, dropTarget);
      }

      /* Dragged Entity Group of News */
      else if (draggedObject instanceof EntityGroup) {
        EntityGroup group = (EntityGroup) draggedObject;
        return isValidDrop(group, dropTarget);
      }
    }

    return true;
View Full Code Here

  }

  private List<EntityGroup> createTopicGroups(Collection<INews> input) {

    /* Default Group */
    EntityGroup gDefault = new EntityGroup(Group.NO_TOPIC.ordinal(), GROUP_CATEGORY_ID, Group.NO_TOPIC.getName());

    Map<String, EntityGroup> groupCache = new HashMap<String, EntityGroup>();
    groupCache.put(Group.NO_TOPIC.getName(), gDefault);

    /* Group Input */
    int nextId = Group.NO_TOPIC.ordinal() + TITLE_ID_BEGIN;
    for (Object object : input) {
      if (object instanceof INews) {
        INews news = (INews) object;
        EntityGroup group = gDefault;

        /* Normalize Title */
        String normalizedTitle = CoreUtils.getHeadline(news, true);
        normalizedTitle = CoreUtils.normalizeTitle(normalizedTitle);

        /* Determine Group ID */
        String groupId;
        if (StringUtils.isSet(news.getInReplyTo()))
          groupId = news.getInReplyTo();
        else
          groupId = normalizedTitle;

        /* Add or Create Group */
        if (StringUtils.isSet(groupId)) {
          group = groupCache.get(groupId);

          /* Create new Group */
          if (group == null) {
            group = new EntityGroup(nextId++, GROUP_CATEGORY_ID, normalizedTitle);
            groupCache.put(groupId, group);
          }
        }

        /* Add to Group */
 
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.EntityGroup

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.