APIdia Launch Partner
Top Description Fields Constructors Methods
sun.tools.jconsole

public final Class Resources

extends Object
Class Inheritance
Imports
java.awt.event.KeyEvent, java.lang.reflect.Field, .Modifier, java.text.MessageFormat, java.util.Collections, .IdentityHashMap, .Map, .MissingResourceException, .ResourceBundle

Toolkit that provides resource support for JConsole.

Field Summary

Modifier and TypeField and Description
private static Map<String, Integer>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static int

Returns:

the mnemonic as an int, or 0 if it can't be found.
findMnemonicInt
(String s)

Finds the mnemonic character in a message.

public static String

Returns:

a formatted string
format
(String
the pattern
pattern
,
Object... arguments)

Convenience method for MessageFormat#format(String, Object...).

private static String

Returns:

the message
getMessage
(ResourceBundle
the resource bundle
rb
,
String
the key
key
)

Returns the message corresponding to the key in the bundle or a text describing it's missing.

public static int

Returns:

the mnemonic int
getMnemonicInt
(String
the message
message
)

Returns the mnemonic for a message.

public static void
initializeMessages(Class<?>
the class containing the fields
clazz
,
String rbName)

Initializes all public static non-final fields in the given class with messages from a ResourceBundle.

private static boolean
private static int

Returns:

the mnemonic as an int, or 0 if it can't be found.
lookupMnemonicInt
(String
the character to lookup
c
)

Lookups the mnemonic for a key in the KeyEvent class.

private static String

Returns:

a message with the mnemonic identifier removed
removeMnemonicAmpersand
(String
the message
message
)

Removes the mnemonic identifier (&) from a string unless it's escaped by && or placed at the end.

private static String

Returns:

the replaced text
replaceWithPlatformLineFeed
(String
the to be replaced
text
)

Returns a String where all \n in the <text> have been replaced with the line separator for the platform.

private static void
setFieldValue(Field field, String value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MNEMONIC_LOOKUPback to summary
private static Map<String, Integer> MNEMONIC_LOOKUP

Constructor Detail

Resourcesback to summary
private Resources()

Method Detail

findMnemonicIntback to summary
private static int findMnemonicInt(String s)

Finds the mnemonic character in a message. The mnemonic character is the first character followed by the first & that is not followed by another &.

Returns:int

the mnemonic as an int, or 0 if it can't be found.

formatback to summary
public static String format(String pattern, Object... arguments)

Convenience method for MessageFormat#format(String, Object...).

Parameters
pattern:String

the pattern

Returns:String

a formatted string

getMessageback to summary
private static String getMessage(ResourceBundle rb, String key)

Returns the message corresponding to the key in the bundle or a text describing it's missing.

Parameters
rb:ResourceBundle

the resource bundle

key:String

the key

Returns:String

the message

getMnemonicIntback to summary
public static int getMnemonicInt(String message)

Returns the mnemonic for a message.

Parameters
message:String

the message

Returns:int

the mnemonic int

initializeMessagesback to summary
public static void initializeMessages(Class<?> clazz, String rbName)

Initializes all public static non-final fields in the given class with messages from a ResourceBundle.

Parameters
clazz:Class<?>

the class containing the fields

isWritableFieldback to summary
private static boolean isWritableField(Field field)
lookupMnemonicIntback to summary
private static int lookupMnemonicInt(String c)

Lookups the mnemonic for a key in the KeyEvent class.

Parameters
c:String

the character to lookup

Returns:int

the mnemonic as an int, or 0 if it can't be found.

removeMnemonicAmpersandback to summary
private static String removeMnemonicAmpersand(String message)

Removes the mnemonic identifier (&) from a string unless it's escaped by && or placed at the end.

Parameters
message:String

the message

Returns:String

a message with the mnemonic identifier removed

replaceWithPlatformLineFeedback to summary
private static String replaceWithPlatformLineFeed(String text)

Returns a String where all \n in the have been replaced with the line separator for the platform.

Parameters
text:String

the to be replaced

Returns:String

the replaced text

setFieldValueback to summary
private static void setFieldValue(Field field, String value)