Skip navigation links


com.essbase.eas.i18n
Class LocalizeUtils

java.lang.Object
  extended by com.essbase.eas.i18n.LocalizeUtils


public class LocalizeUtils
extends java.lang.Object

Implements some static methods for supporting internationalization efforts.

Note:

08/21/2000, hcox: Begin with localizeWindow() method. 08/27/2000, hcox: Add localizeMenu() method.

Version:
1.00, 08/21/2000
Author:
Hank Cox

Method Summary
static java.awt.Component localizeComponent(java.lang.Class<?> clazz, java.awt.Component component)
           
static java.awt.Component localizeComponent(java.util.ResourceBundle[] r, java.awt.Component component)
           
static java.awt.Component localizeComponent(java.util.ResourceBundle r, java.awt.Component component)
          The method localizes, the component passed to it by setting whatever is applicable from the following for it.
static void localizeComponents(java.util.ResourceBundle[] r, java.awt.Component[] components)
           
static void localizeComponents(java.util.ResourceBundle r, java.awt.Component[] components)
          applies standard localization procedures to a list of components.
static boolean localizeMenu(java.util.ResourceBundle[] r, java.awt.Component component)
           
static boolean localizeMenu(java.util.ResourceBundle[] r, java.awt.Component[] components)
           
static boolean localizeMenu(java.util.ResourceBundle r, java.awt.Component component)
          applies standard localization procedures to an array of menu items.
static boolean localizeMenu(java.util.ResourceBundle r, java.awt.Component[] components)
          applies standard localization procedures to an array of menu items.
static void localizeTab(java.util.ResourceBundle[] r, javax.swing.JTabbedPane tab)
           
static void localizeTab(java.util.ResourceBundle r, javax.swing.JTabbedPane tab)
          This method is used to localize a JTabbedPane.
static void localizeTable(java.util.ResourceBundle r, java.awt.Component component)
          This method is used to localize the table column names.
static void localizeTreeNodes(java.util.ResourceBundle r, java.lang.Object[] nodeArray)
          applies standard localization procedures to TreeNodes.
static void localizeWindow(java.util.ResourceBundle r, java.awt.Component withTitle, java.awt.Component[] components)
          applies standard localization procedures to a console window.
static void setDisplayedMnemonicIndex(javax.swing.AbstractButton comp)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

localizeTreeNodes

public static void localizeTreeNodes(java.util.ResourceBundle r,
                                     java.lang.Object[] nodeArray)
applies standard localization procedures to TreeNodes. Uses introspection to perform the following steps:

Notes:

02/12/2001, Namita:

Parameters:
r - - resource bundle to use.
components - - array of components to localize. We use introspection to call the getCaption() method, use that value as the key into the resource bundle, and update the component via setCaption(). Valid for tree nodes.

localizeMenu

public static boolean localizeMenu(java.util.ResourceBundle r,
                                   java.awt.Component[] components)
applies standard localization procedures to an array of menu items. Uses introspection to perform the following steps:

Notes:

08/27/2000, hcox: This method should be used instead of the MenuUtils class.

Parameters:
r - - resource bundle to use.
components - - array of components to localize. We use introspection to call the getText() method, use that value as the key into the resource bundle, and update the component via setText(). Valid Swing components for this JMenu, JMenuItem, JPopupMenu.

localizeMenu

public static boolean localizeMenu(java.util.ResourceBundle[] r,
                                   java.awt.Component[] components)

localizeMenu

public static boolean localizeMenu(java.util.ResourceBundle r,
                                   java.awt.Component component)
applies standard localization procedures to an array of menu items. Uses introspection to perform the following steps:

Notes:

08/27/2000, hcox: This method should be used instead of the MenuUtils class.

Parameters:
r - - resource bundle to use.
component - - component to localize. We use introspection to call the getText() method, use that value as the key into the resource bundle, and update the component via setText(). Valid Swing components for this JMenu, JMenuItem, JPopupMenu.

localizeMenu

public static boolean localizeMenu(java.util.ResourceBundle[] r,
                                   java.awt.Component component)

localizeWindow

public static void localizeWindow(java.util.ResourceBundle r,
                                  java.awt.Component withTitle,
                                  java.awt.Component[] components)
applies standard localization procedures to a console window. Uses introspection to perform the following steps:

Notes:

08/21/2000, hcox: The following components have getText() and setText() methods but probably should never be passed to this function: JTextArea, JTextPane, JTextField, JTextComponent, JEditorPane. 08/21/2000, hcox: The following components do not have getText() and setText() methods, so they will not be operated on by this method: JComboBox, JComponent, JDesktopPane, JLayeredPane, JList, JMenuBar, JOptionPane, JPanel, JPasswordField, JPopupMenu, JProgressBar, JRootPane, JScrollBar, JScrollPane, JSeparator, JSlider, JSplitPane, JTabbedPane, JTable, JTableHeader, JToolbar, JTRee, JViewport, JWindow.

Parameters:
r - - resource bundle to use.
withTitle - - object that will have it's title localized. Valid swing objects are JDialog, JFrame, and JInternalFrame. We use introspection to look for the getTitle() method, retrieve the title, then use that as the key into the resource bundle, and use introspection to call setTitle() to update the object.
components - - array of components to localize. We use introspection to call the getText() method, use that value as the key into the resource bundle, and update the component via setText(). Valid Swing components for this are JButton, JCheckBox, JLabel, JMenu, JMenuItem, JRadioButton, JRadioButtonMenuItem, JToggleButton.

localizeComponents

public static void localizeComponents(java.util.ResourceBundle r,
                                      java.awt.Component[] components)
applies standard localization procedures to a list of components. Uses introspection to perform the following steps:

Notes:

10/31/01, Madhavi:This is very similar to localizeWindow except that it does not set the title. 08/21/2000, hcox: The following components have getText() and setText() methods but probably should never be passed to this function: JTextArea, JTextPane, JTextField, JTextComponent, JEditorPane. 08/21/2000, hcox: The following components do not have getText() and setText() methods, so they will not be operated on by this method: JComboBox, JComponent, JDesktopPane, JLayeredPane, JList, JMenuBar, JOptionPane, JPanel, JPasswordField, JPopupMenu, JProgressBar, JRootPane, JScrollBar, JScrollPane, JSeparator, JSlider, JSplitPane, JTabbedPane, JTable, JTableHeader, JToolbar, JTRee, JViewport, JWindow.

Parameters:
r - - resource bundle to use.
components - - array of components to localize. We use introspection to call the getText() method, use that value as the key into the resource bundle, and update the component via setText(). Valid Swing components for this are JButton, JCheckBox, JLabel, JMenu, JMenuItem, JRadioButton, JRadioButtonMenuItem, JToggleButton.

localizeComponents

public static void localizeComponents(java.util.ResourceBundle[] r,
                                      java.awt.Component[] components)

localizeComponent

public static java.awt.Component localizeComponent(java.util.ResourceBundle r,
                                                   java.awt.Component component)
The method localizes, the component passed to it by setting whatever is applicable from the following for it. i) text ii) mnemonic iii) tool tip iv) color
Parameters:
r - the resource bundle
component - the the Component to localize

localizeComponent

public static java.awt.Component localizeComponent(java.lang.Class<?> clazz,
                                                   java.awt.Component component)

localizeComponent

public static java.awt.Component localizeComponent(java.util.ResourceBundle[] r,
                                                   java.awt.Component component)

setDisplayedMnemonicIndex

public static void setDisplayedMnemonicIndex(javax.swing.AbstractButton comp)

localizeTab

public static void localizeTab(java.util.ResourceBundle r,
                               javax.swing.JTabbedPane tab)
This method is used to localize a JTabbedPane. All the titles for the tabs are localized.
Parameters:
r - the resource bundle to use
tab - the JTabbedPane to localize

localizeTab

public static void localizeTab(java.util.ResourceBundle[] r,
                               javax.swing.JTabbedPane tab)

localizeTable

public static void localizeTable(java.util.ResourceBundle r,
                                 java.awt.Component component)
This method is used to localize the table column names. The resource file should contain entries in the following form for the localization to take place. tablename + _Columns to determine the number of columns in the table tablename + _Column + Column Number (starting at 1 not zero) for each column name key
Parameters:
r - the resource bundle to use
component - the table to localize

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.