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

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

public class NewsFeedView
extends Object
implements ILanguageResourceChangeListener

Displays a NewsFeed in a tab view holding two selectable tabs: First a NewsFeedTable component that displays the NewsFeedEntrys in a NewsFeed. Second a NewsFeedMetaDataView compoents which displays the meta data of a NewsFeed.

Author:
Sebastian Machhausen

Nested Class Summary
private  class NewsFeedView.TabSelectionHandler
           
 
Field Summary
private  MainApplicationWindow mainWindow
           
private  NewsFeedMetaDataView metaDataView
           
private  CTabItem newsFeedMetaDataTabItem
           
private  CTabItem newsFeedTabItem
           
private  CLabel newsFeedTitle
           
private  Label newsFeedType
           
(package private)  CTabFolder newsFeedViewTabFolder
           
private  NewsFeedTable newsTable
           
private  NewsFeedView.TabSelectionHandler tabHandler
           
 
Constructor Summary
NewsFeedView(Composite parent, MainApplicationWindow mainWindow, NewsFeed newsFeed)
           Creates a new NewsFeedView instance showing the specified newsfeed.
 
Method Summary
private  void createComponents(Composite parent, NewsFeed newsFeed)
           Creates the components used in the context of this NewsFeedView.
private  Composite createNewsFeedContainer(NewsFeed newsFeed)
           Creates the newsfeed container which holds the newsfeed header and the NewsFeedTable component.
 void defaultLanguageChanged(LanguageResourceChangeEvent lrce)
           Called whenever the default language changes.
 void dispose()
           Disposes this NewsFeedView and all of its components and allocated resources.
 NewsFeedEntry[] filter(String filterText)
           Filters the entries matching the specified filterText keyword.
 String getFilterText()
           Gets the currently set filter text; null if none set.
 NewsFeed getNewsFeed()
           Gets the NewsFeed displayed in this NewsFeedView
 NewsFeedTable getNewsFeedTable()
           Gets the NewsFeedTable embedded in this NewsFeedView.
 int getVisibleEntries()
           Gets the number of currently visible NewsFeedEntries according to the current filter settings in this NewsFeedView.
 void refresh()
           Refreshes this NewsFeedView.
private  void registerEventHandler()
           Creates and registers all Event Handler required in this NewsFeedView context.
 void setFilterText(String filterText)
           Sets the filter to the specified filterText.
 void setNewsFeed(NewsFeed newsFeed)
           Sets the NewsFeed displayed in this NewsFeedView
 void setTaggedFilterEnabled(boolean enabled)
           Sets the enabled status of the tagged news filter.
 void setUnreadFilterEnabled(boolean enabled)
           Sets the enabled status of the unread news filter.
private  void unregisterEventHandler()
           Unregisters and destroys all Event Handler used in this NewsFeedView context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mainWindow

private MainApplicationWindow mainWindow

newsTable

private NewsFeedTable newsTable

newsFeedTitle

private CLabel newsFeedTitle

newsFeedType

private Label newsFeedType

newsFeedViewTabFolder

CTabFolder newsFeedViewTabFolder

newsFeedTabItem

private CTabItem newsFeedTabItem

newsFeedMetaDataTabItem

private CTabItem newsFeedMetaDataTabItem

metaDataView

private NewsFeedMetaDataView metaDataView

tabHandler

private NewsFeedView.TabSelectionHandler tabHandler
Constructor Detail

NewsFeedView

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

Creates a new NewsFeedView instance showing the specified newsfeed.

Parameters:
parent - the Component to place this NewsFeedView in
mainWindow - the Feed'n Read main window
newsFeed - the NewsFeed to display
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 NewsFeedView and all of its components and allocated resources.


getNewsFeedTable

public NewsFeedTable getNewsFeedTable()

Gets the NewsFeedTable embedded in this NewsFeedView.

Returns:
the NewsFeedTable embedded in this NewsFeedView

setNewsFeed

public void setNewsFeed(NewsFeed newsFeed)

Sets the NewsFeed displayed in this NewsFeedView

Parameters:
newsFeed - the NewsFeed to display

getNewsFeed

public NewsFeed getNewsFeed()

Gets the NewsFeed displayed in this NewsFeedView

Returns:
the NewsFeed displayed in this NewsFeedView

getVisibleEntries

public int getVisibleEntries()

Gets the number of currently visible NewsFeedEntries according to the current filter settings in this NewsFeedView.

Returns:
the number of currently visible NewsFeedEntries

filter

public NewsFeedEntry[] filter(String filterText)

Filters the entries matching the specified filterText keyword.

Parameters:
filterText - the keyword to use for filtering
Returns:
the filtered newsfeed entries matching the specified filterText keyword

setFilterText

public void setFilterText(String filterText)

Sets the filter to the specified filterText. A null value clears the filter.

Parameters:
filterText - the text to use as filter; null to clear the filter

getFilterText

public String getFilterText()

Gets the currently set filter text; null if none set.

Returns:
the currently set filter text; null if none set

refresh

public void refresh()

Refreshes this NewsFeedView.


setUnreadFilterEnabled

public void setUnreadFilterEnabled(boolean enabled)

Sets the enabled status of the unread news filter. If enabled only unread news otherwise all news are shown.

Parameters:
enabled - true to enable the unread news filter; false to disable it

setTaggedFilterEnabled

public void setTaggedFilterEnabled(boolean enabled)

Sets the enabled status of the tagged news filter. If enabled only tagged news otherwise all news are shown.

Parameters:
enabled - true to enable the tagged news filter; false to disable it

createComponents

private void createComponents(Composite parent,
                              NewsFeed newsFeed)

Creates the components used in the context of this NewsFeedView.

Parameters:
parent - Composite the component that this NewsFeedView and its children should be placed in
newsFeed - the NewsFeed to display

createNewsFeedContainer

private Composite createNewsFeedContainer(NewsFeed newsFeed)

Creates the newsfeed container which holds the newsfeed header and the NewsFeedTable component.

Parameters:
newsFeed - the newsfeed to display
Returns:
the created newsfeed container

registerEventHandler

private void registerEventHandler()

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


unregisterEventHandler

private void unregisterEventHandler()

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