view.mailBoxView
Class MailBoxView

java.lang.Object
  extended by view.mailBoxView.MailBoxView
All Implemented Interfaces:
View

public class MailBoxView
extends java.lang.Object
implements View

The MailBoxView is a pluggable view for the RSS Reader that is visually similar to an e-mail client.

Author:
pgroudas

Field Summary
private  AddToOutbox addToOutbox
           
private  org.eclipse.swt.browser.Browser browser
           
private  Controller control
           
private  DeleteFolderAction deleteFolderAction
           
private  DeliciousAction deliciousAction
           
private  DiggAction diggAction
           
private  EmptyTrashAction emptyTrashAction
           
private  ExportOutboxAction exportOutboxAction
           
private  FeedPropertiesAction feedPropertiesAction
           
private  MarkNewAction markNewAction
           
private  MarkReadAction markReadAction
           
private  Feed mostRecentFeed
           
private  NewArticleAction newArticleAction
           
private  NewFolderAction newFolderAction
           
private  SubscribeAction subscribeAction
           
private  org.eclipse.jface.viewers.TableViewer tableViewer
           
private  TrashAction trashAction
           
private  org.eclipse.jface.viewers.TreeViewer treeViewer
           
private  UnSubscribeFeedAction unSubscribeAction
           
private  UnTrashAction unTrashAction
           
private  UpdateFeedAction updateFeedAction
           
 
Constructor Summary
MailBoxView(Controller c)
          Constructs a new MailBoxView.
 
Method Summary
 org.eclipse.swt.widgets.Composite getComposite(org.eclipse.swt.widgets.Composite parent)
          Creates and returns the composite of the view.
 Folder getParentOfSelected()
          gets the parent folder of the selected item in the tree.
 Article getSelectedArticle()
          gets the currently selected article in the view.
 java.util.List<Article> getSelectedArticles()
          Returns a list of all selected articles
 Feed getSelectedFeed()
          Gets the currently selected feed in the view.
 java.util.List<Feed> getSelectedFeeds()
          Returns a list of the selected feeds
 Folder getSelectedFolder()
          Gets the currently selected folder in the view.
 java.util.List<Folder> getSelectedFolders()
          Gets selected folders.
 void setURL(java.lang.String url)
          Sets the url of the browser.
 void update()
          The update method is called when the Controller wants the view to refresh.
 void updateArticle(Article a)
          Updates the view of a particular article in the table
 void updateArticles(Feed f)
          Updates the view of the articles of the specified feed.
 void updateFeed(Feed f)
          updates the view of a feed in the tree.
 void updateFolderContents(Folder f)
          Updates the view of the children of the specified folder.
 void updateOutbox()
          Updates the view of the outbox in the tree
private  void updateTable()
          Updates the table
 void updateTrash()
          Updates the view of the trash in the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

control

private Controller control

treeViewer

private org.eclipse.jface.viewers.TreeViewer treeViewer

tableViewer

private org.eclipse.jface.viewers.TableViewer tableViewer

browser

private org.eclipse.swt.browser.Browser browser

subscribeAction

private SubscribeAction subscribeAction

unSubscribeAction

private UnSubscribeFeedAction unSubscribeAction

deleteFolderAction

private DeleteFolderAction deleteFolderAction

emptyTrashAction

private EmptyTrashAction emptyTrashAction

newFolderAction

private NewFolderAction newFolderAction

updateFeedAction

private UpdateFeedAction updateFeedAction

markReadAction

private MarkReadAction markReadAction

markNewAction

private MarkNewAction markNewAction

addToOutbox

private AddToOutbox addToOutbox

trashAction

private TrashAction trashAction

unTrashAction

private UnTrashAction unTrashAction

diggAction

private DiggAction diggAction

deliciousAction

private DeliciousAction deliciousAction

newArticleAction

private NewArticleAction newArticleAction

feedPropertiesAction

private FeedPropertiesAction feedPropertiesAction

exportOutboxAction

private ExportOutboxAction exportOutboxAction

mostRecentFeed

private Feed mostRecentFeed
Constructor Detail

MailBoxView

public MailBoxView(Controller c)
Constructs a new MailBoxView.

Parameters:
c - Controller to be associated with this view.
Method Detail

getComposite

public org.eclipse.swt.widgets.Composite getComposite(org.eclipse.swt.widgets.Composite parent)
Creates and returns the composite of the view.

Specified by:
getComposite in interface View
Parameters:
parent - Composite
Returns:
Composite

update

public void update()
The update method is called when the Controller wants the view to refresh. Refreshes the current view entirely;

Specified by:
update in interface View

updateTable

private void updateTable()
Updates the table


getSelectedFeed

public Feed getSelectedFeed()
                     throws NoItemSelectedException
Gets the currently selected feed in the view. If no feed is selected, gets the most recent feed that was selected. If no feed has ever been selected, then throw an exception.

Specified by:
getSelectedFeed in interface View
Returns:
Feed selected feed.
Throws:
NoItemSelectedException - If no feed is currently selected.

getSelectedArticle

public Article getSelectedArticle()
                           throws NoItemSelectedException
gets the currently selected article in the view.

Specified by:
getSelectedArticle in interface View
Returns:
Article selected article.
Throws:
NoItemSelectedException - If no article is currently selected.

getSelectedFolder

public Folder getSelectedFolder()
                         throws NoItemSelectedException
Gets the currently selected folder in the view. If no folder is selected, gets the folder that is the parent of the first selected item. If nothing is selected, then throws an exception.

Specified by:
getSelectedFolder in interface View
Returns:
Folder selected folder.
Throws:
NoItemSelectedException - If no folder is currently selected.

getSelectedArticles

public java.util.List<Article> getSelectedArticles()
                                            throws NoItemSelectedException
Returns a list of all selected articles

Specified by:
getSelectedArticles in interface View
Returns:
List of articles that are selected
Throws:
NoItemSelectedException - if no articles are selected

getSelectedFeeds

public java.util.List<Feed> getSelectedFeeds()
                                      throws NoItemSelectedException
Returns a list of the selected feeds

Specified by:
getSelectedFeeds in interface View
Returns:
List of feeds that are selected
Throws:
NoItemSelectedException - if no feeds are selected

getSelectedFolders

public java.util.List<Folder> getSelectedFolders()
                                          throws NoItemSelectedException
Gets selected folders. Not implemented in this view

Specified by:
getSelectedFolders in interface View
Returns:
List of Folders selected folders
Throws:
NoItemSelectedException

getParentOfSelected

public Folder getParentOfSelected()
                           throws NoItemSelectedException
gets the parent folder of the selected item in the tree.

Specified by:
getParentOfSelected in interface View
Returns:
Folder
Throws:
NoItemSelectedException - if no item in the tree is selected, of if the selected item has no parent (Subcribed Feeds folder, outbox or trash)

updateArticles

public void updateArticles(Feed f)
Updates the view of the articles of the specified feed.

Specified by:
updateArticles in interface View
Parameters:
f - Feed

updateFolderContents

public void updateFolderContents(Folder f)
Updates the view of the children of the specified folder.

Specified by:
updateFolderContents in interface View
Parameters:
f - Folder parent

updateOutbox

public void updateOutbox()
Updates the view of the outbox in the tree

Specified by:
updateOutbox in interface View

updateTrash

public void updateTrash()
Updates the view of the trash in the tree

Specified by:
updateTrash in interface View

updateArticle

public void updateArticle(Article a)
Updates the view of a particular article in the table

Specified by:
updateArticle in interface View
Parameters:
a - Article

updateFeed

public void updateFeed(Feed f)
updates the view of a feed in the tree.

Specified by:
updateFeed in interface View
Parameters:
f - Feed

setURL

public void setURL(java.lang.String url)
Sets the url of the browser.

Specified by:
setURL in interface View
Parameters:
url - String