net.sourceforge.java.feednread.frontend.event
Class EventCentral

java.lang.Object
  extended bynet.sourceforge.java.feednread.frontend.event.EventCentral

public class EventCentral
extends Object

Central class to handle all relevant user interaction event handling in the Feed'n Read MainApplicationWindow and all of its sub components. On the one hand it makes uses of the JFace Action framework (see org.eclipse.jface.action package) by defining Actions for all widgets that support this type of event handling.
On the other hand it defines action### methods for all remaining widgets that do not support the JFace Action framework.
The main point indeed is that this class represents a central point in which all application event handling takes place and so runs together.

Author:
Sebastian Machhausen

Field Summary
 AboutAction actionAbout
           
 AdjustNewsFeedTableColumnsAction actionAdjustNewsFeedTableColumns
           
 AggregateAction actionAggregate
           
 CloseAllTabsAction actionCloseAllTabs
           
 CloseTabAction actionCloseTab
           
 CollapseAllAction actionCollapseAll
           
 ConfigurationAction actionConfiguration
           
 EnclosureListAction actionEnclosureList
           
 ExitAction actionExit
           
 ExpandAllAction actionExpandAll
           
 ExportAction actionExport
           
 ImportAction actionImport
           
 MarkNewsReadAction actionMarkNewsRead
           
 MarkNewsUnreadAction actionMarkNewsUnread
           
 MarkTabReadAction actionMarkTabRead
           
 MarkTreeElementReadAction actionMarkTreeElementRead
           
 NewsContentViewAction actionNewsContentView
           
 NewsFeedAddressBarViewAction actionNewsFeedAddressBarView
           
 NewsFeedTabBarViewAction actionNewsFeedTabBarView
           
 NewTreeElementAction actionNewTreeElement
           
 NextNewsAction actionNextNews
           
 NextTabAction actionNextTab
           
 NextUnreadNewsAction actionNextUnreadNews
           
 NotificationBarViewAction actionNotificationBarView
           
 OpenNewsAction actionOpenNews
           
 OpenNewsFeedAction actionOpenNewsFeed
           
 OpenNewsInExternalBrowserAction actionOpenNewsInExternalBrowser
           
 PreviousTabAction actionPreviousTab
           
 RemoveTreeElementAction actionRemoveTreeElement
           
 ShowAllNewsAction actionShowAllNews
           
 ShowApplicationAction actionShowApplication
           
 ShowWebPageAction actionShowBugtrackerHomepage
           
 ShowWebPageAction actionShowFeatureRequestHomepage
           
 ShowWebPageAction actionShowForumHomepage
           
 ShowWebPageAction actionShowHomepage
           
 ShowLicenseAction actionShowLicense
           
 ShowWebPageAction actionShowMailingListHomepage
           
 ShowTaggedNewsAction actionShowTaggedNews
           
 ShowUnreadNewsAction actionShowUnreadNews
           
 SideBarViewAction actionSideBarView
           
 TagNewsAction actionTagNews
           
 ToolBarViewAction actionToolBarView
           
 TreeElementPropertiesAction actionTreeElementProperties
           
 UntagNewsAction actionUntagNews
           
 UpdateNewsFeedFavoritesTreeAction actionUpdateNewsFeedFavoritesTree
           
 UpdateNewsFeedTabAction actionUpdateNewsFeedTab
           
 UpdateTreeElementAction actionUpdateTreeElement
           
private  MainApplicationWindow mainWindow
           
 BrowserBackAction toolBarActionBrowserBack
           
 BrowserForwardAction toolBarActionBrowserForward
           
 BrowserHomeAction toolBarActionBrowserHome
           
 BrowserRefreshAction toolBarActionBrowserRefresh
           
 BrowserStopAction toolBarActionBrowserStop
           
 CloseAllTabsAction toolBarActionCloseAllTabs
           
 CloseTabAction toolBarActionCloseTab
           
 NewTreeElementAction toolBarActionNewTreeElement
           
 NextTabAction toolBarActionNextTab
           
 OpenNewsAction toolBarActionOpenNews
           
 OpenNewsFeedAction toolBarActionOpenNewsFeed
           
 PreviousTabAction toolBarActionPreviousTab
           
 RemoveTreeElementAction toolBarActionRemoveTreeElement
           
 TreeElementPropertiesAction toolBarActionTreeElementProperties
           
 UpdateNewsFeedFavoritesTreeAction toolBarActionUpdateNewsFeedFavoritesTree
           
 UpdateNewsFeedTabAction toolBarActionUpdateNewsFeedTab
           
 
Constructor Summary
EventCentral(MainApplicationWindow mainWindow)
           Creates a new EventCentral instance.
 
Method Summary
 void actionAddressBarAddressEntered()
           Called whenever a new address has been entered on user side by hitting the enter key in the address field in the NewsFeedAddressBar.
 void actionAddressBarAddressSelected()
           Called whenever an existing address has been selected in the NewsFeedAddressBar.
 void actionAddressBarKeyPressed(KeyEvent event)
           Called whenever a key has been pressed in the address bar.
 void actionArchiveOpenNewsFeedTabs()
           Archives all open newsfeed tabs in the NewsFeedTabBar component.
 void actionBrowserLocationChanged(LocationEvent event, Browser browser)
           Called whenever the location within a InternalBrowser changed.
 void actionBrowserLocationChanging(LocationEvent event, InternalBrowser browser)
           Called whenever the location within a InternalBrowser is about to change.
 void actionBrowserPageLoadingCompleted(ProgressEvent event)
           Called whenever the page loading within an InternalBrowser completed.
 void actionBrowserPageLoadingProgressChanged(ProgressEvent event)
           Called whenever the page loading progress changed within a InternalBrowser changed.
 void actionBrowserPageTitleChanged(InternalBrowser browserView, String title)
           Called whenver the page title within the specified InternalBrowser changed.
 void actionBrowserStatusTextChanged(StatusTextEvent event)
           Called whenever the status text within a InternalBrowser changed.
 void actionFavoritesTreeElementDoubleClicked(DoubleClickEvent event)
           Action that is being execeuted when a tree element is being double clicked in the NewsFeedFavoritesTree.
 void actionFavoritesTreeElementSelected(SelectionChangedEvent event)
           Action that is being execeuted when a tree element is being selected in the NewsFeedFavoritesTree.
 void actionLaunchBrowser(String url)
           Launches a browser tab/window for the specified url depending on the ConfigurationManager.ON_OPEN_LINK_BEHAVIOUR configuration setting.
 void actionNewsFeedEntryDoubleClicked(DoubleClickEvent event)
           Called whenever a NewsFeedEntry has been double clicked in a NewsFeedTable.
 void actionNewsFeedEntryHyperlinkActivated(HyperlinkEvent event)
           Called whenever the link of a NewsFeedEntry has been activated in the NewsContentView.
 void actionNewsFeedEntrySelected(SelectionChangedEvent event, TableViewer viewer)
           Handles the SelectionChangedEvent being triggered if a NewsFeedEntryhas been selected in a NewsFeedTable.
 int actionNewsFeedLinkActivated(String url, String title)
           Called whenever a link to a NewsFeed has been activated in an InternalBrowser.
 void actionNewsFilterChanged(String filterText)
           If the filter text changed due to user input the filter tab is required to update and show all news that match the updated filter.
 void actionSideBarSelectionChanged(SelectionEvent event)
           Called whenever the selected component in the SideBar changes.
 void actionTabBarMaximized()
           Called when the NewsFeedTabBar has been maximized, i.e.
 void actionTabBarRestored()
           Called when the NewsFeedTabBar has been restored, i.e.
 void actionTabClosed(CTabItem tabItem, CTabItem filteredNewsTab)
           Called when a tab has been closed.
 void actionTabSelected(CTabItem selectedItem)
           If the tab selection changed the tab view is ajusted depending on the type of tab.
 void actionUpdateActionStates()
           Updates the states of the Action objects used in this EventCentral.
 void actionWatchesTreeElementDoubleClicked(DoubleClickEvent event)
           Action that is being execeuted when a tree element is being double clicked in the NewsFeedWatchesTree.
 void actionWatchesTreeElementSelected(SelectionChangedEvent event)
           Action that is being execeuted when a tree element is being selected in the NewsFeedWatchesTree.
private  void createActions()
           Creates all actions defined by this application.
private  void createBrowserToolBarActions()
           Creates all Actions defined by the ToolBar of the InternalBrower component.
private  void createToolBarActions()
           Creates all ToolBar specific Actions.
private  void updateFavoritesTreeActions()
           Updates the Actions related to the NewsFeedFavoritesTree component as the selection therein has changed.
private  void updateWatchesTreeActions()
           Updates the Actions related to the NewsFeedWatchesTree component as the selection therein has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mainWindow

private MainApplicationWindow mainWindow

actionOpenNewsFeed

public OpenNewsFeedAction actionOpenNewsFeed

actionUpdateNewsFeedTab

public UpdateNewsFeedTabAction actionUpdateNewsFeedTab

actionUpdateTreeElement

public UpdateTreeElementAction actionUpdateTreeElement

actionUpdateNewsFeedFavoritesTree

public UpdateNewsFeedFavoritesTreeAction actionUpdateNewsFeedFavoritesTree

actionCloseTab

public CloseTabAction actionCloseTab

actionCloseAllTabs

public CloseAllTabsAction actionCloseAllTabs

actionNewTreeElement

public NewTreeElementAction actionNewTreeElement

actionRemoveTreeElement

public RemoveTreeElementAction actionRemoveTreeElement

actionTreeElementProperties

public TreeElementPropertiesAction actionTreeElementProperties

actionExit

public ExitAction actionExit

actionShowApplication

public ShowApplicationAction actionShowApplication

actionMarkNewsRead

public MarkNewsReadAction actionMarkNewsRead

actionMarkNewsUnread

public MarkNewsUnreadAction actionMarkNewsUnread

actionTagNews

public TagNewsAction actionTagNews

actionUntagNews

public UntagNewsAction actionUntagNews

actionOpenNews

public OpenNewsAction actionOpenNews

actionOpenNewsInExternalBrowser

public OpenNewsInExternalBrowserAction actionOpenNewsInExternalBrowser

actionMarkTabRead

public MarkTabReadAction actionMarkTabRead

actionMarkTreeElementRead

public MarkTreeElementReadAction actionMarkTreeElementRead

actionNextNews

public NextNewsAction actionNextNews

actionNextUnreadNews

public NextUnreadNewsAction actionNextUnreadNews

actionExpandAll

public ExpandAllAction actionExpandAll

actionCollapseAll

public CollapseAllAction actionCollapseAll

actionAggregate

public AggregateAction actionAggregate

actionImport

public ImportAction actionImport

actionExport

public ExportAction actionExport

actionNewsFeedAddressBarView

public NewsFeedAddressBarViewAction actionNewsFeedAddressBarView

actionToolBarView

public ToolBarViewAction actionToolBarView

actionSideBarView

public SideBarViewAction actionSideBarView

actionNewsFeedTabBarView

public NewsFeedTabBarViewAction actionNewsFeedTabBarView

actionNewsContentView

public NewsContentViewAction actionNewsContentView

actionNotificationBarView

public NotificationBarViewAction actionNotificationBarView

actionShowAllNews

public ShowAllNewsAction actionShowAllNews

actionShowUnreadNews

public ShowUnreadNewsAction actionShowUnreadNews

actionShowTaggedNews

public ShowTaggedNewsAction actionShowTaggedNews

actionPreviousTab

public PreviousTabAction actionPreviousTab

actionNextTab

public NextTabAction actionNextTab

actionAdjustNewsFeedTableColumns

public AdjustNewsFeedTableColumnsAction actionAdjustNewsFeedTableColumns

actionEnclosureList

public EnclosureListAction actionEnclosureList

actionConfiguration

public ConfigurationAction actionConfiguration

actionShowLicense

public ShowLicenseAction actionShowLicense

actionShowHomepage

public ShowWebPageAction actionShowHomepage

actionShowMailingListHomepage

public ShowWebPageAction actionShowMailingListHomepage

actionShowForumHomepage

public ShowWebPageAction actionShowForumHomepage

actionShowBugtrackerHomepage

public ShowWebPageAction actionShowBugtrackerHomepage

actionShowFeatureRequestHomepage

public ShowWebPageAction actionShowFeatureRequestHomepage

actionAbout

public AboutAction actionAbout

toolBarActionOpenNewsFeed

public OpenNewsFeedAction toolBarActionOpenNewsFeed

toolBarActionOpenNews

public OpenNewsAction toolBarActionOpenNews

toolBarActionUpdateNewsFeedTab

public UpdateNewsFeedTabAction toolBarActionUpdateNewsFeedTab

toolBarActionUpdateNewsFeedFavoritesTree

public UpdateNewsFeedFavoritesTreeAction toolBarActionUpdateNewsFeedFavoritesTree

toolBarActionNewTreeElement

public NewTreeElementAction toolBarActionNewTreeElement

toolBarActionRemoveTreeElement

public RemoveTreeElementAction toolBarActionRemoveTreeElement

toolBarActionTreeElementProperties

public TreeElementPropertiesAction toolBarActionTreeElementProperties

toolBarActionCloseTab

public CloseTabAction toolBarActionCloseTab

toolBarActionCloseAllTabs

public CloseAllTabsAction toolBarActionCloseAllTabs

toolBarActionPreviousTab

public PreviousTabAction toolBarActionPreviousTab

toolBarActionNextTab

public NextTabAction toolBarActionNextTab

toolBarActionBrowserBack

public BrowserBackAction toolBarActionBrowserBack

toolBarActionBrowserForward

public BrowserForwardAction toolBarActionBrowserForward

toolBarActionBrowserStop

public BrowserStopAction toolBarActionBrowserStop

toolBarActionBrowserRefresh

public BrowserRefreshAction toolBarActionBrowserRefresh

toolBarActionBrowserHome

public BrowserHomeAction toolBarActionBrowserHome
Constructor Detail

EventCentral

public EventCentral(MainApplicationWindow mainWindow)

Creates a new EventCentral instance.

Parameters:
mainWindow - the Feed'n Read main window
Method Detail

createActions

private void createActions()

Creates all actions defined by this application.


createBrowserToolBarActions

private void createBrowserToolBarActions()

Creates all Actions defined by the ToolBar of the InternalBrower component.


createToolBarActions

private void createToolBarActions()

Creates all ToolBar specific Actions.


actionFavoritesTreeElementSelected

public void actionFavoritesTreeElementSelected(SelectionChangedEvent event)

Action that is being execeuted when a tree element is being selected in the NewsFeedFavoritesTree. The action updates the enabled states of the NewsFeedFavoritesTree related Actions.

Parameters:
event - the event triggered when a tree element is being selected in the NewsFeedFavoritesTree

actionWatchesTreeElementSelected

public void actionWatchesTreeElementSelected(SelectionChangedEvent event)

Action that is being execeuted when a tree element is being selected in the NewsFeedWatchesTree. The action updates the enabled states of the NewsFeedWatchesTree related Actions.

Parameters:
event - the event triggered when a tree element is being selected in the NewsFeedWatchesTree

actionUpdateActionStates

public void actionUpdateActionStates()

Updates the states of the Action objects used in this EventCentral.


actionFavoritesTreeElementDoubleClicked

public void actionFavoritesTreeElementDoubleClicked(DoubleClickEvent event)

Action that is being execeuted when a tree element is being double clicked in the NewsFeedFavoritesTree. The action verifies if the double clicked element is a Favorite. If that's the case the Favorite's newsfeed url is being queried and a new news tab is opened in the NewsFeedTabBar showing the Favorite's associated NewsFeed.

Parameters:
event - the event triggered when a tree element is being double clicked in the NewsFeedFavoritesTree

actionWatchesTreeElementDoubleClicked

public void actionWatchesTreeElementDoubleClicked(DoubleClickEvent event)

Action that is being execeuted when a tree element is being double clicked in the NewsFeedWatchesTree. The action verifies if the double clicked element is a Watch. If that's the case a new news tab is opened in the NewsFeedTabBar showing the NewsfeeEntries matching the Watch's associated WatchSettings.

Parameters:
event - the event triggered when a tree element is being double clicked in the NewsFeedWatchesTree

actionAddressBarAddressEntered

public void actionAddressBarAddressEntered()

Called whenever a new address has been entered on user side by hitting the enter key in the address field in the NewsFeedAddressBar.


actionAddressBarAddressSelected

public void actionAddressBarAddressSelected()

Called whenever an existing address has been selected in the NewsFeedAddressBar.


actionAddressBarKeyPressed

public void actionAddressBarKeyPressed(KeyEvent event)

Called whenever a key has been pressed in the address bar. This method removes the selected element in the address bar upon pressing the DELETE key.

Parameters:
event - the KeyEvent triggered

actionNewsFeedEntrySelected

public void actionNewsFeedEntrySelected(SelectionChangedEvent event,
                                        TableViewer viewer)

Handles the SelectionChangedEvent being triggered if a NewsFeedEntryhas been selected in a NewsFeedTable. The selected NewsFeedEntry gets marked as read. The default status is unselected which means unread.

Parameters:
event - the SelectionChangeEvent triggered
viewer - the TableViewer this event occured in

actionNewsFeedEntryDoubleClicked

public void actionNewsFeedEntryDoubleClicked(DoubleClickEvent event)

Called whenever a NewsFeedEntry has been double clicked in a NewsFeedTable. This method opens a new browser tab to show the NewsFeedEntry content.

Parameters:
event - the DoubleClickEvent triggered

actionNewsFeedEntryHyperlinkActivated

public void actionNewsFeedEntryHyperlinkActivated(HyperlinkEvent event)

Called whenever the link of a NewsFeedEntry has been activated in the NewsContentView. This method opens a new browser tab to show the NewsFeedEntry content.

Parameters:
event - the HyperlinkEvent triggered

actionBrowserLocationChanged

public void actionBrowserLocationChanged(LocationEvent event,
                                         Browser browser)

Called whenever the location within a InternalBrowser changed.

Parameters:
event - the LocationEvent that was triggered
browser - the Browser widget that triggered the event

actionBrowserLocationChanging

public void actionBrowserLocationChanging(LocationEvent event,
                                          InternalBrowser browser)

Called whenever the location within a InternalBrowser is about to change. This method verifies if the location points to a potential NewsFeed. If so it brings up a dialog that lets the user decide whether he wants to create a Favorite for the detected NewsFeed.

Parameters:
event - the LocationEvent that was triggered
browser - the InternalBrowser widget that triggered the event

actionNewsFeedLinkActivated

public int actionNewsFeedLinkActivated(String url,
                                       String title)

Called whenever a link to a NewsFeed has been activated in an InternalBrowser. This methods brings up a NewsFeedLinkDialog that lets the user decide whether he wants to create a Favorite for the detected NewsFeed.

Parameters:
url - the url of the NewsFeed
title - the title of the NewsFeed or web page that offers the NewsFeed
Returns:
the return code of the NewsFeedLinkDialog; either IDialogConstants.YES_ID if the dialog answer was YES or IDialogConstants.NO_ID if the user answered with NO

actionBrowserStatusTextChanged

public void actionBrowserStatusTextChanged(StatusTextEvent event)

Called whenever the status text within a InternalBrowser changed.

Parameters:
event - the StatusTextEvent that was triggered

actionBrowserPageTitleChanged

public void actionBrowserPageTitleChanged(InternalBrowser browserView,
                                          String title)

Called whenver the page title within the specified InternalBrowser changed.

Parameters:
browserView - the InternalBrowser that reported the change
title - the page title

actionBrowserPageLoadingProgressChanged

public void actionBrowserPageLoadingProgressChanged(ProgressEvent event)

Called whenever the page loading progress changed within a InternalBrowser changed.

Parameters:
event - the ProgressEvent that was triggered

actionBrowserPageLoadingCompleted

public void actionBrowserPageLoadingCompleted(ProgressEvent event)

Called whenever the page loading within an InternalBrowser completed.

Parameters:
event - the ProgressEvent that was triggered

actionNewsFilterChanged

public void actionNewsFilterChanged(String filterText)

If the filter text changed due to user input the filter tab is required to update and show all news that match the updated filter.

Parameters:
filterText - the updated filter text

actionTabClosed

public void actionTabClosed(CTabItem tabItem,
                            CTabItem filteredNewsTab)

Called when a tab has been closed. This methods evaluates the closed tab and removes its data entry from the underlying management structure depending on the tab type, i.e. newsfeed or browser tab. In addition the filtered news tab is synchronized if necessary.

Parameters:
tabItem - the CTabItem that was closed
filteredNewsTab - the CTabItem that holds all filtered news

actionTabSelected

public void actionTabSelected(CTabItem selectedItem)

If the tab selection changed the tab view is ajusted depending on the type of tab. If a browser tab has been selected the enclosing split screen is maximized and the NewsContentView hidden. Otherwiese a newsfeed tab has been selected and the enclosing split screen is restored and the NewsContentView shown.

Parameters:
selectedItem - the CTabItem that was selected

actionTabBarMaximized

public void actionTabBarMaximized()

Called when the NewsFeedTabBar has been maximized, i.e. the maximize button has been pressed.


actionTabBarRestored

public void actionTabBarRestored()

Called when the NewsFeedTabBar has been restored, i.e. the restore button has been pressed.


actionArchiveOpenNewsFeedTabs

public void actionArchiveOpenNewsFeedTabs()

Archives all open newsfeed tabs in the NewsFeedTabBar component.


actionLaunchBrowser

public void actionLaunchBrowser(String url)

Launches a browser tab/window for the specified url depending on the ConfigurationManager.ON_OPEN_LINK_BEHAVIOUR configuration setting.

Parameters:
url - the url to launch a browser for

actionSideBarSelectionChanged

public void actionSideBarSelectionChanged(SelectionEvent event)

Called whenever the selected component in the SideBar changes.

Parameters:
event - the SelectionEvent triggered

updateFavoritesTreeActions

private void updateFavoritesTreeActions()

Updates the Actions related to the NewsFeedFavoritesTree component as the selection therein has changed.


updateWatchesTreeActions

private void updateWatchesTreeActions()

Updates the Actions related to the NewsFeedWatchesTree component as the selection therein has changed.