com.adventnet.utils
Class SnmpUtils

java.lang.Object
  |
  +--com.adventnet.utils.SnmpUtils
Direct Known Subclasses:
SnmpUIUtils

public class SnmpUtils
extends java.lang.Object

Class for the internationalization implementation. The internationalization can be done by writing the .properties file with the equivalent local string. The locale and the bundle name should be set using the method setLocale(Locale) and setBundleName(String). The search path can also be specified using the method setSearchPath(String ). The search path can be either relative or absolute to the properties file but should be upto the directory of the properties file. The properties will be searched as per the locale set.In case of applet, the applet instance should be set first setApplet(Applet) method followed by the other parameter. The search path should be relative to the the document base.


Field Summary
static boolean INTERNATIONALIZE
          the boolean to set whether to internationlize or not.
static java.util.Locale locale
          The Locale object which will passed to the Resource Bundle.
 
Method Summary
static javax.swing.JCheckBoxMenuItem createJCheckBoxMenuItem(java.lang.String name, char mnemonic, char defaultMnemonicChar)
           
static javax.swing.JMenu createJMenu(java.lang.String name, char mnemonic, char defaultMnemonicChar)
          Create a JMenu after internationalizing the name and the mnemonic by looking up the mnemonic character from the resourcebundle.
static javax.swing.JMenuItem createJMenuItem(java.lang.String name, char mnemonic, char defaultMnemonicChar)
          Creates a JMenuItem after internationalizing the name and the mnemonic by looking up the mneumonic character from the resource bundle.
static javax.swing.JRadioButtonMenuItem createJRadioButtonMenuItem(java.lang.String name, char mnemonic, char defaultMnemonicChar)
           
static java.lang.String getString(java.lang.String key)
          Returns the equivalent string from the Resource Bundle.
static boolean isBroadCastAddress(java.net.InetAddress broadCastAddress, java.net.InetAddress netMask)
           
static boolean isNetMaskAddress(byte[] adr)
           
static void setApplet(java.applet.Applet app)
          The applet instance.
static void setBundleName(java.lang.String bundleName)
          The bundle name of the resource bundle properties file.
static void setLocale(java.util.Locale loc)
          The locale based on which the properties file will be searcded.
static void setSearchPath(java.lang.String path)
          The search path for the properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locale

public static java.util.Locale locale
The Locale object which will passed to the Resource Bundle.

INTERNATIONALIZE

public static boolean INTERNATIONALIZE
the boolean to set whether to internationlize or not. Default is false. Should be set before the instantiation.
Method Detail

setApplet

public static void setApplet(java.applet.Applet app)
The applet instance. Should be set before the instantiation.

setBundleName

public static void setBundleName(java.lang.String bundleName)
The bundle name of the resource bundle properties file. Default bundle name will be MibBrowser. Should be set before the instantiation.

setLocale

public static void setLocale(java.util.Locale loc)
The locale based on which the properties file will be searcded. Should be set before the instantiation.

setSearchPath

public static void setSearchPath(java.lang.String path)
The search path for the properties file. Incase of application the search path can be absolute or relative. In case of applet the search path should be relative to the applet document base. Should be set before the instantiation.

getString

public static java.lang.String getString(java.lang.String key)
Returns the equivalent string from the Resource Bundle. If the requested string is not present, returns the same string. The Properties file should be as per the java standards of Properties.

isNetMaskAddress

public static boolean isNetMaskAddress(byte[] adr)

isBroadCastAddress

public static boolean isBroadCastAddress(java.net.InetAddress broadCastAddress,
                                         java.net.InetAddress netMask)
                                  throws java.lang.IllegalArgumentException

createJMenu

public static javax.swing.JMenu createJMenu(java.lang.String name,
                                            char mnemonic,
                                            char defaultMnemonicChar)
Create a JMenu after internationalizing the name and the mnemonic by looking up the mnemonic character from the resourcebundle. Value for the argument mnemonic will be looked up from the resourcebundle and the first character of the looked up string will be set as mnemonic. If the mnemonic character is not present in the internationalized name, the defaultMnemonicChar will be set as the mnemonic character and this character will be appended after the name within a bracket.
Parameters:
name - name of the JMenu
mnemonic - Mnemonic string. This is for internationlizing the mnemonic character.
defaultMnemonicChar - the default character which will be set as the mnemonic if the internationalized mnemonic character is not present the name.

createJMenuItem

public static javax.swing.JMenuItem createJMenuItem(java.lang.String name,
                                                    char mnemonic,
                                                    char defaultMnemonicChar)
Creates a JMenuItem after internationalizing the name and the mnemonic by looking up the mneumonic character from the resource bundle. Value for the argument mnemonic will be looked up from the resource bundle and the first character of the looked up string will be set as mnemonic. If the mnemonic character is not present in the internationalized name, the defaultMnemonicChar will be set as the mnemonic character and this character will be appended after the name within a bracket...
Parameters:
name - name of the JMenuItem.
mnemonic - Mnemonic string. This is for internationalizing the mnemonic character.
defaultMnemonicChar - the default character which will be set as the mnemonic if the internationalized mnemonic character is not present the name.

createJCheckBoxMenuItem

public static javax.swing.JCheckBoxMenuItem createJCheckBoxMenuItem(java.lang.String name,
                                                                    char mnemonic,
                                                                    char defaultMnemonicChar)

createJRadioButtonMenuItem

public static javax.swing.JRadioButtonMenuItem createJRadioButtonMenuItem(java.lang.String name,
                                                                          char mnemonic,
                                                                          char defaultMnemonicChar)


Copyright (c)AdventNet Inc., 1996-2004