Package org.rssowl.core.model.events

Examples of org.rssowl.core.model.events.CategoryEvent


    CategoryListener categoryListener = null;
    try {
      categoryListener = new CategoryAdapter() {
        @Override
        public void categoryAdded(Set<CategoryEvent> events) {
          CategoryEvent event = events.iterator().next();
          try {
            categoryAddedCalled[0] = true;
            Category dbCategory = (Category) event.getEntity();
            initialCategory[0].setId(dbCategory.getId());
            assertTrue(initialCategory[0].isIdentical(dbCategory));
            dbCategory.setDomain("newDomain/newDomain");
            updatedCategory[0] = dbCategory;
            fModelDAO.saveCategory(dbCategory);
          } catch (PersistenceException e) {
            fail(e.getMessage());
          }
        }

        @Override
        public void categoryUpdated(Set<CategoryEvent> events) {
          CategoryEvent event = events.iterator().next();
          categoryUpdatedCalled[0] = true;
          Category dbCategory = (Category) event.getEntity();
          assertTrue(updatedCategory[0].isIdentical(dbCategory));
        }
      };
      NewsModel.getDefault().addCategoryListener(categoryListener);
      fModelDAO.saveCategory(initialCategory[0]);
View Full Code Here


  /*
   * @see org.rssowl.core.model.dao.IModelDAO#deleteCategory(org.rssowl.core.model.reference.CategoryReference)
   */
  public final void deleteCategory(CategoryReference reference) throws PersistenceException {
    ICategory category = loadCategory(reference.getId());
    CategoryEvent event = new CategoryEvent(category, true);
    deleteEntityAndFireEvents(event);
  }
View Full Code Here

  /*
   * @see org.rssowl.core.model.dao.IModelDAO#saveCategory(org.rssowl.core.model.types.ICategory)
   */
  public ICategory saveCategory(ICategory category) throws PersistenceException {
    ModelEvent event = new CategoryEvent(category, true);
    saveCommitAndFireEvents(event, false);
    return category;
  }
View Full Code Here

      IAttachment attachment = (IAttachment) entity;
      modelEvent = new AttachmentEvent(attachment, root);
    }
    else if (entity instanceof ICategory) {
      ICategory category = (ICategory) entity;
      modelEvent = new CategoryEvent(category, root);
    }
    else if (entity instanceof IFeed) {
      IFeed feed = (IFeed) entity;
      modelEvent = new FeedEvent(feed, root);
    }
View Full Code Here

TOP

Related Classes of org.rssowl.core.model.events.CategoryEvent

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.