TPTP 4.3.0 Testing Tools Project
Public API Specification

org.eclipse.hyades.test.tools.core
Class CorePlugin

java.lang.Object
  extended byorg.eclipse.core.runtime.Plugin
      extended byorg.eclipse.hyades.test.tools.core.CorePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class CorePlugin
extends org.eclipse.core.runtime.Plugin

The main plugin class to be used in the desktop.


Field Summary
static java.lang.String PLUGIN_ID
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
CorePlugin()
          The constructor.
 
Method Summary
 org.osgi.framework.BundleContext getContext()
           
static java.lang.String getID()
          Returns this plugin's id.
static CorePlugin getInstance()
          Returns the shared instance.
 java.util.ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
static java.lang.String getResourceString(java.lang.String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
static java.lang.String getString(java.lang.String key)
          Returns the "plugin.properties" file's value associate to a given key.
static java.lang.String getString(java.lang.String key, java.lang.String arg)
          Returns the string value associate to a given key.
static java.lang.String getString(java.lang.String key, java.lang.String[] args)
          Returns the "plugin.properties" file's value associate to a given key.
static void logError(java.lang.String text)
          Logs an error described by a text.
static void logError(java.lang.Throwable exc)
          Logs an error described by a throwable.
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
See Also:
Constant Field Values
Constructor Detail

CorePlugin

public CorePlugin()
The constructor.

Method Detail

getInstance

public static CorePlugin getInstance()
Returns the shared instance.


getResourceString

public static java.lang.String getResourceString(java.lang.String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.


getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Returns the plugin's resource bundle,


start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
Throws:
java.lang.Exception

getID

public static java.lang.String getID()
Returns this plugin's id.

Returns:
String

getString

public static java.lang.String getString(java.lang.String key)
                                  throws java.lang.NullPointerException,
                                         java.util.MissingResourceException
Returns the "plugin.properties" file's value associate to a given key.

Parameters:
key -
Returns:
String
Throws:
java.util.MissingResourceException - if the key is not in the file
java.lang.NullPointerException - if key is null

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.String arg)
                                  throws java.lang.NullPointerException,
                                         java.util.MissingResourceException
Returns the string value associate to a given key. The key is passed to each resource bundle in the order they are retrieve by the #iterator() method.

The arg string defined replaces the %1 variable defined in the file's values.

Example: If the value associated to the key "a" is "%0 %1 %2 %3 %4" and arg is "v1", the return of this method is "%0 v1 %2 %3 %4".

Parameters:
key -
arg -
Returns:
String
Throws:
java.util.MissingResourceException - if the key is not in the file
java.lang.NullPointerException - if key is null

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.String[] args)
                                  throws java.lang.NullPointerException,
                                         java.util.MissingResourceException
Returns the "plugin.properties" file's value associate to a given key.

The strings defined in args replaces the %n (where n>=1) variables defined in the file's values.

Example: If the value associated to the key "a" is "%0 %1 %2 %3 %4" and args is {"v1", null, "v3"}, the return of this method is "%0 v1 v3 %4".

Parameters:
key -
args -
Returns:
String
Throws:
java.util.MissingResourceException - if the key is not in the file
java.lang.NullPointerException - if key is null

logError

public static void logError(java.lang.Throwable exc)
Logs an error described by a throwable.

This method should be used whenever a class in this plugin has to log an error since it adheres to the global logging strategy.


logError

public static void logError(java.lang.String text)
Logs an error described by a text.

This method should be whenever a class in this plugin has to log an error since it adheres to the global logging strategy.

Parameters:
text -

getContext

public org.osgi.framework.BundleContext getContext()

TPTP 4.3.0 Testing Tools Project
Public API Specification