rss.views
Class QuickHTMLView

java.lang.Object
  extended by rss.views.QuickHTMLView
All Implemented Interfaces:
View

public class QuickHTMLView
extends java.lang.Object
implements View

Displays FeedItems from a given feed using generated HTML and an SWT Browswer widget. This View is unable to determine the "read" status of a given FeedItem and currently does not modify any FeedItem's read boolean.

This view only displays a FeedItem's:



KNOWN ISSUES: QuickHTMLView uses the SWT Browser Widget to display the generated HTML code. The Browser Widget strongly depends on the user environment to function properly. On Linux machines, the MOZILLA_FIVE_HOME environment variable must be set to the Mozilla lib directory for work correctly.

Author:
Karl E. Rieb

Constructor Summary
QuickHTMLView()
          Creates a new QuickHTMLView.
 
Method Summary
 Composite generateComposite(Composite parent, Feed feed, java.util.Collection<FeedItem> items)
          Called when the application wants to display the view.
 java.lang.String getName()
          Returns the name of the view.
static void printToHTML(java.lang.String htmlPath, Feed feed, java.util.Collection<FeedItem> items)
          Generates an HTML file that displays the given FeedItems with the Feed information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickHTMLView

public QuickHTMLView()
Creates a new QuickHTMLView. No methods or fields are set during a call to this constructor.

Method Detail

printToHTML

public static void printToHTML(java.lang.String htmlPath,
                               Feed feed,
                               java.util.Collection<FeedItem> items)
                        throws java.io.IOException
Generates an HTML file that displays the given FeedItems with the Feed information. Note: The given Feed object is not used in any way other than to display a title for the HTML file.

Parameters:
htmlPath - Path to write the HTML file to
feed - Feed used to create title for HTML page
items - The FeedItems to display (with most recently published items at the top of the page)
Throws:
java.io.IOException - Thrown if an error occurs when writing to htmlPath

generateComposite

public Composite generateComposite(Composite parent,
                                   Feed feed,
                                   java.util.Collection<FeedItem> items)
Description copied from interface: View
Called when the application wants to display the view. Should return a Composite object that will be displayed in a tab in the application.

Specified by:
generateComposite in interface View
Parameters:
parent - The parent for the Composite object. All views should make this parent the parent of the Composite object returned by the method!
feed - Feed to be displayed
items - FeedItems that belong to the Feed to be displayed
Returns:
Composite object used to display the FeedItems to the user

getName

public java.lang.String getName()
Description copied from interface: View
Returns the name of the view. This name is used to allow users to choose a view for a given Feed.

Specified by:
getName in interface View
Returns:
Name of the view.