com.infoengine.modeler
Class ModelerUtil

java.lang.Object
  extended bycom.infoengine.modeler.ModelerUtil

public class ModelerUtil
extends Object


Field Summary
private static char[] CLOSE_BRACES
           
static String CORE_URI
           
static String DIR_URI
           
private static int MAXDIALOGH
           
private static int MAXDIALOGW
           
private static char[] OPEN_BRACES
           
private static Hashtable rbKeys
           
private static ResourceBundle resource
           
 
Constructor Summary
ModelerUtil()
           
 
Method Summary
static void beep()
          play an audible beep Toolkit.getDefaultToolkit().beep() doesn't make a sound?
private static int braceIndex(char[] array, char c)
          search through a character array for a match
static String getCurrentTaskProcessor()
           
static String getResource(String key)
          retrieve a simple string from the UI resource bundle
static String getResource(String key, Object[] inserts)
          retrieve a string from the UI resource bundle and process inserts java.text.MessageFormat.format() used to process inserts.
static JTextComponent getSourceTextComponent()
           
static void initializeComboBox(JComboBox box, String value, String[] items)
          initialize a combo box with a set of items and an optional selected value.
private static void initRb()
          uses reflection to find all fields and their associated values so that nice string identifiers can be used to localize the UI.
static boolean isBraceChar(char c)
          test character to see if it's an open or close brace
static boolean isCloseBraceChar(char c)
          test character to see if it's a close brace
static boolean isEmpty(String s)
          equates null and empty string
static boolean isOpenBraceChar(char c)
          test character to see if it's an open brace
static boolean isSpaceChar(char c)
          test c to see if it's a standard space char, CR or LF.
static boolean isSpaceString(String s)
           
static void Localize(Container c)
          recursively localize a java Container uses reflection to find get/setText, get/setTitle and get/setToolTipText methods to localize the Container and its children.
static char matchBraceChar(char c)
          find the character matching a brace character
private static void playSound(String sound)
          play a sound file
static void sizeDialog(JDialog d)
          resize a dialog if it's oversized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_URI

public static final String CORE_URI
See Also:
Constant Field Values

DIR_URI

public static final String DIR_URI
See Also:
Constant Field Values

rbKeys

private static Hashtable rbKeys

resource

private static ResourceBundle resource

MAXDIALOGW

private static int MAXDIALOGW

MAXDIALOGH

private static int MAXDIALOGH

OPEN_BRACES

private static char[] OPEN_BRACES

CLOSE_BRACES

private static char[] CLOSE_BRACES
Constructor Detail

ModelerUtil

public ModelerUtil()
Method Detail

initRb

private static void initRb()
uses reflection to find all fields and their associated values so that nice string identifiers can be used to localize the UI.


initializeComboBox

public static void initializeComboBox(JComboBox box,
                                      String value,
                                      String[] items)
initialize a combo box with a set of items and an optional selected value. when finished if value is among items it will be selected, if not it will be added as the last item and selected.

Parameters:
box - - JComboBox to initialize
value - - the selected value (if there is one)
items - - the items to place in the JComboBox

isSpaceChar

public static boolean isSpaceChar(char c)
test c to see if it's a standard space char, CR or LF.

Parameters:
c - - character to test
Returns:
true if is space char else false

isSpaceString

public static boolean isSpaceString(String s)

isEmpty

public static boolean isEmpty(String s)
equates null and empty string

Parameters:
s - - string to test
Returns:
true if empty else false

getResource

public static String getResource(String key)
retrieve a simple string from the UI resource bundle

Parameters:
key - - key into resource bundle
Returns:
associated resource String or null if none found

getResource

public static String getResource(String key,
                                 Object[] inserts)
retrieve a string from the UI resource bundle and process inserts java.text.MessageFormat.format() used to process inserts.

Parameters:
key - - key into resource bundle
inserts - - list of objects to insert into the resource
Returns:
processed resource String or null if none found

Localize

public static void Localize(Container c)
recursively localize a java Container uses reflection to find get/setText, get/setTitle and get/setToolTipText methods to localize the Container and its children.

Parameters:
c - - the Container to localize

sizeDialog

public static void sizeDialog(JDialog d)
resize a dialog if it's oversized


braceIndex

private static int braceIndex(char[] array,
                              char c)
search through a character array for a match

Parameters:
array - - array to search
c - - character to search for

isOpenBraceChar

public static boolean isOpenBraceChar(char c)
test character to see if it's an open brace

Parameters:
c - - character to test
Returns:
true if is open brace else false

isCloseBraceChar

public static boolean isCloseBraceChar(char c)
test character to see if it's a close brace

Parameters:
c - - character to test
Returns:
true if is close brace else false

isBraceChar

public static boolean isBraceChar(char c)
test character to see if it's an open or close brace

Parameters:
c - - character to test
Returns:
true if is open or close brace else false

matchBraceChar

public static char matchBraceChar(char c)
find the character matching a brace character

Parameters:
c - - character to match with the corresponding brace

beep

public static void beep()
play an audible beep Toolkit.getDefaultToolkit().beep() doesn't make a sound?


playSound

private static void playSound(String sound)
play a sound file

Parameters:
sound - - sound file from classpath to play

getSourceTextComponent

public static JTextComponent getSourceTextComponent()

getCurrentTaskProcessor

public static String getCurrentTaskProcessor()