net.sourceforge.java.feednread.frontend.components.tabbar
Class NewsFeedMetaDataView

java.lang.Object
  extended bynet.sourceforge.java.feednread.frontend.components.tabbar.NewsFeedMetaDataView
All Implemented Interfaces:
EventListener, ILanguageResourceChangeListener

public class NewsFeedMetaDataView
extends Object
implements ILanguageResourceChangeListener

Displays the meta data of a NewsFeed.

Author:
Sebastian Machhausen

Nested Class Summary
private  class NewsFeedMetaDataView.HyperlinkHandler
           
 
Field Summary
private  Label authorInfoLabel
           The description Label for the NewsFeed author
private  Label authorLabel
           The Label for the NewsFeed author
private  Composite contentContainer
           The container holding all components of the NewsFeedMetaDataView
private  Label copyrightInfoLabel
           The description Label for the NewsFeed copyright
private  Label copyrightLabel
           The Label for the NewsFeed copyright
private static DateFormat DEFAULT_DATE_FORMATTER
           The default DateFormat object to format the publishing date
private  Label descriptionInfoLabel
           The description Label for the NewsFeed description
private  Label descriptionLabel
           The Label for the NewsFeed description
private  Label homepageInfoLabel
          * The description Label of the NewsFeed homepage
private  Hyperlink homepageLink
           The NewsFeed homepage (written out) that links the newsfeed provider homepage
private  NewsFeedMetaDataView.HyperlinkHandler hyperlinkHandler
           Event handler for hyperlink activations
private  Label languageInfoLabel
           The description Label for the NewsFeed language
private  Label languageLabel
           The Label for the NewsFeed language
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
(package private)  ScrolledComposite metaDataContainerScroller
           The scrollable container holding the content container to enable scrolling
private  ImageHyperlink newsFeedImageLink
           The NewsFeed Image that links the NewsFeedprovider homepage
private  Image newsFeedImg
           The Image of the NewsFeed, e.g. the website logo
private  Hyperlink newsFeedTitleLink
           The NewsFeed title that links the NewsFeed provider homepage
private  Label newsfeedTypeInfoLabel
           The description Label for the NewsFeed type
private  Label newsfeedTypeLabel
           The Label holding the NewsFeed type as Image representation
private  Label publishedDateInfoLabel
           The description Label for the NewsFeed published date
private  Label publishedDateLabel
           The Label for the NewsFeed published date
 
Constructor Summary
NewsFeedMetaDataView(Composite parent, MainApplicationWindow mainWindow, NewsFeed newsFeed)
           Creates a new NewsFeedMetaDataView instance showing the meta data of the specified newsfeed.
 
Method Summary
private  String convertAuthors(List authors)
           Converts the specified List of authors to a single String that separates the SyndPerson instances by commas.
private  void createComponents(Composite parent, NewsFeed newsFeed)
           Creates the components used in the context of this NewsFeedMetaDataView.
private static Image createImage(SyndImage image)
           Gets the Image for the specified NewsFeed related SyndImage.
 void defaultLanguageChanged(LanguageResourceChangeEvent lrce)
           Called whenever the default language changes.
 void dispose()
           Disposes this NewsFeedMetaDataView and all of its components and allocated resources.
private static String getLanguage(String languageCode)
           Gets the display language for the specified iso languageCode, e.g. de-de or en-us.
private  void registerEventHandler()
           Creates and registers all Event Handler required in this NewsFeedMetaDataView context.
private  void unregisterEventHandler()
           Unregisters and destroys all Event Handler used in this NewsFeedMetaDataView context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATE_FORMATTER

private static final DateFormat DEFAULT_DATE_FORMATTER

The default DateFormat object to format the publishing date


mainWindow

private MainApplicationWindow mainWindow

The Feed'n Read main window


newsFeedImg

private Image newsFeedImg

The Image of the NewsFeed, e.g. the website logo


newsFeedTitleLink

private Hyperlink newsFeedTitleLink

The NewsFeed title that links the NewsFeed provider homepage


newsFeedImageLink

private ImageHyperlink newsFeedImageLink

The NewsFeed Image that links the NewsFeedprovider homepage


homepageInfoLabel

private Label homepageInfoLabel

* The description Label of the NewsFeed homepage


homepageLink

private Hyperlink homepageLink

The NewsFeed homepage (written out) that links the newsfeed provider homepage


descriptionInfoLabel

private Label descriptionInfoLabel

The description Label for the NewsFeed description


descriptionLabel

private Label descriptionLabel

The Label for the NewsFeed description


copyrightInfoLabel

private Label copyrightInfoLabel

The description Label for the NewsFeed copyright


copyrightLabel

private Label copyrightLabel

The Label for the NewsFeed copyright


authorInfoLabel

private Label authorInfoLabel

The description Label for the NewsFeed author


authorLabel

private Label authorLabel

The Label for the NewsFeed author


publishedDateInfoLabel

private Label publishedDateInfoLabel

The description Label for the NewsFeed published date


publishedDateLabel

private Label publishedDateLabel

The Label for the NewsFeed published date


languageInfoLabel

private Label languageInfoLabel

The description Label for the NewsFeed language


languageLabel

private Label languageLabel

The Label for the NewsFeed language


newsfeedTypeInfoLabel

private Label newsfeedTypeInfoLabel

The description Label for the NewsFeed type


newsfeedTypeLabel

private Label newsfeedTypeLabel

The Label holding the NewsFeed type as Image representation


metaDataContainerScroller

ScrolledComposite metaDataContainerScroller

The scrollable container holding the content container to enable scrolling


contentContainer

private Composite contentContainer

The container holding all components of the NewsFeedMetaDataView


hyperlinkHandler

private NewsFeedMetaDataView.HyperlinkHandler hyperlinkHandler

Event handler for hyperlink activations

Constructor Detail

NewsFeedMetaDataView

public NewsFeedMetaDataView(Composite parent,
                            MainApplicationWindow mainWindow,
                            NewsFeed newsFeed)

Creates a new NewsFeedMetaDataView instance showing the meta data of the specified newsfeed.

Parameters:
parent - the Component to place this NewsFeedMetaDataView in
mainWindow - the Feed'n Read main window
newsFeed - the NewsFeed to display the meta data for
Method Detail

defaultLanguageChanged

public void defaultLanguageChanged(LanguageResourceChangeEvent lrce)

Called whenever the default language changes.

Specified by:
defaultLanguageChanged in interface ILanguageResourceChangeListener
Parameters:
lrce - the triggered LanguageResourceChangeEvent

dispose

public void dispose()

Disposes this NewsFeedMetaDataView and all of its components and allocated resources.


createComponents

private void createComponents(Composite parent,
                              NewsFeed newsFeed)

Creates the components used in the context of this NewsFeedMetaDataView.

Parameters:
parent - Composite the component that this NewsFeedMetaDataView and its children should be placed in
newsFeed - the NewsFeed for which to display the meta data

convertAuthors

private String convertAuthors(List authors)

Converts the specified List of authors to a single String that separates the SyndPerson instances by commas.

Returns:
the converted authors

registerEventHandler

private void registerEventHandler()

Creates and registers all Event Handler required in this NewsFeedMetaDataView context.


unregisterEventHandler

private void unregisterEventHandler()

Unregisters and destroys all Event Handler used in this NewsFeedMetaDataView context.


getLanguage

private static String getLanguage(String languageCode)

Gets the display language for the specified iso languageCode, e.g. de-de or en-us.

Parameters:
languageCode - the iso language code, e.g. de-de or en-us
Returns:
the display language

createImage

private static Image createImage(SyndImage image)

Gets the Image for the specified NewsFeed related SyndImage.

Parameters:
image - the SyndImage describing the NewsFeed related image
Returns:
the Image for the specified SyndImage; null if no Image available