uk.ac.man.bioinf.util
Class ResourceAdapter

java.lang.Object
  |
  +--uk.ac.man.bioinf.util.ResourceAdapter
Direct Known Subclasses:
PackageResourceAdapter

public class ResourceAdapter
extends Object

Generic class for locating resources within an application/applet's package hierarchy. Resources are defined in a locale specific property file according to the conventions defined in ResourceBundle. For URLs, looks up the appropriate path in the specified property file, and then uses that to retrieve a pointer to it.

Version:
1.0
Author:
C.Miller

Field Summary
protected  ResourceBundle bundle
           
protected  Locale defaultLocale
           
protected  String props
           
 
Constructor Summary
ResourceAdapter()
           
ResourceAdapter(String propertyFile)
           
 
Method Summary
 File getFile(String fileDescriptor)
          property is file. value should be path to the image
 URL getHelpURL(String helpURLName)
          property is helpURL.
 URL getImageURL(String imageName)
          property is image. value should be path to the image
 String getMessageString(String messageName)
          property is message.
 String getTextString(String descriptor)
          property is string. value should be a String
 String getToolTip(String tooltipName)
          property is tooltip.
 URL getURL(String URLDescriptor)
          property is url. value should be a URL
protected  void init()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultLocale

protected Locale defaultLocale

bundle

protected ResourceBundle bundle

props

protected String props
Constructor Detail

ResourceAdapter

public ResourceAdapter()

ResourceAdapter

public ResourceAdapter(String propertyFile)
                throws IOException
Method Detail

init

protected void init()
             throws IOException
IOException

getMessageString

public String getMessageString(String messageName)
property is message.


getToolTip

public String getToolTip(String tooltipName)
property is tooltip.


getHelpURL

public URL getHelpURL(String helpURLName)
property is helpURL.


getImageURL

public URL getImageURL(String imageName)
property is image. value should be path to the image


getFile

public File getFile(String fileDescriptor)
property is file. value should be path to the image


getURL

public URL getURL(String URLDescriptor)
property is url. value should be a URL


getTextString

public String getTextString(String descriptor)
property is string. value should be a String