ice.ri.enhancedawt.browser
Class Preferences

java.lang.Object
  extended byice.ri.enhancedawt.browser.Preferences
All Implemented Interfaces:
Serializable

public class Preferences
extends Object
implements Serializable

This is the preferences class which stores in its singleton instance the current preferences of the user. When asked for, this class will serialize itself or refresh itself.

See Also:
Serialized Form

Field Summary
static int ALWAYS
          indicates that cookies should always be accepted
static int NEVER
          indicates that cookies should never be accepted
 
Constructor Summary
Preferences()
           
 
Method Summary
 String getAppName()
          Returns the emulation mode.
 int getCookieHandling()
          Returns the style that we handle cookies.
 String getHomePage()
          Returns the preferred homepage.
 String getHttpProxyHost()
          Returns the host to be used for the http proxy.
 String getHttpProxyPort()
          Returns the port to be used for the http proxy.
 String getHttpsProxyHost()
          Returns the host to be used for the https proxy.
 String getHttpsProxyPort()
          Returns the port to be used for the https proxy.
 boolean getLoadImages()
          Returns whether images should be loaded.
 String[] getNoProxies()
          Returns an arrary of domains NOT to be used as a proxy.
 String getSearchPage()
          Returns the preferred homepage.
 boolean isGifAnimation()
          Returns whether or not to animate gifs.
 boolean isModified()
          Method to check if the instance is different than the /last/ serialized file.
 boolean isUsingProxy()
          Returns whether or not to use a proxy.
 void setAllProps()
          Convenience method for setting all properties (below).
 void setAppName(String appName)
          Sets the emulation mode of the applicaton.
 void setCookieHandling(int ch)
          Sets the style of cookie handling.
 void setEmulationProps()
          This method sets the properties with respect to the emulation mode of the browser.
 void setGifAnimation(boolean anim)
          Sets whether or not to animate gifs.
 void setHomePage(String p_home)
          Sets the homepage in the preferences instance.
 void setHttpProxyHost(String host)
          Sets the http host to be used as a proxy.
 void setHttpProxyPort(String port)
          Sets the port to be used as a http proxy.
 void setHttpsProxyHost(String host)
          Sets the https host to be used as a proxy.
 void setHttpsProxyPort(String port)
          Sets the port to be used as a https proxy.
 void setLoadImages(boolean loadImages)
          Sets whether or not images should be loaded.
 void setMemoryProps()
          Sets the properties of the desired memory management.
 void setNoProxies(String[] nop)
          Sets an array of domains NOT to be used as a proxy.
 void setProxyProps()
          Sets the properties to be used by a proxy manager.
 void setSearchPage(String p_search)
          Sets the searchpage in the preferences instance.
 void setUsingProxy(boolean use)
          Sets whether or not to use a proxy.
 void write(ConfigurationManager configManager)
          Method to persist these preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALWAYS

public static final int ALWAYS
indicates that cookies should always be accepted

See Also:
Constant Field Values

NEVER

public static final int NEVER
indicates that cookies should never be accepted

See Also:
Constant Field Values
Constructor Detail

Preferences

public Preferences()
Method Detail

write

public void write(ConfigurationManager configManager)
Method to persist these preferences.


isModified

public boolean isModified()
Method to check if the instance is different than the /last/ serialized file.

Returns:
boolean indicates if a change has been made.

setHomePage

public void setHomePage(String p_home)
Sets the homepage in the preferences instance. null restores the default

Parameters:
p_home - The string representing the URL of the desired homepage.

getHomePage

public String getHomePage()
Returns the preferred homepage.

Returns:
Returns the string representation of the homepage URL

setSearchPage

public void setSearchPage(String p_search)
Sets the searchpage in the preferences instance. null restores the default

Parameters:
p_search - The string representation of the search URL

getSearchPage

public String getSearchPage()
Returns the preferred homepage.

Returns:
String the preferred search page.

setGifAnimation

public void setGifAnimation(boolean anim)
Sets whether or not to animate gifs.

Parameters:
anim - a boolean indicating to animate gifs.

isGifAnimation

public boolean isGifAnimation()
Returns whether or not to animate gifs.

Returns:
boolean true if gifs should be animated, false otherwise.

setCookieHandling

public void setCookieHandling(int ch)
Sets the style of cookie handling. -1 restores the default


getCookieHandling

public int getCookieHandling()
Returns the style that we handle cookies.

Returns:
int the desired cookie handling behaviour.

isUsingProxy

public boolean isUsingProxy()
Returns whether or not to use a proxy.

Returns:
boolean true if a proxy should be used, false otherwise.

setUsingProxy

public void setUsingProxy(boolean use)
Sets whether or not to use a proxy.


setAppName

public void setAppName(String appName)
Sets the emulation mode of the applicaton.


getAppName

public String getAppName()
Returns the emulation mode.

Returns:
the preferred emulation mode.

getHttpsProxyHost

public String getHttpsProxyHost()
Returns the host to be used for the https proxy.

Returns:
String the host to be used for https proxy.

getHttpProxyHost

public String getHttpProxyHost()
Returns the host to be used for the http proxy.

Returns:
String the host to be used for http proxy.

setHttpsProxyHost

public void setHttpsProxyHost(String host)
Sets the https host to be used as a proxy.


setHttpProxyHost

public void setHttpProxyHost(String host)
Sets the http host to be used as a proxy.


getHttpsProxyPort

public String getHttpsProxyPort()
Returns the port to be used for the https proxy.

Returns:
String the port to be used for proxy.

getHttpProxyPort

public String getHttpProxyPort()
Returns the port to be used for the http proxy.

Returns:
String the port to be used for proxy.

setHttpsProxyPort

public void setHttpsProxyPort(String port)
Sets the port to be used as a https proxy.


setHttpProxyPort

public void setHttpProxyPort(String port)
Sets the port to be used as a http proxy.


setNoProxies

public void setNoProxies(String[] nop)
Sets an array of domains NOT to be used as a proxy.

Parameters:
nop - a string array of domains not to be used.

getNoProxies

public String[] getNoProxies()
Returns an arrary of domains NOT to be used as a proxy.

Returns:
String[] of domains not to be used.

setLoadImages

public void setLoadImages(boolean loadImages)
Sets whether or not images should be loaded.


getLoadImages

public boolean getLoadImages()
Returns whether images should be loaded.

Returns:
boolean true if the images should be loaded, false otherwise.

setAllProps

public void setAllProps()
Convenience method for setting all properties (below).


setMemoryProps

public void setMemoryProps()
Sets the properties of the desired memory management. If not overridden on the command line, these can be over-ridden.


setProxyProps

public void setProxyProps()
Sets the properties to be used by a proxy manager.


setEmulationProps

public void setEmulationProps()
This method sets the properties with respect to the emulation mode of the browser.