com.sibvisions.rad.ui
Class ApplicationUtil

java.lang.Object
  extended by com.sibvisions.rad.ui.ApplicationUtil

public final class ApplicationUtil
extends Object

The ApplicationUtil is a utility for swing classes.


Method Summary
static IApplication createInstance(ILauncher pLauncher, String pClassName)
          Creates an instance of an IApplication.
static String getRegistryApplicationName(ILauncher pLauncher)
          Gets the application name out of the launcher.
static String getRegistryKey(String pApplication, String pKey)
          Gets the value for an application specific registry key.
static String replaceParameter(String pValue, ILauncher pLauncher)
          Replaces a parameter placeholder with the desired parameter.
static void setRegistryKey(String pApplication, String pKey, String pValue)
          Sets the value for an application specific registry key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static IApplication createInstance(ILauncher pLauncher,
                                          String pClassName)
                                   throws Throwable
Creates an instance of an IApplication.

Parameters:
pLauncher - the launch configuration
pClassName - the full qualified class name of the desired class
Returns:
a new IApplication instance
Throws:
Throwable - if the instance can not be created

replaceParameter

public static String replaceParameter(String pValue,
                                      ILauncher pLauncher)
Replaces a parameter placeholder with the desired parameter. The placeholder looks like the following: [SERVER] The placeholder will be replaced with the value of the SERVER parameter.

Parameters:
pValue - the value of an application parameter
pLauncher - the launcher
Returns:
the value with replaced placeholder(s)

setRegistryKey

public static void setRegistryKey(String pApplication,
                                  String pKey,
                                  String pValue)
Sets the value for an application specific registry key.

Parameters:
pApplication - the application name
pKey - the key to set
pValue - the value to set
Throws:
SecurityException - if a SecurityManager is present and denies the registry access
RuntimeException - if it's not possible to save the registry key

getRegistryKey

public static String getRegistryKey(String pApplication,
                                    String pKey)
Gets the value for an application specific registry key.

Parameters:
pApplication - the application name
pKey - the key to get
Returns:
the value for the pKey or null if the application or key is not visible
Throws:
SecurityException - if a SecurityManager is present and denies the registry access

getRegistryApplicationName

public static String getRegistryApplicationName(ILauncher pLauncher)
Gets the application name out of the launcher. If the serverbase param is configured, then the value of this parameter will be the prefix for the application.

Parameters:
pLauncher - the launcher with properties for the application
Returns:
the application name prefixed with the serverbase


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.