org.softevo.ample
Class AmplePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by org.softevo.ample.AmplePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator, IAmplePreferenceConstants

public class AmplePlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin
implements IAmplePreferenceConstants

Main plugin class.


Field Summary
static boolean DEBUG
           
private  AmpleTestRunListener listener
          Ample's JUnit test run listener.
private static AmplePlugin plugin
          The shared instance.
private static RankingView rankingView
          The ranking view that displays the results.
private  java.util.ResourceBundle resourceBundle
          Resource bundle of the plugin.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Fields inherited from interface org.softevo.ample.ui.IAmplePreferenceConstants
CALLS_INCOMING, CALLS_OUTGOING, KEY_LEVEL, KEY_PERSPECTIVE, KEY_TESTDURATION, KEY_WINDOWSIZE, LEVEL_CLASS, LEVEL_OBJECT, PREF_DURATION, PREF_LEVELS, PREF_PERSPECTIVES, PREF_WINDOWSIZES
 
Constructor Summary
AmplePlugin()
          Initializes a new instance of AmplePlugin.
 
Method Summary
static AmplePlugin getDefault()
          Gets the shared instance.
 InstrumentationConfiguration getInstrumentationConfiguration()
          Gets an instrumentation configuration with the values currently set in the preference store.
 AmpleTestRunListener getListener()
          Gets the shared JUnit test run listener.
 int getMaxTestDurationSeconds()
          Gets the maximum number of seconds to wait for a test to finish.
static RankingView getRankingView()
          Gets the ranking view.
 java.util.ResourceBundle getResourceBundle()
          Gets the plugin's resource bundle.
static java.lang.String getResourceString(java.lang.String key)
          Gets the string from the plugin's resource bundle, or 'key' if not found.
static AmpleTestRunListener getSharedListener()
          Gets the shared JUnit test run listener.
 void setListener(AmpleTestRunListener aListener)
          Sets the shared JUnit test run listener.
static void setRankingView(RankingView rankingView)
          Sets the ranking view.
 void start(org.osgi.framework.BundleContext context)
          This method is called upon plug-in activation.
 void stop(org.osgi.framework.BundleContext context)
          This method is called when the plug-in is stopped.
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

rankingView

private static RankingView rankingView
The ranking view that displays the results.


plugin

private static AmplePlugin plugin
The shared instance.


resourceBundle

private java.util.ResourceBundle resourceBundle
Resource bundle of the plugin.


listener

private AmpleTestRunListener listener
Ample's JUnit test run listener.

Constructor Detail

AmplePlugin

public AmplePlugin()
Initializes a new instance of AmplePlugin.

Method Detail

getRankingView

public static RankingView getRankingView()
Gets the ranking view.


setRankingView

public static void setRankingView(RankingView rankingView)
Sets the ranking view.


start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
This method is called upon plug-in activation.

Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
This method is called when the plug-in is stopped.

Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception

getDefault

public static AmplePlugin getDefault()
Gets the shared instance.

Returns:
The shared instance of AmplePlugin.

getResourceString

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

Parameters:
key - Key of string to retrieve from the resource bundle.
Returns:
The string that is mapped to the specified key; the key itself if it is not found in the resource bundle.

getSharedListener

public static AmpleTestRunListener getSharedListener()
Gets the shared JUnit test run listener.

Returns:
The shared instance of AmpleTestRunListener; null if still none is activated.
See Also:
getListener()

getResourceBundle

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

Returns:
The resource bundle of the plugin.

getListener

public AmpleTestRunListener getListener()
Gets the shared JUnit test run listener.

Returns:
The shared instance of AmpleTestRunListener; null if still none is activated.
See Also:
getSharedListener()

setListener

public void setListener(AmpleTestRunListener aListener)
Sets the shared JUnit test run listener.

Parameters:
aListener - Instance of currently activate AmpleTestRunListener.

getInstrumentationConfiguration

public InstrumentationConfiguration getInstrumentationConfiguration()
Gets an instrumentation configuration with the values currently set in the preference store.


getMaxTestDurationSeconds

public int getMaxTestDurationSeconds()
Gets the maximum number of seconds to wait for a test to finish.