org.mozilla.jrex.ui
Class JRexResource
java.lang.Object
|
+--org.mozilla.jrex.ui.JRexResource
- public final class JRexResource
- extends Object
ResourceBundle helper class. The resource string can contain '&' and '@'
'&' is used to represent Mnemonic, the character immediately after '&' will become the Mnemonic.
'@' is used to represent Accelerator, the character immediately after '@' will become the Accelerator.
E.g. Property file entry
The Mnemonic will be 'N', Accelerator char will be 'B' and
Resource String will be 'New Window'
Note:- The ACCELCHAR '@' should be always at the end after Resource String
- Version:
- 1.0
- Author:
- C.N.Medappa
Method Summary |
static char |
getAccelerator(String resourceId)
Used to retrieve the mnemonic character of a string for a specified key from the resource file. |
static char |
getAcceleratorChar(String resStr)
Returns the character just after the ACCELCHAR symbol. |
static ImageIcon |
getIcon(String iconName)
Retrieves image icon for given image name |
static char |
getMnemonic(String resourceId)
Used to retrieve the mnemonic character of a string for a specified key from the resource file. |
static char |
getMnemonicChar(String resStr)
Returns the character just after the MNEMONICCHAR symbol. |
static String |
getString(String resourceId)
Used to retrieve a string for a specified key from the resource file,
the first occurrence of 'MNEMONICCHAR' is removed. |
static void |
showErrorMessage(Component parent,
String message,
boolean suppress)
An utility function to show information message. |
static void |
showFormattedWarningMessage(Component parent,
String message,
Object[] formatArray,
boolean suppress)
An utility function to show formatted warning message. |
static void |
showInfoMessage(Component parent,
String message,
boolean suppress)
An utility function to show information message. |
static void |
showWarningMessage(Component parent,
String message,
boolean suppress)
An utility function to show warning message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getString
public static String getString(String resourceId)
- Used to retrieve a string for a specified key from the resource file,
the first occurrence of 'MNEMONICCHAR' is removed.
This method is used to retrieve a string which is used for a mnemonic field.
The resource file has the form TestkeyResource.
- Parameters:
resourceId
- Key for the string to be loaded from the resource file.
- Returns:
- The requested string.
- See Also:
getMnemonic(java.lang.String)
getMnemonic
public static char getMnemonic(String resourceId)
- Used to retrieve the mnemonic character of a string for a specified key from the resource file.
The mnemonic character is marked by an leading ampersand
which is removed when retrieving the String with getString
- Parameters:
resourceId
- Key of the string to get the Mnemonic for.
- Returns:
- The mnemonic character of the string if found otherwise .
- See Also:
getString(java.lang.String)
getAccelerator
public static char getAccelerator(String resourceId)
- Used to retrieve the mnemonic character of a string for a specified key from the resource file.
The mnemonic character is marked by an leading ampersand
which is removed when retrieving the String with getString
- Parameters:
resourceId
- Key of the string to get the Mnemonic for.
- Returns:
- The mnemonic character of the string if found otherwise .
- See Also:
getString(java.lang.String)
getMnemonicChar
public static char getMnemonicChar(String resStr)
- Returns the character just after the MNEMONICCHAR symbol.
getAcceleratorChar
public static char getAcceleratorChar(String resStr)
- Returns the character just after the ACCELCHAR symbol.
getIcon
public static ImageIcon getIcon(String iconName)
- Retrieves image icon for given image name
- Parameters:
iconName
- name of the image file
- Returns:
- the imageicon for given iconName
showInfoMessage
public static void showInfoMessage(Component parent,
String message,
boolean suppress)
- An utility function to show information message.
- Parameters:
parent
- the parent for the message dialog.message
- the message to be shownsuppress
- true to suppress the information message dialog.
showWarningMessage
public static void showWarningMessage(Component parent,
String message,
boolean suppress)
- An utility function to show warning message.
- Parameters:
parent
- the parent for the message dialog.message
- the message to be shownsuppress
- true to suppress the warning message dialog.
showErrorMessage
public static void showErrorMessage(Component parent,
String message,
boolean suppress)
- An utility function to show information message.
- Parameters:
parent
- the parent for the message dialog.message
- the message to be shownsuppress
- true to suppress the error message dialog.
showFormattedWarningMessage
public static void showFormattedWarningMessage(Component parent,
String message,
Object[] formatArray,
boolean suppress)
- An utility function to show formatted warning message.
- Parameters:
parent
- the parent for the message dialog.message
- the message to be shownformatArray
- the message format parameters.suppress
- true to suppress the warning message dialog.
Copyright © 2004 C.N.Medappa. All Rights Reserved.