*
* @param e action event details object.
*/
public void actionPerformed(ActionEvent e)
{
GlobalController controller = GlobalController.SINGLETON;
ArticleListPanel articlesListPanel = controller.getMainFrame().getArticlesListPanel();
IFeedDisplay feedDisplay = articlesListPanel.getFeedView();
GlobalModel model = GlobalModel.SINGLETON;
IArticle selectedArticle = model.getSelectedArticle();
boolean articleWasSelected = feedDisplay.selectNextArticle(INavigationModes.MODE_UNREAD);
if (selectedArticle != null)
{
// Mark an article as read and update stats
GlobalController.readArticles(true,
model.getSelectedGuide(),
model.getSelectedFeed(),
selectedArticle);
// Focus traversal is asynchronous. During the next article selection
// it was moved to the next article, but when current article will be
// removed the focus will be forwarded away from the display. We need
// to get it back.
feedDisplay.focus();
}
if (!articleWasSelected)
{
IArticleListNavigationListener nav = controller.getNavigationListener();
nav.nextFeed(INavigationModes.MODE_UNREAD);
}
}