net.sourceforge.rssowl.dao
Class SettingsLoader

java.lang.Object
  extended bynet.sourceforge.rssowl.dao.SettingsLoader

public class SettingsLoader
extends Object

The SettingsLoader class is responsible to load all settings and favorites into RSSOwl.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  org.jdom.Element root
          The root element of the settings document
private  GUI rssOwlGui
          Main Controller
 
Constructor Summary
SettingsLoader(GUI rssOwlGui)
          Instantiate a new SettingsFactory
SettingsLoader(GUI rssOwlGui, org.jdom.Document document)
          Instantiate a new SettingsFactory with a Document
 
Method Summary
private  org.jdom.Document buildSettingsDocument()
          Build the document holding the settings of RSSOwl
 boolean getBoolean(String element, boolean init)
          Get the state of a value from the user.xml
 String getValue(String element, String attribute)
          Load a value from the XML settings document
 String getValue(String element, String attribute, String init)
          Load a value from the XML settings document
 String getValue(String element, String attribute, String init, boolean trim)
          Load a value from the XML settings document
private  Category loadCategory(Category rssOwlCategory, org.jdom.Element catOrFav)
          Load a category from the Element
 org.eclipse.swt.graphics.RGB loadColor(String element, org.eclipse.swt.graphics.RGB init)
          Load the color
private  Favorite loadFavorite(Category rssOwlCategory, org.jdom.Element catOrFav)
          Load a favorite from the Element
 void loadFavorites()
          Load user favorites and categorys in the RSSOwlFavTree.
private  void loadFavorites(Category rssOwlCategory, org.jdom.Element element)
          Load categories and favorites from the XML.
 org.eclipse.swt.graphics.Font loadFont(org.eclipse.swt.graphics.Font font, String fontName)
          Load a font from the settings
 void loadHotKeys()
          Load the hotkeys
 void loadProxySettings()
          Load the proxy settings
 void loadRatings()
          Load all ratings that have not yet been submitted
 void loadReopenFeeds()
          Load the feeds that RSSOwl shall reopen after application start.
 Hashtable loadSashWeights()
          Load weights of the SashForms
 Hashtable loadShellBounds()
          Load the bounds of the shell
 Vector loadSortOrder()
          Load the sort Order to apply to News
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private org.jdom.Element root
The root element of the settings document


rssOwlGui

private GUI rssOwlGui
Main Controller

Constructor Detail

SettingsLoader

public SettingsLoader(GUI rssOwlGui)
Instantiate a new SettingsFactory

Parameters:
rssOwlGui - The Main Controller

SettingsLoader

public SettingsLoader(GUI rssOwlGui,
                      org.jdom.Document document)
Instantiate a new SettingsFactory with a Document

Parameters:
rssOwlGui - The Main Controller
document - The configuration XML
Method Detail

getBoolean

public boolean getBoolean(String element,
                          boolean init)
Get the state of a value from the user.xml

Parameters:
element - The Name of the Element
init - Initial value
Returns:
boolean TRUE or FALSE

getValue

public String getValue(String element,
                       String attribute)
Load a value from the XML settings document

Parameters:
element - The element's name
attribute - The attribute's name
Returns:
String The value of the attribute or the init String

getValue

public String getValue(String element,
                       String attribute,
                       String init)
Load a value from the XML settings document

Parameters:
element - The element's name
attribute - The attribute's name
init - The initial value if attribute is not found
Returns:
String The value of the attribute or the init String

getValue

public String getValue(String element,
                       String attribute,
                       String init,
                       boolean trim)
Load a value from the XML settings document

Parameters:
element - The element's name
attribute - The attribute's name
init - The initial value if attribute is not found
trim - If TRUE the text is trimmed
Returns:
String The value of the attribute or the init String

loadColor

public org.eclipse.swt.graphics.RGB loadColor(String element,
                                              org.eclipse.swt.graphics.RGB init)
Load the color

Parameters:
element - The element's name
init - Init value if Color is null
Returns:
RGB The color

loadFavorites

public void loadFavorites()
Load user favorites and categorys in the RSSOwlFavTree.


loadFont

public org.eclipse.swt.graphics.Font loadFont(org.eclipse.swt.graphics.Font font,
                                              String fontName)
Load a font from the settings

Parameters:
font - The Font to load
fontName - The name of the font
Returns:
Font loaded from the settings

loadHotKeys

public void loadHotKeys()
Load the hotkeys


loadProxySettings

public void loadProxySettings()
Load the proxy settings


loadRatings

public void loadRatings()
Load all ratings that have not yet been submitted


loadReopenFeeds

public void loadReopenFeeds()
Load the feeds that RSSOwl shall reopen after application start.


loadSashWeights

public Hashtable loadSashWeights()
Load weights of the SashForms

Returns:
Hashtable With the sash weights

loadShellBounds

public Hashtable loadShellBounds()
Load the bounds of the shell

Returns:
The Bounds of the shell

loadSortOrder

public Vector loadSortOrder()
Load the sort Order to apply to News

Returns:
Vector A vector containing the sort order

buildSettingsDocument

private org.jdom.Document buildSettingsDocument()
Build the document holding the settings of RSSOwl

Returns:
Document The XML document holding the settings

loadCategory

private Category loadCategory(Category rssOwlCategory,
                              org.jdom.Element catOrFav)
Load a category from the Element

Parameters:
rssOwlCategory - The parent category
catOrFav - The element to load the category from
Returns:
Favorite A new category loaded from the element

loadFavorite

private Favorite loadFavorite(Category rssOwlCategory,
                              org.jdom.Element catOrFav)
Load a favorite from the Element

Parameters:
rssOwlCategory - The parent category
catOrFav - The element to load the favorite from
Returns:
Favorite A new favorite loaded from the element

loadFavorites

private void loadFavorites(Category rssOwlCategory,
                           org.jdom.Element element)
Load categories and favorites from the XML. This method is called recursivly to support nested categorys.

Parameters:
rssOwlCategory - Current working category
element - Current working element


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo