org.jvnet.lafwidget.ant
Class Utils

java.lang.Object
  extended by org.jvnet.lafwidget.ant.Utils

public class Utils
extends java.lang.Object

Utility functions.

Author:
Kirill Grouchnikov

Field Summary
protected static Utils instance
          Singleton.
protected  java.util.Map<java.lang.String,java.lang.String> lafMap
          Maps the LAF names.
static java.lang.String[] UI_IDS
          IDs of all UI delegates.
 
Method Summary
static java.lang.String getMethodDesc(java.lang.reflect.Method method)
          Returns JNI-compliant description of the specified method.
static java.lang.String getTypeDesc(java.lang.Class<?> clazz)
          Returns JNI-compliant description of the specified class (type).
 java.lang.String getUIDelegate(java.lang.String uiKey, java.lang.Class<?> origLafClazz)
          Returns fully-qualified class name for the UI delegate based on the specified parameters.
 java.lang.String getUIDelegate(java.lang.String uiKey, java.lang.String lafClassName)
          Returns fully-qualified class name for the UI delegate based on the specified parameters.
static Utils getUtils()
          Returns instance.
static void main(java.lang.String[] args)
          Test app.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lafMap

protected java.util.Map<java.lang.String,java.lang.String> lafMap
Maps the LAF names.


instance

protected static Utils instance
Singleton.


UI_IDS

public static final java.lang.String[] UI_IDS
IDs of all UI delegates.

Method Detail

getUtils

public static Utils getUtils()
Returns instance.

Returns:
Instance.

getUIDelegate

public java.lang.String getUIDelegate(java.lang.String uiKey,
                                      java.lang.String lafClassName)
Returns fully-qualified class name for the UI delegate based on the specified parameters.

Parameters:
uiKey - UI key.
lafClassName - Class name of the LAF.
Returns:
Fully-qualified class name for the UI delegate. The LAF hierarchy is searched starting from the specified class name and up. For example, if the second parameter points to MetalLookAndFeel, the metal delegate classname is returned if exists; otherwise the basic delegate classname is returned.

getUIDelegate

public java.lang.String getUIDelegate(java.lang.String uiKey,
                                      java.lang.Class<?> origLafClazz)
Returns fully-qualified class name for the UI delegate based on the specified parameters.

Parameters:
uiKey - UI key.
origLafClazz - LAF class.
Returns:
Fully-qualified class name for the UI delegate. The LAF hierarchy is searched starting from the specified class and up. For example, if the second parameter points to MetalLookAndFeel, the metal delegate classname is returned if exists; otherwise the basic delegate classname is returned.

getTypeDesc

public static java.lang.String getTypeDesc(java.lang.Class<?> clazz)
Returns JNI-compliant description of the specified class (type). For example, for JButton[] this function will return [Ljavax/swing/JButton;.

Parameters:
clazz - Class.
Returns:
JNI-compliant class (type) description.

getMethodDesc

public static java.lang.String getMethodDesc(java.lang.reflect.Method method)
Returns JNI-compliant description of the specified method. For example, for void installUI(JButton button) this function will return (Ljavax/swing/JButton;)V.

Parameters:
method - Method.
Returns:
JNI-compliant method description.

main

public static void main(java.lang.String[] args)
Test app.

Parameters:
args -