net.sourceforge.rssowl.controller
Class NewsText

java.lang.Object
  extended by net.sourceforge.rssowl.controller.NewsText
All Implemented Interfaces:
IFontChangeable, ITranslatable

public class NewsText
extends java.lang.Object
implements ITranslatable, IFontChangeable

This is the ViewForm where a newsitem is displayed with Title, URL to the news and the description.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private  BrowserPanel browserPanel
           
private  SashForm contentSash
           
(package private)  MenuItem copyItem
           
private  MenuItem copyItemUrl
           
private  Composite descriptionHolder
           
(package private)  Display display
           
(package private)  EventManager eventManager
           
(package private)  boolean isReset
           
private  boolean isShowingNews
           
(package private)  int lastRate
           
private  Menu linkMenu
           
private  Composite newsContentHolder
           
private  ViewForm newsContentViewForm
           
private  Composite newsContentViewFormHeader
           
(package private)  StyledText newsText
           
private  Composite newsTextHolder
           
(package private)  Menu newsTextMenu
           
(package private)  StyledText newsTextTitle
           
(package private)  ToolBar newsTextToolBar
           
(package private)  net.sourceforge.rssowl.controller.forms.Hyperlink newsTextUrl
           
private  MenuItem openExternalItem
           
(package private)  MenuItem openInBrowserItem
           
private  MenuItem printNews
           
private  MenuItem rateBad
           
(package private)  Composite rateComposite
           
(package private)  Menu rateDropdown
           
private  MenuItem rateFantastic
           
private  MenuItem rateGood
           
private  MenuItem rateModerate
           
(package private)  ToolItem rateToolItem
           
private  MenuItem rateVeryBad
           
private  boolean requiresUpdate
           
(package private)  NewsItem rssNewsItem
           
(package private)  GUI rssOwlGui
           
private  MenuItem selectAllItem
           
(package private)  Shell shell
           
(package private)  Composite urlTitleHolder
           
private  MenuItem useBrowserForNewsText
           
(package private)  int x
           
(package private)  int y
           
 
Constructor Summary
NewsText(Display display, Shell shell, SashForm contentSash, GUI rssOwlGui, EventManager eventManager)
          Instantiate a new NewsText to display a newsitem
 
Method Summary
(package private)  void checkWord(StyledText text)
          Get the word from the position where the mouse is and check if the word is an URL.
(package private)  void clearNewstext()
          Empty the newstext viewform
private  void createBrowserPanel(boolean onStartup)
          Create the browser panel to display newstext in the internal browser
private  void createStyledText()
          Create the StyledText to display the newstext.
private  void displayNews(NewsItem rssNewsItem)
          Display news in the ViewForm
(package private)  void displayNews(java.lang.String urlOrTitle, java.lang.String newsTitle)
          Display the selected news in the newstext-viewform
private  void displayNewsInBrowser()
          Display the selected news in the internal browser.
private  void displayNewsInStyledText()
          Display selected news in a StyledText
private  void displayNewsLinkInBrowser(java.lang.String link)
          Display the Link of the News using the internal browser.
private  void displayNewsMetaInfo()
          Display Title and link of the news
 BrowserPanel getBrowserPanel()
          Get the BrowserPanel of the Newstext panel in case internal browser view is activated for newstext
 StyledText getNewsTextTitle()
          Let other objects access this controll (for example to focus on it)
 java.lang.String getPrintableNewstext()
          Get the currently viewed newsitem's text to print.
private  void initComponents()
          Init all the components
private  boolean isShowingNews(NewsItem newsItem)
          Check if the given NewsItem is currently being displayed
(package private)  void onMouseMove(MouseEvent e)
          Called whenever the mouse is moving
(package private)  void onMouseUp(MouseEvent e)
          Called whenever the mouse button was released
(package private)  void rateNews(NewsItem rssNewsItem, int rateLevel)
          AmphetaRate has been Disabled for now!
private  void rebuildNewsText()
          Rebuild the newstext area
 void setNewsTextToolBarVisible(boolean visible)
          Set the NewsText-ToolBar visible or invisible based on the given argument.
 void setRequiresUpdate()
          Explicitly marks the newstext as required to update.
private  void updateAccelerators()
          Update the accelerators on the menuitems
 void updateFonts()
          All implementing classes must provide a method to update the fonts of all GUI elements that provide a setFont() Method.
 void updateI18N()
          Update all controlls text with i18n
 void updateLinkColor()
          Update color of Link Label
(package private)  void updateNewsTextComposite()
          Update the newstext composite to either show Internal Browser or StyledText for the newstext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

browserPanel

private BrowserPanel browserPanel

contentSash

private SashForm contentSash

copyItemUrl

private MenuItem copyItemUrl

descriptionHolder

private Composite descriptionHolder

isShowingNews

private boolean isShowingNews

linkMenu

private Menu linkMenu

newsContentHolder

private Composite newsContentHolder

newsContentViewForm

private ViewForm newsContentViewForm

newsContentViewFormHeader

private Composite newsContentViewFormHeader

newsTextHolder

private Composite newsTextHolder

openExternalItem

private MenuItem openExternalItem

printNews

private MenuItem printNews

rateBad

private MenuItem rateBad

rateFantastic

private MenuItem rateFantastic

rateGood

private MenuItem rateGood

rateModerate

private MenuItem rateModerate

rateVeryBad

private MenuItem rateVeryBad

requiresUpdate

private boolean requiresUpdate

selectAllItem

private MenuItem selectAllItem

useBrowserForNewsText

private MenuItem useBrowserForNewsText

copyItem

MenuItem copyItem

display

Display display

eventManager

EventManager eventManager

isReset

boolean isReset

lastRate

int lastRate

newsText

StyledText newsText

newsTextMenu

Menu newsTextMenu

newsTextTitle

StyledText newsTextTitle

newsTextToolBar

ToolBar newsTextToolBar

newsTextUrl

net.sourceforge.rssowl.controller.forms.Hyperlink newsTextUrl

openInBrowserItem

MenuItem openInBrowserItem

rateComposite

Composite rateComposite

rateDropdown

Menu rateDropdown

rateToolItem

ToolItem rateToolItem

rssNewsItem

NewsItem rssNewsItem

rssOwlGui

GUI rssOwlGui

shell

Shell shell

urlTitleHolder

Composite urlTitleHolder

x

int x

y

int y
Constructor Detail

NewsText

public NewsText(Display display,
                Shell shell,
                SashForm contentSash,
                GUI rssOwlGui,
                EventManager eventManager)
Instantiate a new NewsText to display a newsitem

Parameters:
display - The display
shell - The shell
contentSash - The Sashform where to add the ViewForm
rssOwlGui - Access some methods of the main controller
eventManager - The event manager
Method Detail

getBrowserPanel

public BrowserPanel getBrowserPanel()
Get the BrowserPanel of the Newstext panel in case internal browser view is activated for newstext

Returns:
BrowserPanel The browserpanel for the newstext

getNewsTextTitle

public StyledText getNewsTextTitle()
Let other objects access this controll (for example to focus on it)

Returns:
NewsTextTitle StyledText

getPrintableNewstext

public java.lang.String getPrintableNewstext()
Get the currently viewed newsitem's text to print.

Returns:
String Text to print

setNewsTextToolBarVisible

public void setNewsTextToolBarVisible(boolean visible)
Set the NewsText-ToolBar visible or invisible based on the given argument.

Parameters:
visible - Set to TRUE if the Toolbar is to be visible.

setRequiresUpdate

public void setRequiresUpdate()
Explicitly marks the newstext as required to update. This is called when the user has clicked into a news.


updateFonts

public void updateFonts()
Description copied from interface: IFontChangeable
All implementing classes must provide a method to update the fonts of all GUI elements that provide a setFont() Method.

Specified by:
updateFonts in interface IFontChangeable
See Also:
IFontChangeable.updateFonts()

updateI18N

public void updateI18N()
Update all controlls text with i18n

Specified by:
updateI18N in interface ITranslatable

updateLinkColor

public void updateLinkColor()
Update color of Link Label


createBrowserPanel

private void createBrowserPanel(boolean onStartup)
Create the browser panel to display newstext in the internal browser

Parameters:
onStartup - If TRUE this method is called on startup of RSSOwl

createStyledText

private void createStyledText()
Create the StyledText to display the newstext. This method is called whenever the user switches from the internal browser view to the StyledText view.


displayNews

private void displayNews(NewsItem rssNewsItem)
Display news in the ViewForm

Parameters:
rssNewsItem - The newsitem to display

displayNewsInBrowser

private void displayNewsInBrowser()
Display the selected news in the internal browser. This will display Title and URL of the news as usual and show the description (plus possible enclosures, comments, source) in the internal browser.


displayNewsInStyledText

private void displayNewsInStyledText()
Display selected news in a StyledText


displayNewsLinkInBrowser

private void displayNewsLinkInBrowser(java.lang.String link)
Display the Link of the News using the internal browser.

Parameters:
link - The valid link of the Newsitem to display.

displayNewsMetaInfo

private void displayNewsMetaInfo()
Display Title and link of the news


initComponents

private void initComponents()
Init all the components


isShowingNews

private boolean isShowingNews(NewsItem newsItem)
Check if the given NewsItem is currently being displayed

Parameters:
newsItem - The newsitem to check if being displayed
Returns:
boolean TRUE in case the newsitem is currently displayed

rebuildNewsText

private void rebuildNewsText()
Rebuild the newstext area


updateAccelerators

private void updateAccelerators()
Update the accelerators on the menuitems


checkWord

void checkWord(StyledText text)
Get the word from the position where the mouse is and check if the word is an URL. If an URL was found the setData() method of the StyledText is called and the URL is inserted as String. Otherwise the setData() method is called with NULL as argument.

Parameters:
text - StyledText to check the word

clearNewstext

void clearNewstext()
Empty the newstext viewform


displayNews

void displayNews(java.lang.String urlOrTitle,
                 java.lang.String newsTitle)
Display the selected news in the newstext-viewform

Parameters:
urlOrTitle - The URL / Path or Title of the RSS XML
newsTitle - Title of the selected news

onMouseMove

void onMouseMove(MouseEvent e)
Called whenever the mouse is moving

Parameters:
e - The occuring MouseEvent

onMouseUp

void onMouseUp(MouseEvent e)
Called whenever the mouse button was released

Parameters:
e - The occuring MouseEvent

rateNews

void rateNews(NewsItem rssNewsItem,
              int rateLevel)
AmphetaRate has been Disabled for now!

Parameters:
rssNewsItem - The newsitem to rate
rateLevel - The rating level

updateNewsTextComposite

void updateNewsTextComposite()
Update the newstext composite to either show Internal Browser or StyledText for the newstext



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo