net.sourceforge.rssowl.controller
Class GUI

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

public class GUI
extends java.lang.Object
implements ITranslatable

This is RSSOwl's Main controller. All GUI Elements are registered in here and getter Methods are provided so that other Classes are able to access and use them. All settings are loaded in here.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
(package private)  ArchiveManager archiveManager
           
private  Composite boxContainer
           
static Display display
          A lot of other obj have to access display
(package private)  EventManager eventManager
           
static java.lang.String FOCUSLESS_SCROLL_HOOK
          Key for Data-Slot in Controls that support this Hook
private  SashForm holdContentSash
           
private  SashForm holdNewsSash
           
static RSSOwlI18n i18n
          Internationalization for RSSOwl
static boolean isClosing
          Flag is set to TRUE when RSSOwl is exiting
static LoggerImpl logger
          Log all catched Exceptions
private static java.lang.String NATIVE_SCROLL_PROPERTY
          DWord to disable the use of the focusless Scrolling on Windows
private  AmphetaRateThread rssOwlAmphetaRate
           
private  CryptoManager rssOwlCryptoManager
           
(package private)  FavoritesTree rssOwlFavoritesTree
           
private  FeedAutoUpdater rssOwlFeedAutoUpdater
           
(package private)  FeedCacheManager rssOwlFeedCacheManager
           
private  FeedQueueLoader rssOwlFeedQueueLoader
           
static GUI rssOwlGui
          For classes who needs to access the MainController
private  RSSOwlMenu rssOwlMenu
           
(package private)  NewsTabFolder rssOwlNewsTabFolder
           
private  NewsText rssOwlNewsText
           
private  Quickview rssOwlQuickView
           
(package private)  StatusLine rssOwlStatusLine
           
private  SystemTray rssOwlSystray
           
private  SettingsManager settingsManager
           
static Shell shell
          A lot of other obj have to access shell
private static java.lang.String SWT_BROWSER_WIN
          WebSite class being used for the Browser on Windows only
 
Constructor Summary
GUI(Display display, Shell splashShell)
          Instantiate a new GUI
 
Method Summary
 void abnormalShutDown()
          This method is called from the Shutdown Hook Thread in case RSSOwl was shut down not the normal way (e.g. the OS is shutting down).
 void changeWindowLayout()
          Change the window layout between 2 and 3 column window layout
 void displayNewsfeed(Channel rssChannel, java.lang.String url, SearchDefinition searchDefinition, boolean reselectNews, int displayMode)
          Display the selected newsfeed in the TabFolder
 void enableSystrayIcon(boolean enabled)
          Enable / Disable Systray Icon for RSSOwl
 ArchiveManager getArchiveManager()
          Get the archive manager for RSSOwl
 SashForm getContentSash()
          Get the SashForm containing the Content.
 EventManager getEventManager()
          Get the event manager for RSSOwl.
 FeedCacheManager getFeedCacheManager()
          Get the feed cache manager
 SashForm getNewsSash()
          Get the SashForm containing the News.
 AmphetaRateThread getRSSOwlAmphetaRate()
          Let other objects access this thread
 FavoritesTree getRSSOwlFavoritesTree()
          Method to let other obj access this object
 FeedQueueLoader getRSSOwlFeedQueueLoader()
          Let other objects access this thread
 RSSOwlMenu getRSSOwlMenu()
          Method to let other obj access this object
 NewsTabFolder getRSSOwlNewsTabFolder()
          Get the NewsTabFolder displaying newsfeeds
 NewsText getRSSOwlNewsText()
          Get the NewsText composite
 Quickview getRSSOwlQuickview()
          Get the RSSOwl quickview control
 StatusLine getRSSOwlStatusLine()
          Get the StatusLine control
 SystemTray getRSSOwlSystray()
          Get the SystemTray object
private  void initComponents()
          Init all components
static boolean isAlive()
          This method is called to check if RSSOwl is still alive or was just closed by the user.
 boolean isBusyLoading()
          Check if RSSOwl is currently busy loading a newsfeed or aggregation.
 void loadNewsFeed(java.lang.String url, SearchDefinition searchDefinition, boolean displayNewsfeed, boolean reselectNews, int displayMode)
          Load a News feed.
(package private)  void onClose(Event event)
          Called when the Shell is closed
(package private)  void onClose(Event event, boolean forceExit)
          Called when the Shell is closed.
(package private)  void onDispose()
          Called when the Shell is disposed
(package private)  void onIconify()
          Called when the Shell is Iconified
 void reloadNewsFeed(java.lang.String url)
          Re-Load a news feed
 void restoreWindow()
          Restore the application window either from taskbar or the tray.
private  void runEventLoop()
          Runs the event loop for RSSOwl
 void setFavoritesMinimized(boolean minimize, boolean save)
          Set the state of the favorites Tree with setting the maximized control of the holdContentSash.
(package private)  void showGui()
          Open RSSOwl shell
(package private)  void shutDown()
          Shut down RSSOwl and perform some actions before closing
private  void startUp()
          Startup process of RSSOwl (called once at start)
(package private)  void updateCoreSettings(SettingsLoader settingsLoader, boolean isHotLoad)
          Update core settings of RSSOwl that need to be loaded first
 void updateI18N()
          Update all controlls text with i18n
(package private)  void updateUserSettings(SettingsLoader settingsLoader, boolean isHotLoad)
          Update some user settings from the "user.xml"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

public static Display display
A lot of other obj have to access display


i18n

public static RSSOwlI18n i18n
Internationalization for RSSOwl


isClosing

public static boolean isClosing
Flag is set to TRUE when RSSOwl is exiting


logger

public static LoggerImpl logger
Log all catched Exceptions


rssOwlGui

public static GUI rssOwlGui
For classes who needs to access the MainController


shell

public static Shell shell
A lot of other obj have to access shell


SWT_BROWSER_WIN

private static final java.lang.String SWT_BROWSER_WIN
WebSite class being used for the Browser on Windows only

See Also:
Constant Field Values

FOCUSLESS_SCROLL_HOOK

public static final java.lang.String FOCUSLESS_SCROLL_HOOK
Key for Data-Slot in Controls that support this Hook

See Also:
Constant Field Values

NATIVE_SCROLL_PROPERTY

private static final java.lang.String NATIVE_SCROLL_PROPERTY
DWord to disable the use of the focusless Scrolling on Windows

See Also:
Constant Field Values

boxContainer

private Composite boxContainer

holdContentSash

private SashForm holdContentSash

holdNewsSash

private SashForm holdNewsSash

rssOwlAmphetaRate

private AmphetaRateThread rssOwlAmphetaRate

rssOwlCryptoManager

private CryptoManager rssOwlCryptoManager

rssOwlFeedAutoUpdater

private FeedAutoUpdater rssOwlFeedAutoUpdater

rssOwlFeedQueueLoader

private FeedQueueLoader rssOwlFeedQueueLoader

rssOwlMenu

private RSSOwlMenu rssOwlMenu

rssOwlNewsText

private NewsText rssOwlNewsText

rssOwlQuickView

private Quickview rssOwlQuickView

rssOwlSystray

private SystemTray rssOwlSystray

settingsManager

private SettingsManager settingsManager

archiveManager

ArchiveManager archiveManager

eventManager

EventManager eventManager

rssOwlFavoritesTree

FavoritesTree rssOwlFavoritesTree

rssOwlFeedCacheManager

FeedCacheManager rssOwlFeedCacheManager

rssOwlNewsTabFolder

NewsTabFolder rssOwlNewsTabFolder

rssOwlStatusLine

StatusLine rssOwlStatusLine
Constructor Detail

GUI

public GUI(Display display,
           Shell splashShell)
Instantiate a new GUI

Parameters:
display - The display
splashShell - The shell holding the splash
Method Detail

isAlive

public static boolean isAlive()
This method is called to check if RSSOwl is still alive or was just closed by the user.

Returns:
boolean TRUE if RSSOwl is still running

abnormalShutDown

public void abnormalShutDown()
This method is called from the Shutdown Hook Thread in case RSSOwl was shut down not the normal way (e.g. the OS is shutting down).
It is not guaranteed, that this method will be executed in any case.


changeWindowLayout

public void changeWindowLayout()
Change the window layout between 2 and 3 column window layout


displayNewsfeed

public void displayNewsfeed(Channel rssChannel,
                            java.lang.String url,
                            SearchDefinition searchDefinition,
                            boolean reselectNews,
                            int displayMode)
Display the selected newsfeed in the TabFolder

Parameters:
rssChannel - The newsfeed to display
url - URL / Path to the RSS XML
searchDefinition - Pattern and Scope of the Search.
reselectNews - Wether to reselect an already selected news
displayMode - One of the supported display modes

enableSystrayIcon

public void enableSystrayIcon(boolean enabled)
Enable / Disable Systray Icon for RSSOwl

Parameters:
enabled - TRUE if enabled

getArchiveManager

public ArchiveManager getArchiveManager()
Get the archive manager for RSSOwl

Returns:
Returns the archiveManager.

getContentSash

public SashForm getContentSash()
Get the SashForm containing the Content.

Returns:
SashForm containing the Content.

getEventManager

public EventManager getEventManager()
Get the event manager for RSSOwl.

Returns:
Returns the eventManager.

getFeedCacheManager

public FeedCacheManager getFeedCacheManager()
Get the feed cache manager

Returns:
RSSOwlFeedCachManager The cache manager

getNewsSash

public SashForm getNewsSash()
Get the SashForm containing the News.

Returns:
SashForm containing the News.

getRSSOwlAmphetaRate

public AmphetaRateThread getRSSOwlAmphetaRate()
Let other objects access this thread

Returns:
AmphetaRateThread Submit Thread

getRSSOwlFavoritesTree

public FavoritesTree getRSSOwlFavoritesTree()
Method to let other obj access this object

Returns:
FavoritesTree The tree holding all favorites

getRSSOwlFeedQueueLoader

public FeedQueueLoader getRSSOwlFeedQueueLoader()
Let other objects access this thread

Returns:
Returns the rssOwlFeedQueueLoader.

getRSSOwlMenu

public RSSOwlMenu getRSSOwlMenu()
Method to let other obj access this object

Returns:
RSSOwlMenu

getRSSOwlNewsTabFolder

public NewsTabFolder getRSSOwlNewsTabFolder()
Get the NewsTabFolder displaying newsfeeds

Returns:
NewsTabFolder

getRSSOwlNewsText

public NewsText getRSSOwlNewsText()
Get the NewsText composite

Returns:
NewsText

getRSSOwlQuickview

public Quickview getRSSOwlQuickview()
Get the RSSOwl quickview control

Returns:
Quickview

getRSSOwlStatusLine

public StatusLine getRSSOwlStatusLine()
Get the StatusLine control

Returns:
Returns the rssOwlStatusLine.

getRSSOwlSystray

public SystemTray getRSSOwlSystray()
Get the SystemTray object

Returns:
SystemTray The system tray implementation for RSSOwl

isBusyLoading

public boolean isBusyLoading()
Check if RSSOwl is currently busy loading a newsfeed or aggregation.

Returns:
boolean TRUE if RSSOwl is busy loading

loadNewsFeed

public void loadNewsFeed(java.lang.String url,
                         SearchDefinition searchDefinition,
                         boolean displayNewsfeed,
                         boolean reselectNews,
                         int displayMode)
Load a News feed. The loading is done in a Thread to enable cancle of the loading via a button in the status line.

Parameters:
url - URL / Path to the feed
searchDefinition - Pattern and Scope of the Search.
displayNewsfeed - TRUE if newsfeed should be displayed
reselectNews - Wether to reselect a selected news
displayMode - One of the supported displaymodes

reloadNewsFeed

public void reloadNewsFeed(java.lang.String url)
Re-Load a news feed

Parameters:
url - URL to the newsfeed

restoreWindow

public void restoreWindow()
Restore the application window either from taskbar or the tray.


setFavoritesMinimized

public void setFavoritesMinimized(boolean minimize,
                                  boolean save)
Set the state of the favorites Tree with setting the maximized control of the holdContentSash.

Parameters:
minimize - If TRUE minimize the favorites tree
save - If TRUE save the state to GlobalSettings

updateI18N

public void updateI18N()
Update all controlls text with i18n

Specified by:
updateI18N in interface ITranslatable

initComponents

private void initComponents()
Init all components


runEventLoop

private void runEventLoop()
Runs the event loop for RSSOwl


startUp

private void startUp()
Startup process of RSSOwl (called once at start)


onClose

void onClose(Event event)
Called when the Shell is closed

Parameters:
event - The occuring Event

onClose

void onClose(Event event,
             boolean forceExit)
Called when the Shell is closed. If boolean parameter forceExit is set to TRUE, RSSOwl will exit, even if "Minimize to Tray on Exit" is set to TRUE. This forced exit is called when the user has pressed the "Exit" menuitem from the "File" menu.

Parameters:
event - The occuring Event
forceExit - If TRUE, force RSSOwl to exit

onDispose

void onDispose()
Called when the Shell is disposed


onIconify

void onIconify()
Called when the Shell is Iconified


showGui

void showGui()
Open RSSOwl shell


shutDown

void shutDown()
Shut down RSSOwl and perform some actions before closing


updateCoreSettings

void updateCoreSettings(SettingsLoader settingsLoader,
                        boolean isHotLoad)
Update core settings of RSSOwl that need to be loaded first

Parameters:
settingsLoader - The settings parser to use
isHotLoad - TRUE if the settings are imported by the user from the running program

updateUserSettings

void updateUserSettings(SettingsLoader settingsLoader,
                        boolean isHotLoad)
Update some user settings from the "user.xml"

Parameters:
settingsLoader - The settings parser to use
isHotLoad - TRUE if the settings are imported by the user from the running program


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo