view.fightView
Class FightView

java.lang.Object
  extended by view.fightView.FightView
All Implemented Interfaces:
View

public class FightView
extends java.lang.Object
implements View

The Fight is a pluggable view for the RSS Reader that allows the user to get a 'google fights' illustration of how many hits there are for two search terms in their articles.

Author:
pgroudas

Field Summary
private  org.eclipse.swt.browser.Browser browser
           
private  Controller control
           
private  DeleteFolderAction deleteFolderAction
           
private  EmptyTrashAction emptyTrashAction
           
private  ExportOutboxAction exportOutboxAction
           
private  FeedPropertiesAction feedPropertiesAction
           
private  org.eclipse.swt.widgets.Label label
           
private  Feed mostRecentFeed
           
private  NewArticleAction newArticleAction
           
private  NewFolderAction newFolderAction
           
private  org.eclipse.swt.widgets.Text searchText
           
private  org.eclipse.swt.widgets.Text searchText2
           
private  SubscribeAction subscribeAction
           
private  org.eclipse.jface.viewers.TreeViewer treeViewer
           
private  UnSubscribeFeedAction unSubscribeAction
           
private  UpdateFeedAction updateFeedAction
           
 
Constructor Summary
FightView(Controller c)
          Constructs a new FightView.
 
Method Summary
private  void fight()
          Executes to start fight animation.
 org.eclipse.swt.widgets.Composite getComposite(org.eclipse.swt.widgets.Composite parent)
          Creates and returns the composite of the view.
private  org.eclipse.swt.widgets.Composite getFightPane(org.eclipse.swt.widgets.Composite parent)
           
 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()
          Gets 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.
 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
 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

browser

private org.eclipse.swt.browser.Browser browser

searchText2

private org.eclipse.swt.widgets.Text searchText2

searchText

private org.eclipse.swt.widgets.Text searchText

label

private org.eclipse.swt.widgets.Label label

subscribeAction

private SubscribeAction subscribeAction

unSubscribeAction

private UnSubscribeFeedAction unSubscribeAction

deleteFolderAction

private DeleteFolderAction deleteFolderAction

emptyTrashAction

private EmptyTrashAction emptyTrashAction

newFolderAction

private NewFolderAction newFolderAction

updateFeedAction

private UpdateFeedAction updateFeedAction

newArticleAction

private NewArticleAction newArticleAction

feedPropertiesAction

private FeedPropertiesAction feedPropertiesAction

exportOutboxAction

private ExportOutboxAction exportOutboxAction

mostRecentFeed

private Feed mostRecentFeed
Constructor Detail

FightView

public FightView(Controller c)
Constructs a new FightView.

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

getFightPane

private org.eclipse.swt.widgets.Composite getFightPane(org.eclipse.swt.widgets.Composite parent)

update

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

Specified by:
update in interface View

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. Not implemented for this view.

Specified by:
getSelectedArticle in interface View
Returns:
Article selected article.
Throws:
NoItemSelectedException - always

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
Gets all selected articles. Not implemented for this view. Always throws NoItemSelectedException

Specified by:
getSelectedArticles in interface View
Returns:
List of Articles selected articles
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. Not implemented in this view.

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. Not implemented in this view.

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

fight

private void fight()
Executes to start fight animation.