IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.testeditor
Class LoadTestEditorPlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by com.ibm.rational.test.lt.testeditor.LoadTestEditorPlugin
All Implemented Interfaces:
IEditorStateListener, com.ibm.rational.common.test.editor.framework.preferences.CBPreferenceConstants, com.ibm.rational.test.common.models.behavior.internal.listeners.CBListener, ILTPlugin, com.ibm.rational.test.lt.core.logging.ILTSubComponent, com.ibm.rational.test.lt.testeditor.main.LoadTestLoggingConstants, com.ibm.rational.test.lt.testeditor.preferences.ILtPreferenceConstants, EventListener, IPropertyChangeListener, org.osgi.framework.BundleActivator

public class LoadTestEditorPlugin
extends AbstractUIPlugin
implements com.ibm.rational.test.lt.testeditor.preferences.ILtPreferenceConstants, IPropertyChangeListener, ILTPlugin, com.ibm.rational.test.lt.testeditor.main.LoadTestLoggingConstants, IEditorStateListener, com.ibm.rational.test.common.models.behavior.internal.listeners.CBListener

The main plugin class to be used in the desktop.

1. Creates following menu group for Add and Insert actions:

  • "lt.add"
  • "lt.add.custom.code"
  • "lt.add.vp"
  • "lt.insert"
  • "lt.insert.custom_code"
  • See Also:
    TestEditorPlugin

    Field Summary
    static String ID
               
    static String ms_COMMENT_ID
               
    static String ms_CUSTOM_CODE
               
    static String ms_DATAPOOL_ID
               
    static String ms_DELAY_ID
               
    static String ms_ELSE_ID
               
    static String ms_IF_ID
               
    static String ms_LOOP_ID
               
    static String ms_LTVAR
               
    static String ms_LTVAR_ASSIGN
               
    static String ms_LTVAR_CONT
               
    static String ms_RS_ID
               
    static String ms_TRANSACTION_ID
               
    static String ms_WB_ID
               
     
    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 com.ibm.rational.test.lt.testeditor.preferences.ILtPreferenceConstants
    FIND_MORE_DEF_ACTION, FIND_MORE_DEF_ACTION_AUTO, FIND_MORE_PREF_COUNTER, FIND_MORE_PREF_SHOW_PROMT, PCN_ASK_KEEP_CHILDREN, PCN_ASK_MOVE_INTO_NEW_IF, PCN_ASK_MOVE_INTO_NEW_LOOP, PCN_ASK_MOVE_INTO_NEW_TRANSACTION, PCN_ASK_TO_GENERATE_DEEFAULT_DP, PCN_AUTO_DP_DIGICERTS, PCN_AUTO_GENERATE_DEFAULT_DATAPOOL, PCN_COMPARE_ENCODED_TO_UNENCODED, PCN_CONFIRM_DEFAULT_DATAPOOL, PCN_FIT_SCREEN_ID, PCN_FIX_OPU_OPTION, PCN_IMPORT_DEFAULT_DATAPOOL, PCN_KEEP_CHILDREN, PCN_KEEP_CHILDREN_OPTION, PCN_MOVE_INTO_IF_OPTION, PCN_MOVE_INTO_LOOP_OPTION, PCN_MOVE_INTO_NEW_IF, PCN_MOVE_INTO_NEW_LOOP, PCN_MOVE_INTO_NEW_TRANSACTION, PCN_MOVE_INTO_OTHER_OPTION, PCN_MOVE_INTO_RS_OPTION, PCN_MOVE_INTO_TRANS_OPTION, PCN_SRH_INCLUDE_OVERLAPS, PCN_SRH_INCLUDE_SUBST, PCN_STORE_VP_STRINGS, PCN_X_COLOR_BG, PCN_X_COLOR_FG, PCN_X_FONT, PCN_X_LABEL, PCN_Y_BUILTIN_SUBST, PCN_Y_CUSTOM_CODE, PCN_Y_DATAPOOL_CANDIDATE, PCN_Y_DATAPOOLED_TEXT, PCN_Y_FAILED_SUBST, PCN_Y_FIELD_REFERENCE, PCN_Y_REFERENCE, PCN_Y_TESTVAR_SUBST, PCN_Y_UNUSED_REFERENCE, PCN_Y_USED_REFERENCE, PCN_Z_CUSTOM_CODE, PCN_Z_DATAPOOL, PCN_Z_REFERENCE
     
    Fields inherited from interface com.ibm.rational.common.test.editor.framework.preferences.CBPreferenceConstants
    FG_DOCUMENTATION, FG_REGEX_GROUP, FG_REGEX_MATCH, PCN_DISABLED_COLOR_BG, PCN_DISABLED_COLOR_FG, PCN_DISABLED_PREFIX, PCN_DISPLAY_NESTED_COMMENTS, PCN_INFO_COLOR, PCN_INFO_COLOR_USED, PCN_RANGE_EVEN_BG, PCN_RANGE_ODD_BG, PCN_SEARCH_MATCH_BG, PCN_SEARCH_MATCH_FG
     
    Fields inherited from interface com.ibm.rational.test.lt.testeditor.main.LoadTestLoggingConstants
    prefix_RPTN, RPTNE0001_INIT_ERROR, RPTNE0002_INTERNAL_ERROR, RPTNE0003_CREATE_DATAPOOL, RPTNE0004_EXTENSION_ERROR, RPTNE0005_MARKER_NOT_FOUND, RPTNE0017_CREATE_REFERENCE, RPTNE0020_CREATE_DATAPOOL_SUBST, RPTNE0040_OPEN_FILE, RPTNE0050_DISPLAY_RULES_FAILED, RPTNI0009_COLUMNS_REFRESHED, RPTNW0006_DC_ERROR, RPTNW0007_DATAPOOL_REMOVED, RPTNW0008_COLUMNS_REMOVED, RPTNW0016_CREATE_REFERENCE
     
    Fields inherited from interface com.ibm.rational.common.test.editor.framework.extensions.IEditorStateListener
    AFTER_SAVE, BEFORE_SAVE, LOADED, UNLOADING
     
    Constructor Summary
    LoadTestEditorPlugin()
               
     
    Method Summary
     void afterSave(TestEditor editor)
               
     boolean beforeSave(TestEditor editor)
               
    static IStatus errorStatus(String msg, Throwable t)
               
     void fire(org.eclipse.emf.common.notify.Notification notification)
               
     com.ibm.rational.test.lt.testeditor.extensions.ArmTagHandler getArmTagHandler(TestEditor editor)
               
    static boolean getBooleanProp(String propName)
              Returns a value of the given boolean property
    static Color getColor(String key)
              Extract color from color registry
    static ColorRegistry getColorRegistry()
               
     com.ibm.rational.test.lt.testeditor.main.DatapoolMonitor getDatapoolMonitor()
              Returns the datapoolMonitor.
     IDialogSettings getDialogSettingsSection(String name, IDialogSettings parent)
              DialogSections are used to store state information.
     LoadTestIconManager getImageManager()
               
    static LoadTestEditorPlugin getInstance()
              Returns the shared instance.
    static PDLogger getLogger()
               
     ResourceBundle getNonTranslatableResourceBundle()
               
    static PluginHelper getPluginHelper()
               
    static String getResourceString(String key)
              Returns resource string from LoadTest plugin.properties
    static String[] getStringArrayProp(String propName, String sep)
              Returns an array of LoadTest string properties.
    static String getStringProp(String propName)
              Returns string value of LoadTest property.
    static String getTransfromLabel(com.ibm.rational.test.lt.datatransform.adapters.IDataTransform a, String id)
               
     ResourceBundle getTranslatableResourceBundle()
              Returns TranslatableResource bundle.
    static boolean isAutoLinkWithDsv()
               
     void loaded(TestEditor editor)
               
     void logDebug(String msg)
               
     void logError(String msg)
               
     void logError(String msg, Throwable t)
               
     void logError(Throwable t)
               
     void logWarning(String msg)
               
     void propertyChange(PropertyChangeEvent event)
              This method is called when some color is changed through the Load Test preferences.
     void saveDialogSettings()
              This method is called throughout TestEditor when it needs to save state information.
    static void setAutoLinkWithDsv(boolean b)
               
    static void setBooleanProp(String propName, boolean b)
              Sets boolean value of the given property.
     void setDefaults()
              Initializes default preferences.
     void start(org.osgi.framework.BundleContext context)
               
     void stop(org.osgi.framework.BundleContext context)
               
     void unloading(TestEditor editor)
               
     
    Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
    createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, 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
     
    Methods inherited from interface com.ibm.rational.test.lt.core.logging.ILTPlugin
    getBundle
     

    Field Detail

    ID

    public static final String ID
    See Also:
    Constant Field Values

    ms_TRANSACTION_ID

    public static String ms_TRANSACTION_ID

    ms_DATAPOOL_ID

    public static String ms_DATAPOOL_ID

    ms_IF_ID

    public static String ms_IF_ID

    ms_ELSE_ID

    public static String ms_ELSE_ID

    ms_LOOP_ID

    public static String ms_LOOP_ID

    ms_RS_ID

    public static String ms_RS_ID

    ms_WB_ID

    public static String ms_WB_ID

    ms_COMMENT_ID

    public static String ms_COMMENT_ID

    ms_DELAY_ID

    public static String ms_DELAY_ID

    ms_CUSTOM_CODE

    public static String ms_CUSTOM_CODE

    ms_LTVAR

    public static String ms_LTVAR

    ms_LTVAR_CONT

    public static String ms_LTVAR_CONT

    ms_LTVAR_ASSIGN

    public static String ms_LTVAR_ASSIGN
    Constructor Detail

    LoadTestEditorPlugin

    public LoadTestEditorPlugin()
    Method Detail

    getInstance

    public static LoadTestEditorPlugin getInstance()
    Returns the shared instance.


    getPluginHelper

    public static PluginHelper getPluginHelper()
    Returns:
    PluginHelper
    See Also:
    PluginHelper

    start

    public void start(org.osgi.framework.BundleContext context)
               throws Exception
    Specified by:
    start in interface org.osgi.framework.BundleActivator
    Overrides:
    start in class AbstractUIPlugin
    Throws:
    Exception

    stop

    public void stop(org.osgi.framework.BundleContext context)
              throws Exception
    Specified by:
    stop in interface org.osgi.framework.BundleActivator
    Overrides:
    stop in class AbstractUIPlugin
    Throws:
    Exception

    setDefaults

    public void setDefaults()
    Initializes default preferences.

    See Also:
    PreferencesInitializer.initializeDefaultPreferences()

    getResourceString

    public static String getResourceString(String key)
    Returns resource string from LoadTest plugin.properties

    Parameters:
    key - String
    Returns:
    String

    getBooleanProp

    public static boolean getBooleanProp(String propName)
    Returns a value of the given boolean property

    Parameters:
    propName - String
    Returns:
    boolean value

    setBooleanProp

    public static void setBooleanProp(String propName,
                                      boolean b)
    Sets boolean value of the given property.

    Parameters:
    propName -
    b -

    getStringProp

    public static String getStringProp(String propName)
    Returns string value of LoadTest property.

    Parameters:
    propName - String
    Returns:
    String value

    getStringArrayProp

    public static String[] getStringArrayProp(String propName,
                                              String sep)
    Returns an array of LoadTest string properties. Values must have been saved under propName, separated by separator sep.

    Parameters:
    propName - String - name of the property
    sep - String separator.
    Returns:
    String[] values.

    getDatapoolMonitor

    public com.ibm.rational.test.lt.testeditor.main.DatapoolMonitor getDatapoolMonitor()
    Returns the datapoolMonitor. Clients should not call this method.

    Returns:
    DatapoolMonitor
    See Also:
    DatapoolMonitor

    getColorRegistry

    public static ColorRegistry getColorRegistry()
    Returns:
    JFaceResources.getColorRegistry()

    getColor

    public static Color getColor(String key)
    Extract color from color registry

    Parameters:
    key - String color name.
    Returns:
    Color
    See Also:
    LoadTestEditorPlugin.getColorRegistry()

    propertyChange

    public void propertyChange(PropertyChangeEvent event)
    This method is called when some color is changed through the Load Test preferences.

    Specified by:
    propertyChange in interface IPropertyChangeListener
    See Also:
    IPropertyChangeListener.propertyChange(org.eclipse.jface.util.PropertyChangeEvent)

    getTranslatableResourceBundle

    public ResourceBundle getTranslatableResourceBundle()
    Returns TranslatableResource bundle. This bundleis used with PDLogger.

    Specified by:
    getTranslatableResourceBundle in interface com.ibm.rational.test.lt.core.logging.ILTSubComponent
    Returns:
    ResourceBundle
    See Also:
    ILTSubComponent.getTranslatableResourceBundle()

    getNonTranslatableResourceBundle

    public ResourceBundle getNonTranslatableResourceBundle()
    Specified by:
    getNonTranslatableResourceBundle in interface com.ibm.rational.test.lt.core.logging.ILTSubComponent
    Returns:
    NonTranslatable resource bundle.
    See Also:
    ILTSubComponent.getNonTranslatableResourceBundle()

    getLogger

    public static PDLogger getLogger()
    Returns:
    PDLogger.
    See Also:
    PDLogger

    errorStatus

    public static IStatus errorStatus(String msg,
                                      Throwable t)

    logError

    public void logError(String msg)

    logError

    public void logError(String msg,
                         Throwable t)

    logError

    public void logError(Throwable t)

    logDebug

    public void logDebug(String msg)

    logWarning

    public void logWarning(String msg)

    getArmTagHandler

    public com.ibm.rational.test.lt.testeditor.extensions.ArmTagHandler getArmTagHandler(TestEditor editor)
    Returns:
    Returns the armTagHandler.
    See Also:
    ArmTagHandler

    getDialogSettingsSection

    public IDialogSettings getDialogSettingsSection(String name,
                                                    IDialogSettings parent)
    DialogSections are used to store state information.

    Parameters:
    name - String name of the DialogSection to return. If name subsection is not found in parent, it is created.
    parent - IDialogSettings parent dialog section, or null. If parent is null, the @link AbstractUIPlugin#getDialogSettings() is called. Its return value is used as a parent.
    Returns:
    IDialogSettings
    See Also:
    TestEditorPlugin.getDialogSettingsSection(String, IDialogSettings)

    getImageManager

    public LoadTestIconManager getImageManager()
    Returns:
    LoadTestIconManager

    saveDialogSettings

    public void saveDialogSettings()
    This method is called throughout TestEditor when it needs to save state information.

    Overrides:
    saveDialogSettings in class AbstractUIPlugin
    See Also:
    AbstractUIPlugin.saveDialogSettings()

    afterSave

    public void afterSave(TestEditor editor)
    Specified by:
    afterSave in interface IEditorStateListener

    beforeSave

    public boolean beforeSave(TestEditor editor)
    Specified by:
    beforeSave in interface IEditorStateListener
    Returns:
    boolean do save, abort save

    loaded

    public void loaded(TestEditor editor)
    Specified by:
    loaded in interface IEditorStateListener

    unloading

    public void unloading(TestEditor editor)
    Specified by:
    unloading in interface IEditorStateListener

    isAutoLinkWithDsv

    public static boolean isAutoLinkWithDsv()

    setAutoLinkWithDsv

    public static void setAutoLinkWithDsv(boolean b)

    getTransfromLabel

    public static String getTransfromLabel(com.ibm.rational.test.lt.datatransform.adapters.IDataTransform a,
                                           String id)

    fire

    public void fire(org.eclipse.emf.common.notify.Notification notification)
    Specified by:
    fire in interface com.ibm.rational.test.common.models.behavior.internal.listeners.CBListener
    See Also:
    CBListener.fire(org.eclipse.emf.common.notify.Notification)

    IBM Rational Performance Tester SDK

    © Copyright IBM Corp. 2012. All rights reserved.