Package org.rssowl.ui.internal.undo

Examples of org.rssowl.ui.internal.undo.NewsStateOperation


    UndoStack.getInstance().addOperation(new StickyOperation(Collections.singletonList(news), true));
    news.setFlagged(true);
    DynamicDAO.save(news);

    for (int i = 0; i < 20; i++) {
      UndoStack.getInstance().addOperation(new NewsStateOperation(Collections.singletonList(news), i % 2 == 0 ? INews.State.UNREAD : INews.State.READ, false));
      DynamicDAO.getDAO(INewsDAO.class).setState(Collections.singletonList(news), i % 2 == 0 ? INews.State.UNREAD : INews.State.READ, false, false);
    }

    int undos = 0;
    while (UndoStack.getInstance().isUndoSupported()) {
View Full Code Here


        Set<INews> singleNewsSet = Collections.singleton(news);
        boolean affectEquivalentNews = (state != INews.State.UNREAD && OwlUI.markReadDuplicates());

        /* Add to UndoStack */
        UndoStack.getInstance().addOperation(new NewsStateOperation(singleNewsSet, state, affectEquivalentNews));

        /* Perform Operation */
        fNewsDao.setState(singleNewsSet, state, affectEquivalentNews, false);
      }
    };
View Full Code Here

    /* Only affect equivalent News if not all News are affected */
    boolean affectEquivalentNews = OwlUI.markReadDuplicates() && !equalsRootFolders(folders);

    /* Support Undo */
    if (!news.isEmpty())
      UndoStack.getInstance().addOperation(new NewsStateOperation(news, INews.State.READ, affectEquivalentNews));

    /* Apply the state to the NewsItems for Retention to handle them properly */
    for (INews newsItem : news) {
      newsItem.setState(INews.State.READ);
    }
View Full Code Here

        /* Delete News in single Transaction */
        if (!newsToDelete.isEmpty()) {

          /* Support Undo */
          UndoStack.getInstance().addOperation(new NewsStateOperation(newsToDelete, INews.State.HIDDEN, false));

          /* Perform Operation */
          fNewsDAO.setState(newsToDelete, INews.State.HIDDEN, false, false);
        }
      }
View Full Code Here

      /* Only consider INews */
      List<INews> newsList = ModelUtils.getEntities(selection, INews.class);

      /* Support Undo */
      UndoStack.getInstance().addOperation(new NewsStateOperation(newsList, INews.State.UNREAD, false));

      /* Perform Operation */
      DynamicDAO.getDAO(INewsDAO.class).setState(newsList, INews.State.UNREAD, false, false);
    }
  }
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.undo.NewsStateOperation

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.