public class SwingDecorator extends Object
myButton.text=Hello
myButton.tooltip=just an example
myButton.icon=myImage
The code to initialize the button would be something like:
JButton b= new JButton();
b.setName("button");
SwingDecorator.initilize(b, "myButton");
Modifier and Type | Field and Description |
---|---|
static String |
ACCELERATOR_SUFFIX
Suffix for Accelerators
|
static String |
ICON_MODIFIER_DISABLED
Suffix for the disabled icon
|
static String |
ICON_MODIFIER_NORMAL
Suffix for the normal icon
|
static String |
ICON_MODIFIER_PRESSED
Suffix for the pressed icon
|
static String |
ICON_MODIFIER_ROLLOVER
Suffix for the rollover icon
|
static String |
ICON_MODIFIER_SMALL
Suffix for the small icon
|
static String |
ICON_PREFIX
Prefix for the the icon files
|
static String |
ICON_SUFFIX1
Suffix1 for the the icon files
|
static String |
ICON_SUFFIX2
Suffix2 for the the icon files
|
static String |
ICONNAME_SUFFIX
Suffix for icon (file) names
|
static String |
MNEMONIC_SUFFIX
Suffic for Mnemonics
|
static String |
TEXT_SUFFIX
Suffix for text
|
static String |
TITLE_SUFFIX
Suffix for JFrame and JDialog titles
|
static String |
TOOLTIP_SUFFIX
Suffix for Tooltips
|
Modifier and Type | Method and Description |
---|---|
static void |
addBundle(ResourceBundle pResourceBundle)
Adds all non-null String key/value pairs of a bundle to
the SwingDecorator singleton.
|
static void |
addBundle(String pBaseName)
Adds a property file to SwingDecorator, see ResourceBundle.getBundle() for
the details how the property file is found.
|
static KeyStroke |
getAccelerator(String pI18nID)
Returns null or a accelerator KeyStroke for the handed key.
|
static Icon |
getIcon(String pI18nID)
Returns the normal Icon for the handed key or null.
|
static ImageIcon |
getIcon(String pI18nID,
String pIconModifier)
Loads an Icon for the handed key and modifier.
|
static Character |
getMnemonic(String pI18nID)
Returns null or a Character that is the mnemonic for the handed key.
|
static String |
getText(String pI18nID)
Returns the I18n text matching the handed key.
|
static String |
getText(String pI18nID,
Object[] pParams)
Returns the I18n text matching the handed key and parameters.
|
static String |
getTitle(String pI18nID)
Returns the I18n title matching the handed key.
|
static String |
getTitle(String pI18nID,
Object[] pParams)
Returns the I18n title matching the handed key and parameters.
|
static String |
getToolTip(String pI18nID,
Object[] pParams)
Returns the I18n tool tip matching the handed key and parameters.
|
static void |
initialize(Component pComponent,
String pI18nID)
Decorates a widget by an I18n key.
|
static void |
initialize(Component pComponent,
String pI18nID,
Object[] pParams)
Decorates a widget by an I18n key.
|
public static final String TITLE_SUFFIX
public static final String TEXT_SUFFIX
public static final String MNEMONIC_SUFFIX
public static final String ACCELERATOR_SUFFIX
public static final String TOOLTIP_SUFFIX
public static final String ICONNAME_SUFFIX
public static final String ICON_PREFIX
public static final String ICON_SUFFIX1
public static final String ICON_SUFFIX2
public static final String ICON_MODIFIER_NORMAL
public static final String ICON_MODIFIER_DISABLED
public static final String ICON_MODIFIER_PRESSED
public static final String ICON_MODIFIER_ROLLOVER
public static final String ICON_MODIFIER_SMALL
public static void addBundle(String pBaseName)
pBaseName
- base name of the resource bundlepublic static void addBundle(ResourceBundle pResourceBundle)
pResourceBundle
- the resource bundle to add, must not be nullpublic static String getText(String pI18nID)
pI18nID
- I18n keypublic static String getText(String pI18nID, Object[] pParams)
pI18nID
- I18n keypParams
- parameters for the messagepublic static String getToolTip(String pI18nID, Object[] pParams)
pI18nID
- I18n keypParams
- parameters for the messagepublic static String getTitle(String pI18nID)
pI18nID
- I18n keypublic static String getTitle(String pI18nID, Object[] pParams)
pI18nID
- I18n keypParams
- parameters for the messagepublic static Character getMnemonic(String pI18nID)
pI18nID
- I18n keypublic static KeyStroke getAccelerator(String pI18nID)
pI18nID
- I18n keypublic static Icon getIcon(String pI18nID)
pI18nID
- I18n keypublic static ImageIcon getIcon(String pI18nID, String pIconModifier)
pI18nID
- I18n keypIconModifier
- modifier for the icon namepublic static void initialize(Component pComponent, String pI18nID)
pComponent
- das Widget, das initialisiert werden sollpI18nID
- I18n keyCopyright © 2017 Jürgen Zeller (privat). All rights reserved.