I18Npublic class I18N extends Object Set of convenience routines for internationalized code.
All convenience methods are static, for ease of use. |
Methods Summary |
---|
public static java.lang.String | getString(java.util.ResourceBundle b, java.lang.String name, java.lang.String dflt)Just get a String (for dialogs, labels, etc.)
String result;
try {
result = b.getString(name);
} catch (MissingResourceException e) {
result = dflt;
}
return result;
| public static javax.swing.JButton | mkButton(java.util.ResourceBundle b, java.lang.String name)Convenience routine to make a JButton
String label;
try { label = b.getString(name+".label"); }
catch (MissingResourceException e) { label=name; }
return new JButton(label);
| public static void | mkDialog(java.util.ResourceBundle b, javax.swing.JFrame parent, java.lang.String dialogTag, java.lang.String titleTag, int messageType)Show a JOptionPane message dialog
JOptionPane.showMessageDialog(
parent,
getString(b, dialogTag, "DIALOG TEXT MISSING " + dialogTag),
getString(b, titleTag, "DIALOG TITLE MISSING" + titleTag),
messageType);
| public static javax.swing.JMenu | mkMenu(java.util.ResourceBundle b, java.lang.String name)Convenience routine to make a JMenu
String menuLabel;
try { menuLabel = b.getString(name+".label"); }
catch (MissingResourceException e) { menuLabel=name; }
return new JMenu(menuLabel);
| public static javax.swing.JMenuItem | mkMenuItem(java.util.ResourceBundle b, java.lang.String menu, java.lang.String name)Convenience routine to make a JMenuItem
String miLabel;
try { miLabel = b.getString(menu + "." + name + ".label"); }
catch (MissingResourceException e) { miLabel=name; }
String key = null;
try { key = b.getString(menu + "." + name + ".key"); }
catch (MissingResourceException e) { key=null; }
if (key == null)
return new JMenuItem(miLabel);
else
return new JMenuItem(miLabel, key.charAt(0));
|
|