net.sourceforge.rssowl.controller.panel
Class BrowserPanel

java.lang.Object
  extended bynet.sourceforge.rssowl.controller.panel.BrowserPanel

public class BrowserPanel
extends Object

This is the Web-Browser support for RSSOwl. It loads a Browser in a Composite and opens URLs.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
(package private)  org.eclipse.swt.browser.Browser browser
           
private  org.eclipse.swt.widgets.Composite browserPanel
           
private static String FEED_PROTOCOL_LONG
          The Long Feed Protocol URI Syntax
private static String FEED_PROTOCOL_SHORT
          The Short Feed Protocol URI Syntax
private  org.eclipse.swt.widgets.ToolItem itemBack
           
private  org.eclipse.swt.widgets.ToolItem itemDiscovery
           
private  org.eclipse.swt.widgets.ToolItem itemForward
           
private  org.eclipse.swt.widgets.ToolItem itemHome
           
private  org.eclipse.swt.widgets.ToolItem itemNewTab
           
private  org.eclipse.swt.widgets.ToolItem itemReload
           
private  org.eclipse.swt.widgets.ToolItem itemStop
           
private static String JAVA_SCRIPT_PRINT
          JavaScript command to print the current website of the Browser
(package private)  org.eclipse.swt.widgets.Text location
           
private  org.eclipse.swt.widgets.Composite parent
           
(package private)  org.eclipse.swt.custom.CTabItem parentTabItem
           
(package private)  GUI rssOwlGui
           
(package private)  String saveHome
           
private  boolean showControls
           
private  boolean showNewTabControl
           
(package private)  org.eclipse.swt.widgets.Label status
           
(package private)  org.eclipse.swt.widgets.Label statusProgressBar
           
 
Constructor Summary
BrowserPanel(GUI rssOwlGui, org.eclipse.swt.widgets.Composite parent, boolean showControls)
          Instantiate a new BrowserPanel
BrowserPanel(GUI rssOwlGui, org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.custom.CTabItem parentTabItem, boolean showControls, boolean showNewTabControl)
          Instantiate a new BrowserPanel
 
Method Summary
 void displayNews(NewsItem rssNewsItem)
          Display HTML formatted news
 void dispose()
          Dispose the browser
 org.eclipse.swt.browser.Browser getBrowser()
          Get the Browser widget
 org.eclipse.swt.widgets.Composite getBrowserPanel()
          Get the browser panel
 void hideNoControlsBrowser()
          Hide the Newstext Browser Panel
private  void initBrowser()
          Init the browser
private  void initBrowserNoControls()
          Create the browser to use with no controls
private  void initComponents()
          Init all components
private  void initComponentsNoControls()
          Init components without the controls
(package private)  void onProgressChange(org.eclipse.swt.browser.ProgressEvent event)
          Called whenever the Progress is changing
(package private)  void onProgressCompletion()
          Called whenever the Progress is completed
(package private)  void onStatusTextChange(org.eclipse.swt.browser.StatusTextEvent event)
          Called whenever the Status Text is changing
 void openUrl(String url)
          Open a new URL in the browser
 boolean print()
          Print the Browser using the JavaScript print() method
private  void setText(String text)
          Set HTML text to the browser
private  void setupFeedProtocolSupport(org.eclipse.swt.browser.Browser browser)
          Add Support for the Feed Protocol to the given Browser.
(package private)  void updateNavToolItems()
          Update "Back" and "Forward" tool items
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEED_PROTOCOL_LONG

private static final String FEED_PROTOCOL_LONG
The Long Feed Protocol URI Syntax

See Also:
Constant Field Values

FEED_PROTOCOL_SHORT

private static final String FEED_PROTOCOL_SHORT
The Short Feed Protocol URI Syntax

See Also:
Constant Field Values

JAVA_SCRIPT_PRINT

private static final String JAVA_SCRIPT_PRINT
JavaScript command to print the current website of the Browser

See Also:
Constant Field Values

browserPanel

private org.eclipse.swt.widgets.Composite browserPanel

itemBack

private org.eclipse.swt.widgets.ToolItem itemBack

itemDiscovery

private org.eclipse.swt.widgets.ToolItem itemDiscovery

itemForward

private org.eclipse.swt.widgets.ToolItem itemForward

itemHome

private org.eclipse.swt.widgets.ToolItem itemHome

itemNewTab

private org.eclipse.swt.widgets.ToolItem itemNewTab

itemReload

private org.eclipse.swt.widgets.ToolItem itemReload

itemStop

private org.eclipse.swt.widgets.ToolItem itemStop

parent

private org.eclipse.swt.widgets.Composite parent

showControls

private boolean showControls

showNewTabControl

private boolean showNewTabControl

browser

org.eclipse.swt.browser.Browser browser

location

org.eclipse.swt.widgets.Text location

parentTabItem

org.eclipse.swt.custom.CTabItem parentTabItem

rssOwlGui

GUI rssOwlGui

saveHome

String saveHome

status

org.eclipse.swt.widgets.Label status

statusProgressBar

org.eclipse.swt.widgets.Label statusProgressBar
Constructor Detail

BrowserPanel

public BrowserPanel(GUI rssOwlGui,
                    org.eclipse.swt.widgets.Composite parent,
                    boolean showControls)
Instantiate a new BrowserPanel

Parameters:
rssOwlGui - The maincontroller
parent - The parent composite
showControls - TRUE if the controls should be visible

BrowserPanel

public BrowserPanel(GUI rssOwlGui,
                    org.eclipse.swt.widgets.Composite parent,
                    org.eclipse.swt.custom.CTabItem parentTabItem,
                    boolean showControls,
                    boolean showNewTabControl)
Instantiate a new BrowserPanel

Parameters:
rssOwlGui - The maincontroller
parent - The parent composite
parentTabItem - The parent CTabItem containing the Browser if available
showControls - TRUE if the controls should be visible
showNewTabControl - TRUE if the "Open new Tab" button should be visible
Method Detail

displayNews

public void displayNews(NewsItem rssNewsItem)
Display HTML formatted news

Parameters:
rssNewsItem - News to display

dispose

public void dispose()
Dispose the browser


getBrowser

public org.eclipse.swt.browser.Browser getBrowser()
Get the Browser widget

Returns:
Browser The browser widget

getBrowserPanel

public org.eclipse.swt.widgets.Composite getBrowserPanel()
Get the browser panel

Returns:
Composite The browser panel

hideNoControlsBrowser

public void hideNoControlsBrowser()
Hide the Newstext Browser Panel


openUrl

public void openUrl(String url)
Open a new URL in the browser

Parameters:
url - URL of the webpage

print

public boolean print()
Print the Browser using the JavaScript print() method

Returns:
boolean TRUE in case of success, FALSE otherwise

initBrowser

private void initBrowser()
Init the browser


initBrowserNoControls

private void initBrowserNoControls()
Create the browser to use with no controls


initComponents

private void initComponents()
Init all components


initComponentsNoControls

private void initComponentsNoControls()
Init components without the controls


setText

private void setText(String text)
Set HTML text to the browser

Parameters:
text - HTML code

setupFeedProtocolSupport

private void setupFeedProtocolSupport(org.eclipse.swt.browser.Browser browser)
Add Support for the Feed Protocol to the given Browser.

Listen for changing Location and intercept the new location the Browser is about to navigate to. In case the new Location uses the Feed Protocol URI Syntax, parse the Feed's URL out of it and open the "New Favorite" dialog.

Parameters:
browser - The Browser to add the Feed Protocol Support.

onProgressChange

void onProgressChange(org.eclipse.swt.browser.ProgressEvent event)
Called whenever the Progress is changing

Parameters:
event - The ProgressEvent

onProgressCompletion

void onProgressCompletion()
Called whenever the Progress is completed


onStatusTextChange

void onStatusTextChange(org.eclipse.swt.browser.StatusTextEvent event)
Called whenever the Status Text is changing

Parameters:
event - The StatusTextEvent

updateNavToolItems

void updateNavToolItems()
Update "Back" and "Forward" tool items



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo