Preferences Editor

de.jppietsch.util
Class RscBundle

java.lang.Object
  extended byjava.util.ResourceBundle
      extended byjava.util.ListResourceBundle
          extended byde.jppietsch.util.RscBundle
Direct Known Subclasses:
Rsc, Rsc

public abstract class RscBundle
extends ListResourceBundle

Convenient base class for resource bundles. It provides some convenience methods to access resource bundles and to create non-text resources.

Version:
$Revision: 1.9 $
Author:
Jan-Peter Pietsch

Nested Class Summary
 
Nested classes inherited from class java.util.ResourceBundle
 
Field Summary
static String ACCEL
           
static String CMD
           
private  Object[][] contents
           
protected static int DELETE
          Convenience constant to avoid import of KeyEvent.
protected static int F1
          Convenience constant to avoid import of KeyEvent.
protected static int F10
          Convenience constant to avoid import of KeyEvent.
protected static int F11
          Convenience constant to avoid import of KeyEvent.
protected static int F12
          Convenience constant to avoid import of KeyEvent.
protected static int F2
          Convenience constant to avoid import of KeyEvent.
protected static int F3
          Convenience constant to avoid import of KeyEvent.
protected static int F4
          Convenience constant to avoid import of KeyEvent.
protected static int F5
          Convenience constant to avoid import of KeyEvent.
protected static int F6
          Convenience constant to avoid import of KeyEvent.
protected static int F7
          Convenience constant to avoid import of KeyEvent.
protected static int F8
          Convenience constant to avoid import of KeyEvent.
protected static int F9
          Convenience constant to avoid import of KeyEvent.
static String ICON
           
protected static int INSERT
          Convenience constant to avoid import of KeyEvent.
static String LONG
           
static String MNEMO
           
static String NAME
          Suffix to build resource keys for text of buttons or menus.
static String SHORT
           
 
Fields inherited from class java.util.ListResourceBundle
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
RscBundle()
           
 
Method Summary
protected static KeyStroke accel(char aCharacter)
          Creates a key stroke which represents a control-key character.
protected static KeyStroke altAccel(int aKeyCode)
          Creates an alted key stroke..
protected abstract  Object[][] contents()
           
protected static KeyStroke ctrlAccel(int aKeyCode)
          Creates a control key stroke..
static RscBundle getBundle(Class aResourceBundleClass)
           
protected  Object[][] getContents()
           
 int getMnemonic(String aKeyPrefix)
          Returns a localized mnemonic.
 String getName(String aKeyPrefix)
          Returns a resource for a name of a button or menu.
protected  Icon icon(String aPngName)
           
private static int keyCode(char aCharacter)
           
protected static Integer mnemo(char aCharacter)
           
protected static KeyStroke shiftAccel(int aKeyCode)
          Creates a shifted key stroke..
 
Methods inherited from class java.util.ListResourceBundle
getKeys, handleGetObject
 
Methods inherited from class java.util.ResourceBundle
getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Suffix to build resource keys for text of buttons or menus.

See Also:
Constant Field Values

SHORT

public static final String SHORT
See Also:
Constant Field Values

LONG

public static final String LONG
See Also:
Constant Field Values

ICON

public static final String ICON
See Also:
Constant Field Values

CMD

public static final String CMD
See Also:
Constant Field Values

ACCEL

public static final String ACCEL
See Also:
Constant Field Values

MNEMO

public static final String MNEMO
See Also:
Constant Field Values

F1

protected static final int F1
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F2

protected static final int F2
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F3

protected static final int F3
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F4

protected static final int F4
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F5

protected static final int F5
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F6

protected static final int F6
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F7

protected static final int F7
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F8

protected static final int F8
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F9

protected static final int F9
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F10

protected static final int F10
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F11

protected static final int F11
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

F12

protected static final int F12
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

DELETE

protected static final int DELETE
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

INSERT

protected static final int INSERT
Convenience constant to avoid import of KeyEvent.

See Also:
Constant Field Values

contents

private Object[][] contents
Constructor Detail

RscBundle

public RscBundle()
Method Detail

getContents

protected final Object[][] getContents()

getBundle

public static RscBundle getBundle(Class aResourceBundleClass)

getName

public String getName(String aKeyPrefix)
Returns a resource for a name of a button or menu.

Parameters:
aKeyPrefix - from which the resource key is constructed by appending NAME.
Returns:
The localized name.
Throws:
MissingResourceException - If there is no such resource.

getMnemonic

public int getMnemonic(String aKeyPrefix)
Returns a localized mnemonic.

Parameters:
aKeyPrefix - from which the resource key is constructed by appending MNEMO.
Returns:
The localized mnemonic.
Throws:
MissingResourceException - If there is no such resource.

icon

protected Icon icon(String aPngName)

accel

protected static KeyStroke accel(char aCharacter)
Creates a key stroke which represents a control-key character.

Parameters:
aCharacter - to be pressed together with control.
Returns:
The resulting key stroke.

ctrlAccel

protected static KeyStroke ctrlAccel(int aKeyCode)
Creates a control key stroke..

Parameters:
aKeyCode - A key code like F1 or INSERT.
Returns:
The resulting key stroke.

altAccel

protected static KeyStroke altAccel(int aKeyCode)
Creates an alted key stroke..

Parameters:
aKeyCode - A key code like F1 or INSERT.
Returns:
The resulting key stroke.

shiftAccel

protected static KeyStroke shiftAccel(int aKeyCode)
Creates a shifted key stroke..

Parameters:
aKeyCode - A key code like F1 or INSERT.
Returns:
The resulting key stroke.

mnemo

protected static Integer mnemo(char aCharacter)

contents

protected abstract Object[][] contents()

keyCode

private static int keyCode(char aCharacter)

Preferences Editor