ResourceSvc
Method Summary |
public |
|
public | |
public | |
public | |
public | |
public |
|
public | |
public |
|
public |
|
public |
|
public | |
public | |
public |
|
public |
|
Method Detail |
publicFind a string by full ID. Note that this method differs from getString in that it does not assert if the string cannot be found e.g. "strings.workshop.shell.dialog.file.Title"String
findString(String
sStringId)
publicGet a formatted string resource from full string ID. e.g. "strings.workshop.shell.dialog.file.error1"String
format(String
sStringId,Object
[] args)
Related Topics
MessageFormat.format(String, Object[])
publicGet a formatted string resource using same rules as resource pacakage e.g. "strings.String
format(Class
c,String
file,String
id,Object
[] args)
Related Topics
MessageFormat.format(String, Object[])
publicGet an icon by full path.Icon
getIcon(String
sImageId)
publicGet an image by full path.Image
getImage(String
sImageId)
publicObtain an input stream for the given resource.InputStream
getInputStream(String
sResourcePath)
publicObtain a reader for a given resource. This essentially obtains an input stream and converts it to a Reader. The method calls FileSvc.get().getReaderForStream() which will attempt to determine the correct charset encoding to use. If you wish to use a custom encoding, call getInputStream and use the InputStreamReader class to convert it to a reader.Reader
getReader(String
sResourcePath)
publicGet a resource package given a full path to the properties file (not including '.properties' extension) or a resource directory e.g. "strings.workshop.shell.dialog.file"ResourceSvc.IResourcePkg
getResourcePackage(String
sPrefix)
Related Topics
publicGet a resource package given an object and a properties file name (not including '.properties' extension). This method inspects the Object to get a package name and derives the full package name as follows. strings.ResourceSvc.IResourcePkg
getResourcePackage(Object
o,String
file)
Related Topics
publicGet a resource package given a class and a properties file name (not including '.properties' extension). This method derives the full package name as follows: strings.ResourceSvc.IResourcePkg
getResourcePackage(Class
c,String
file)
Related Topics
publicGet a string by full ID. This method will assert if the string is not found. This will help catch cases where someone has left out a string. If it is possible to not have the string and still have a valid scenario, you should use findString instead. e.g. "strings.workshop.shell.dialog.file.Title"String
getString(String
sStringId)
publicGet a string using the class and properties file name This method derives the full package name as follows: strings.<PACKAGE>.file.idString
getString(Class
c,String
file,String
id)
publicConverts all instances of '\n' to operating-system specific line endings. It is the callers responsibility to ensure that the string provided has been correctly normalized.String
toOSSeparators(String
str)
publicConverts all newlines to operating-system specific line endings. If the normalize flag is set, the text will be normalized first.String
toOSSeparators(String
str, boolean normalizeFirst)