// ********************************************************************** // // // // BBN Technologies, a Verizon Company // 10 Moulton Street // Cambridge, MA 02138 // (617) 873-8000 // // Copyright (C) BBNT Solutions LLC. All rights reserved. // // // ********************************************************************** // // $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/I18n.java,v $ // $RCSfile: I18n.java,v $ // $Revision: 1.1.1.1 $ // $Date: 2003/11/07 21:35:48 $ // $Author: blubin $ // // ********************************************************************** package com.bbn.openmap; import javax.swing.*; /** * Interface for Internationalization support in Openamp. * The I18n implmentation will define where the resources for the given * class are stored. *

* Intended Usage:

* There are several possible uses of this interface, outlined below: * *

*

* In case you were wondering, the oft used I18n * abreviation comes from the 18 characters between the 'I' and the 'n' in * the word Internationalization. * @see com.bbn.openmap.Environment * @see com.bbn.openmap.BasicI18n */ public interface I18n { //Types: //////// /** Primary type for a given field (default if types aren't applicable).*/ public final int TEXT = 1; /** Tooltip for a given field. */ public final int TOOLTIP = 2; /** Mnemonic for a given field. */ public final int MNEMONIC = 3; /** * Get the string associated with the given object/field * (Defaults to TEXT for the type). * @param requestor object containing the code requesting the String * (typically thisthisFoo.classFoo.classthiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JLabel comp); /** * Set the textual properties from values in the appropriate * ResourceBundle. * @param requestor object containing the code requesting the String * (typically thiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JButton comp); /** * Set the textual properties from values in the appropriate * ResourceBundle. * @param requestor object containing the code requesting the String * (typically thiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JMenu comp); /** * Set the textual properties from values in the appropriate * ResourceBundle. * @param requestor object containing the code requesting the String * (typically thiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JMenuItem comp); /** * Set the textual properties from values in the appropriate * ResourceBundle. * @param requestor object containing the code requesting the String * (typically thiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JDialog comp); /** * Set the textual properties from values in the appropriate * ResourceBundle. * @param requestor object containing the code requesting the String * (typically thiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JFrame comp); /** * Set the textual properties from values in the appropriate * ResourceBundle. *

* Note: This method just looks for a TitledBorder on the component. * @param requestor object containing the code requesting the String * (typically thiscomp parameter. * @param comp the component whose properties are being set. **/ public void set(Object requestor, String field, JComponent comp); //Methods for filling in strings using reflection: ////////////////////////////////////////////////// /** * Set the textual properties on a Swing component that is a member of a * given class, from values in the ResourceBundle associated with that * class. Note that the field must contain an object of a known type * (see the other set(...) methods of this class). *

* The setting of the values of this field will be accomplished by calling * the appropriate set(...) method on this class. * @param requestor object containing the code requesting the Component * setup (typically this * The setting of the values of this field will be accomplished by calling * the appropriate set(...) method on this class. **/ public void fill(Object requestor); }