net.sourceforge.rssowl.controller
Class NewsTable

java.lang.Object
  extended by net.sourceforge.rssowl.controller.NewsTable
All Implemented Interfaces:
ITranslatable

public class NewsTable
extends java.lang.Object
implements ITranslatable

Class to create a table holding news from a NewsItem.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private  MenuItem addFeedToFav
           
private  MenuItem blogNews
           
private static java.lang.String[] columnOrder
          Sort order of columns in newstable
private  MenuItem copyUrlItem
           
(package private)  EventManager eventManager
           
private  MenuItem exportItem
           
private  MenuItem generateHTML
           
private  MenuItem generatePDF
           
private  MenuItem generateRTF
           
(package private)  boolean isNewsSelected
           
(package private)  java.lang.String language
           
private  MenuItem mailLinkToFriend
           
private  MenuItem markAllReadItem
           
private  MenuItem markUnreadItem
           
private  MenuItem reloadFeed
           
(package private)  GUI rssOwlGui
           
private  MenuItem searchFeed
           
private  CTabItem tabItem
           
private  Menu tableMenu
           
 
Constructor Summary
NewsTable(GUI rssOwlGui, CTabItem tabItem, EventManager eventManager)
          Instantiate a new NewsTable
 
Method Summary
(package private) static void actionDisplayNextNews(boolean showUnread)
          Display the next news in the table.
(package private) static boolean actionDisplayNextNews(CTabItem tabItem, boolean showUnread)
          Try to select the next (unread/read) news from the given TabItem
(package private) static boolean actionDisplayNextNews(TreeItem item, boolean showUnread, boolean deep)
          Try to select the next news from the given TreeItem.
(package private)  void actionNavigateNews(boolean next)
          Display the selected news in the table
(package private)  void actionSelectNews(Table newsTable, int index)
          Select the index on the given Newstable
 Table createNewsTable(Composite newsHeaderTableHolder)
          Create a new table holding news
static void fillTable(Table table, java.util.Hashtable newsItems, java.util.Vector newsItemOrder, java.util.Vector newsItemInfos, boolean performSearch)
          Fill the given table using the given items.
static void fillTable(Table table, java.util.Hashtable newsItems, java.util.Vector newsItemOrder, java.util.Vector newsItemInfos, boolean performSearch, int[] columnWidth)
          Fill the given table using the given items.
static void fillTableColumns(Table table, java.util.Hashtable newsItems, java.util.Vector newsItemOrder, java.util.Vector newsItemInfos, boolean performSearch)
          Fill columns of the given table
(package private) static void markAllRead(Table newsTable)
          Mark all tableitems of the given table read
(package private)  void onKeyPressed(Table newsTable, KeyEvent e)
          Called whenever a key is pressed on the Table
(package private)  void onMouseDoubleClick(Table newsTable, Event e)
          Called whenever the table is doubleclicked on
(package private)  void onMouseDown(Table newsTable, Event e)
          An item of the newstable has been selected with the Mouse
(package private)  void onMouseUp(Table newsTable, Event event)
          Called whenever the mouse button is released
(package private)  void setNewsSelectedState(boolean newsSelected)
          Set a new state to some items of the popup
 void setTabItem(CTabItem tabItem)
          Sets the CTabItem this Table is part of.
private  void updateAccelerators()
          Update the accelerators on the menuitems
 void updateI18N()
          Update translation of all String literals
(package private) static void updateTableItemStyle(TableItem item)
          Update the table items style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnOrder

private static final java.lang.String[] columnOrder
Sort order of columns in newstable


addFeedToFav

private MenuItem addFeedToFav

blogNews

private MenuItem blogNews

copyUrlItem

private MenuItem copyUrlItem

generateHTML

private MenuItem generateHTML

generatePDF

private MenuItem generatePDF

generateRTF

private MenuItem generateRTF

mailLinkToFriend

private MenuItem mailLinkToFriend

markAllReadItem

private MenuItem markAllReadItem

markUnreadItem

private MenuItem markUnreadItem

reloadFeed

private MenuItem reloadFeed

searchFeed

private MenuItem searchFeed

tabItem

private CTabItem tabItem

tableMenu

private Menu tableMenu

eventManager

EventManager eventManager

isNewsSelected

boolean isNewsSelected

language

java.lang.String language

rssOwlGui

GUI rssOwlGui

exportItem

private MenuItem exportItem
Constructor Detail

NewsTable

public NewsTable(GUI rssOwlGui,
                 CTabItem tabItem,
                 EventManager eventManager)
Instantiate a new NewsTable

Parameters:
rssOwlGui - The maincontroller
tabItem - The CTabItem this Newstable is added to
eventManager - The event manager
Method Detail

setTabItem

public void setTabItem(CTabItem tabItem)
Sets the CTabItem this Table is part of. This method is only called when the initial TabItem was moved to a different TabItem.

Parameters:
tabItem - The CTabItem this Table is part of.

fillTable

public static void fillTable(Table table,
                             java.util.Hashtable newsItems,
                             java.util.Vector newsItemOrder,
                             java.util.Vector newsItemInfos,
                             boolean performSearch)
Fill the given table using the given items. Ludovic Kim-Xuan Galibert

Parameters:
table - the Table to fill.
newsItems - the Hashtable of RSSNewsItems to be displayed.
newsItemOrder - the ordering of the RSSNewsItems as keys to retrieve the RSSNewsItems from the Hashtable.
newsItemInfos - a vector of identifiers for the type of info.
performSearch - true if a search should be performed, otherwise false.

fillTable

public static void fillTable(Table table,
                             java.util.Hashtable newsItems,
                             java.util.Vector newsItemOrder,
                             java.util.Vector newsItemInfos,
                             boolean performSearch,
                             int[] columnWidth)
Fill the given table using the given items. Ludovic Kim-Xuan Galibert

Parameters:
table - the Table to fill.
newsItems - the Hashtable of RSSNewsItems to be displayed.
newsItemOrder - the ordering of the RSSNewsItems as keys to retrieve the RSSNewsItems from the Hashtable.
newsItemInfos - a vector of identifiers for the type of info.
performSearch - true if a search should be performed, otherwise false.
columnWidth - The widths of each column in an int array

fillTableColumns

public static void fillTableColumns(Table table,
                                    java.util.Hashtable newsItems,
                                    java.util.Vector newsItemOrder,
                                    java.util.Vector newsItemInfos,
                                    boolean performSearch)
Fill columns of the given table

Parameters:
table - The table to add the columns
newsItems - The Newsitems
newsItemOrder - The order of the Newsitems
newsItemInfos - Infos to the Newsitems
performSearch - TRUE if a search is performed

actionDisplayNextNews

static void actionDisplayNextNews(boolean showUnread)
Display the next news in the table. If the last news (either unread or read) is reached, continue with news displayed in other opened Tabs.

Parameters:
showUnread - TRUE if only unread news shoulb be displayed

actionDisplayNextNews

static boolean actionDisplayNextNews(TreeItem item,
                                     boolean showUnread,
                                     boolean deep)
Try to select the next news from the given TreeItem.

Parameters:
item - The current Item to search for Channels.
showUnread - If TRUE only show unread news
deep - If TRUE, recursivly try childs of the given Item
Returns:
TRUE in case a Channel with News has been found.

actionDisplayNextNews

static boolean actionDisplayNextNews(CTabItem tabItem,
                                     boolean showUnread)
Try to select the next (unread/read) news from the given TabItem

Parameters:
tabItem - The tabitem containing news
showUnread - If TRUE only show unread news
Returns:
boolean TRUE if the next news was selected

markAllRead

static void markAllRead(Table newsTable)
Mark all tableitems of the given table read

Parameters:
newsTable - The table to mark read

updateTableItemStyle

static void updateTableItemStyle(TableItem item)
Update the table items style. Style unread items different from read ones.

Parameters:
item - A TableItem

createNewsTable

public Table createNewsTable(Composite newsHeaderTableHolder)
Create a new table holding news

Parameters:
newsHeaderTableHolder - The composite that holds the table
Returns:
Table The created table for the news

updateI18N

public void updateI18N()
Description copied from interface: ITranslatable
Update translation of all String literals

Specified by:
updateI18N in interface ITranslatable
See Also:
ITranslatable.updateI18N()

updateAccelerators

private void updateAccelerators()
Update the accelerators on the menuitems


actionNavigateNews

void actionNavigateNews(boolean next)
Display the selected news in the table

Parameters:
next - If TRUE select next news, if FALSE select previous news

actionSelectNews

void actionSelectNews(Table newsTable,
                      int index)
Select the index on the given Newstable

Parameters:
newsTable - The table the event occurs
index - The index to select in the table

onKeyPressed

void onKeyPressed(Table newsTable,
                  KeyEvent e)
Called whenever a key is pressed on the Table

Parameters:
newsTable - The newstable the event is occuring on
e - The occuring event

onMouseDoubleClick

void onMouseDoubleClick(Table newsTable,
                        Event e)
Called whenever the table is doubleclicked on

Parameters:
newsTable - The table the event is occuring on
e - The occuring MouseEvent.

onMouseDown

void onMouseDown(Table newsTable,
                 Event e)
An item of the newstable has been selected with the Mouse

Parameters:
newsTable - The selected Table
e - The occured event

onMouseUp

void onMouseUp(Table newsTable,
               Event event)
Called whenever the mouse button is released

Parameters:
newsTable - The newstable the event is occuring on
event - The occuring Event

setNewsSelectedState

void setNewsSelectedState(boolean newsSelected)
Set a new state to some items of the popup

Parameters:
newsSelected - TRUE if a news is selected


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo