com.creamtec.ajaxswing.core

## Class NameUtils

- java.lang.Object
- - com.creamtec.ajaxswing.core.NameUtils

-     public class NameUtils
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `optimizedNames`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NameUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `appendComponentClassName(java.lang.StringBuilder buffer, java.lang.Object obj)` Returns component class name without the package name
    `static java.lang.String` | `cleanupName(java.lang.String name)` Removes/replaces characters in the name that can cause problems when used in HTML and JavaScript
    `static java.lang.String` | `cleanupName(java.lang.String name, java.lang.String appendToName)` Removes/replaces characters in the name that can cause problems when used in HTML and JavaScript
    `static java.lang.String` | `getButtonKeyName(java.lang.Object button)` Format of the key is: window.Window_Title.button.button_text
    `static java.lang.String` | `getComponentClassName(java.lang.Object obj)` Returns component class name without the package name
    `static java.lang.String` | `getComponentInputName(java.lang.Object obj)` Returns the HTML-friendly component name that will be used to refer to the component input field
    `static java.lang.String` | `getComponentName(java.lang.Object obj)`
    `static java.lang.String` | `getComponentName(java.lang.Object obj, java.lang.String namePostfix)` Returns the HTML-friendly component name that will be used to refer to the component
    `static java.lang.String` | `getMenuItemKeyName(java.lang.String actionString)` Format of the key is: window.Window_Title.menu.SubMenuIndex.MenuItemIndex.action
    `static boolean` | `isSafeChar(char nextChar)`
    `static java.lang.String` | `titleToKey(java.lang.String title)` Converts given string title to a form, acceptable as a property in the properties file (hash table)

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### optimizedNames

          public static int optimizedNames

  - ### Constructor Detail

    - #### NameUtils

          public NameUtils()

  - ### Method Detail

    - #### getComponentClassName

          public static java.lang.String getComponentClassName(java.lang.Object obj)

      Returns component class name without the package name

    - #### appendComponentClassName

          public static void appendComponentClassName(java.lang.StringBuilder buffer,
                                      java.lang.Object obj)

      Returns component class name without the package name

    - #### cleanupName

          public static java.lang.String cleanupName(java.lang.String name)

      Removes/replaces characters in the name that can cause problems when used in HTML and JavaScript
      Parameters:
        `name` - String
      Returns:
        cleaned up name

    - #### cleanupName

          public static java.lang.String cleanupName(java.lang.String name,
                                     java.lang.String appendToName)

      Removes/replaces characters in the name that can cause problems when used in HTML and JavaScript
      Parameters:
        `name` - name
        `appendToName` - this string is appended to the name before the cleanup takes place
      Returns:
        cleaned up name

    - #### isSafeChar

          public static boolean isSafeChar(char nextChar)

    - #### titleToKey

          public static java.lang.String titleToKey(java.lang.String title)

      Converts given string title to a form, acceptable as a property in the properties file (hash table)
      Returns:
        key name

    - #### getComponentInputName

          public static java.lang.String getComponentInputName(java.lang.Object obj)

      Returns the HTML-friendly component name that will be used to refer to the component input field

    - #### getComponentName

          public static java.lang.String getComponentName(java.lang.Object obj)

    - #### getComponentName

          public static java.lang.String getComponentName(java.lang.Object obj,
                                          java.lang.String namePostfix)

      Returns the HTML-friendly component name that will be used to refer to the component
      Parameters:
        `namePostfix` - is for add unique name for component because in case with TableCellRenderer Swing uses one component for render all columns, so hashcode is the same and we use col and row indexes as a postfix for determine correct cell.

    - #### getMenuItemKeyName

          public static java.lang.String getMenuItemKeyName(java.lang.String actionString)

      Format of the key is: window.Window_Title.menu.SubMenuIndex.MenuItemIndex.action
      Parameters:
        `actionString` - the action string submitted by the HTML page
      Returns:
        the key name that can be used to refer to the menu item that triggered this action

    - #### getButtonKeyName

          public static java.lang.String getButtonKeyName(java.lang.Object button)

      Format of the key is: window.Window_Title.button.button_text
      Parameters:
        `button` - the button that the key is generated for
      Returns:
        the key name that can be used to refer to the button

Copyright © 2000-2012 CreamTec LLC. All Rights Reserved.