com.icesoft.pdf.ri.util
Class PropertiesManager

java.lang.Object
  extended bycom.icesoft.pdf.ri.util.PropertiesManager

public class PropertiesManager
extends Object

This class provides a very basic Properties Management system for the viewer application. Settings such as window location and temporary file information is managed by this class.

Since:
1.0

Field Summary
static String DEFAULT_MESSAGE_BUNDLE
           
 
Constructor Summary
PropertiesManager(Properties sysProps, ResourceBundle messageBundle)
           
 
Method Summary
 boolean backupProperties()
           
 boolean getBoolean(String propertyName)
           
 boolean getBoolean(String propertyName, boolean defaultValue)
           
 String getDefaultFilePath()
           
 String getDefaultURL()
           
 double getDouble(String propertyName)
          Return a double value for the respective propertyName.
 double getDouble(String propertyName, double defaultValue)
          Return a double value for the respective propertyName.
 int getInt(String propertyName)
           
 int getInt(String propertyName, int defaultValue)
           
 long getLong(String propertyName)
           
 long getLong(String propertyName, long defaultValue)
           
 String getLookAndFeel(String propertyName, String defaultValue)
           
 InputStream getResourceAsStream(String prefix, String resourcePath)
           
 String getString(String propertyName)
           
 String getString(String propertyName, String defaultValue)
           
 String getSystemEncoding()
           
 void loadProperties()
           
static String makeResPath(String prefix, String base_name)
           
 void remove(String propertyName)
           
 void saveAndEnd()
           
 void saveProperties()
           
 void set(String propertyName, String value)
           
 void setBoolean(String propertyName, boolean value)
           
 void setDefaultFilePath(String defaultFilePath)
           
 void setDefaultURL(String defaultURL)
           
 void setDouble(String propertyName, double value)
           
 void setInt(String propertyName, int value)
           
 void setLong(String propertyName, long value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MESSAGE_BUNDLE

public static final String DEFAULT_MESSAGE_BUNDLE
See Also:
Constant Field Values
Constructor Detail

PropertiesManager

public PropertiesManager(Properties sysProps,
                         ResourceBundle messageBundle)
Method Detail

loadProperties

public void loadProperties()

saveAndEnd

public void saveAndEnd()

saveProperties

public void saveProperties()

backupProperties

public boolean backupProperties()

set

public void set(String propertyName,
                String value)

remove

public void remove(String propertyName)

getString

public String getString(String propertyName,
                        String defaultValue)

getString

public String getString(String propertyName)

getInt

public int getInt(String propertyName,
                  int defaultValue)

getInt

public int getInt(String propertyName)

setInt

public void setInt(String propertyName,
                   int value)

getDouble

public double getDouble(String propertyName,
                        double defaultValue)
Return a double value for the respective propertyName. If there is no propertyName then return the defaultValue.

Parameters:
propertyName - Name of property from the ICEdefault.properties file.
defaultValue - default value if the propertyNamecan not be found.
Returns:
double value of the propertyName.
Since:
6.0

getDouble

public double getDouble(String propertyName)
Return a double value for the respective propertyName.

Parameters:
propertyName - Name of property from the ICEdefault.properties file.
Returns:
double value of the propertyName
Since:
6.0

setDouble

public void setDouble(String propertyName,
                      double value)

getLong

public long getLong(String propertyName,
                    long defaultValue)

getLong

public long getLong(String propertyName)

setLong

public void setLong(String propertyName,
                    long value)

getBoolean

public boolean getBoolean(String propertyName,
                          boolean defaultValue)

getBoolean

public boolean getBoolean(String propertyName)

setBoolean

public void setBoolean(String propertyName,
                       boolean value)

getSystemEncoding

public String getSystemEncoding()

getLookAndFeel

public String getLookAndFeel(String propertyName,
                             String defaultValue)

getDefaultFilePath

public String getDefaultFilePath()

getDefaultURL

public String getDefaultURL()

setDefaultFilePath

public void setDefaultFilePath(String defaultFilePath)

setDefaultURL

public void setDefaultURL(String defaultURL)

getResourceAsStream

public InputStream getResourceAsStream(String prefix,
                                       String resourcePath)

makeResPath

public static String makeResPath(String prefix,
                                 String base_name)