IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.testeditor.main
Class LoadTestEditor

java.lang.Object
  extended by com.ibm.rational.common.test.editor.framework.TestEditor
      extended by com.ibm.rational.test.lt.testeditor.main.LoadTestEditor
All Implemented Interfaces:
IEditorStateListener, com.ibm.rational.common.test.editor.framework.kernel.actions.ITestEditorActionIDs, com.ibm.rational.common.test.editor.framework.kernel.interfaces.ILoggingConstants, EventListener, IJobChangeListener, IPropertyChangeListener, IGotoMarker

public class LoadTestEditor
extends TestEditor
implements IPropertyChangeListener, IEditorStateListener

Load Test Editor.

Since:
August 4, 2005

Nested Class Summary
 class LoadTestEditor.FieldMagnifier
           
 class LoadTestEditor.ToggleEditorViewModeAction
           
 
Field Summary
static int MAX_HISTORY
          Max number of last accessed data sources to put in menu
static String ms_PRIMARY_FEATURE
           
static byte VIEW_MODE_SUBSTITUTERS
           
 
Fields inherited from class com.ibm.rational.common.test.editor.framework.TestEditor
LASTFIELDSELECTION, LASTSELECTION, VIEW_MODE_NORMAL
 
Fields inherited from interface com.ibm.rational.common.test.editor.framework.extensions.IEditorStateListener
AFTER_SAVE, BEFORE_SAVE, LOADED, UNLOADING
 
Fields inherited from interface com.ibm.rational.common.test.editor.framework.kernel.actions.ITestEditorActionIDs
ACTION_GROUP_EDIT_END, ACTION_GROUP_EDIT_START, ACTION_GROUP_FILTERS_END, ACTION_GROUP_FILTERS_START, ACTION_GROUP_FIND_END, ACTION_GROUP_FIND_START, ACTION_GROUP_GOTO_END, ACTION_GROUP_GOTO_START, ACTION_GROUP_MODIFY_CONTRIBUTIONS_END, ACTION_GROUP_MODIFY_CONTRIBUTIONS_START, ACTION_GROUP_NEW_END, ACTION_GROUP_NEW_START, ACTION_GROUP_SHOW_END, ACTION_GROUP_SHOW_START, COPY, CUT, DELETE, PASTE, SAVE, SELECT_ALL
 
Fields inherited from interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ILoggingConstants
RPCA0100W, RPCA0101W, RPCA0102W, RPCA0103W, RPCA0104W, RPCA0105E, RPCA0106E, RPCA0107E, RPCA0108E, RPCA0109E, RPCA0110E, RPCA1001E, RPCA1001W, RPCA1002E
 
Constructor Summary
LoadTestEditor(CommonEditorExtension ext)
           
 
Method Summary
 void activate(boolean active)
           
 void addAvailableType(String type)
           
 Datapool[] addDatapool()
          Prompts user for a datapool file.
 com.ibm.rational.common.test.editor.framework.kernel.util.TestTreeRegion addSplitoutRegion(String fileName, IStructuredSelection selection)
           
 void afterSave(TestEditor editor)
           
 void attachHiddenVarsContainer()
           
 boolean beforeSave(TestEditor editor)
           
 void cacheDataSource(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
           
protected  void connectToEclipse(IEditorPart part)
           
 void create()
          Creates editor contents.
protected  LoadTestEditorForm createEditorForm()
          Creates and returns EditorForm
 com.ibm.rational.common.test.editor.framework.extensions.ExceptionsUI createExceptionsUI(ExtLayoutProvider provider)
           
protected  RptMenuManager createMenuManager()
          Registers menu groups with TestEditorPlugin.getMenuManager() Creates following groups: "lt.add" "lt.add.custom.code" "lt.add.vp" "lt.insert" "lt.insert.custom_code"
 CBTest createTestObject()
          Calls LttestFactory.eINSTANCE.loadLTTest( getTestSuite() ).
 void dataSourceRemoved(com.ibm.rational.test.common.models.behavior.cbdata.DataSourceHost _dsh, com.ibm.rational.test.common.models.behavior.cbdata.CoreHarvester _ch)
           
 void detachHiddenVarsContainer()
           
 void displayMatch(Object match)
          Display SearchMatch or FieldMatch
 void displayObject(com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITargetDescriptor target)
          Directs TestEditor to locate and select specified model element in the tree section.
protected  void doFirstTimeInit()
          This method is called when a test is opened in th editor for the very first time.
 void fillContextMenu(IMenuManager menu)
          Fills content menu for TestEditor's MainSection
protected  String formatMessage(com.ibm.rational.test.common.models.behavior.exceptions.CommonModelException e1)
           
 com.ibm.rational.test.lt.testeditor.actions.AllowRulesAccumulatonAction getAllowRulesAccumulationAction()
           
 String[] getApplicableTypes()
          Override base class' implementation to load only those extensions that support LTTest type.
 BuiltinDatasources getBuiltinDataSources()
           
 List<com.ibm.rational.test.common.models.behavior.cbdata.DataSource> getCachedDataSources()
          Returns a list of cached (recently accessed) DataSources.
 String getEditorName()
          Returns editor name.
 com.ibm.rational.test.lt.testeditor.main.LoadTestEditor.SplitTestRegion getElementRegion(CBActionElement element)
           
 com.ibm.rational.test.common.models.behavior.variables.CBVarContainer getHiddenVarsContainer()
           
 com.ibm.rational.test.common.models.behavior.cbdata.DatapoolHarvester getLastDatapool()
           
 LTTest getLtTest()
          Returns LTTest
 com.ibm.rational.test.lt.datacorrelation.rules.ui.generator.RuleSetGenerationUIHelper getRuleSetGeneratorHelper()
           
 com.ibm.rational.test.lt.testeditor.actions.ShowAccumulatedRulesAction getShowAccumulatedRulesAction()
           
 IConfigurationElement[] getSupportedDataSources(String catId)
           
 String[] getSupportedDataSourcesTypes()
          Returns array of IDs of DataSources that this LTTest can support.
 ISearchQuery getTestSearchQuery(com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs, int what)
          Returns instanceof SearchQuery.
 LoadTestEditor.ToggleEditorViewModeAction getToggleViewModeAction()
           
 byte getViewMode()
           
 void initHeading(com.ibm.rational.common.test.editor.framework.kernel.AbstractLoadTestEditorForm form)
           
 boolean isOkToSave()
          Always returns true.
 boolean isReferencesNeedReview()
           
 boolean isRulesAccumulationEnabled()
           
 void loaded(TestEditor editor)
           
 void markDirty()
          Calls SplitTestAction.resetCachedSplitParticipantStatus(getLtTest())
 void propertyChange(PropertyChangeEvent event)
           
 void refreshDetails()
           
 void refreshTree()
           
 boolean removeDatapools(Object[] objects)
          Removes specified datapools from the test.
 boolean removeFromCache(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
          Remove specified DataSource from cache.
 ArrayList<String> removeRegionsFor(Object[] array)
           
protected  void restoreState()
          Restores editor state upon load.
 void saveState()
          Saves editor state
 void searchForDataSources(IDCStringLocator location, com.ibm.rational.test.common.models.behavior.cbdata.Substituter existing)
           
 void setAllowRulesAccumulation(boolean _allowRulesAccumulation)
           
 void setHiddenVarsContainer(com.ibm.rational.test.common.models.behavior.variables.CBVarContainer hiddenVarsContainer)
           
 void setInput(Object arg0)
          This method is called when the test is opening in the Eclipse editor.
 void setLastDatapool(com.ibm.rational.test.common.models.behavior.cbdata.DatapoolHarvester lastDatapool)
          Stores least recently used DatapoolHarvester
 void setReferencesNeedReview(boolean isReferencesNeedReview)
           
protected  void setViewMode(byte newViewMode, StructuredSelection ssel)
          This implementation does nothing.
 void unload(boolean reserved)
          This method is called when TestEditor is being unloaded.
 void unloading(TestEditor editor)
           
 void verifyDatapools()
           
 void verifyDatapools(String oldFile, String newFile)
          This method is called from DatapoolMonitor and should not be called directly by clients.
 
Methods inherited from class com.ibm.rational.common.test.editor.framework.TestEditor
aboutToRun, addAvailableType, addRecentSearchText, awake, cancelCutOperation, clearDirty, confirmRemove, confirmRemove, done, fixBadRequirements, getAvailableTypes, getBookmarkAction, getCallingEditorExtension, getCaseSearchValue, getCurrentSelection, getDialogCaption, getDisableAction, getEditorState, getEnableAction, getEnableAllAction, getFindReplaceAction, getForm, getFormattedResourceName, getImageFor, getLabelFor, getMenuManager, getProviders, getProviders, getProviders, getRecentSearches, getRegexSearchValue, getTest, getTestSuite, gotoMarker, hasJobs, isHighlightSearchResults, isReadOnly, jobCreated, refresh, running, scheduled, selectionChanged, setCaseSearchValue, setCbTest, setEditorName, setHighlightSearchResults, setReadOnly, setRegexSearchValue, setStatusLineMessage, setStatusLineMessage, sleeping, storeFieldLocation, updateActions, updateFindRepleceAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ms_PRIMARY_FEATURE

public static final String ms_PRIMARY_FEATURE
See Also:
Constant Field Values

MAX_HISTORY

public static final int MAX_HISTORY
Max number of last accessed data sources to put in menu

See Also:
Constant Field Values

VIEW_MODE_SUBSTITUTERS

public static final byte VIEW_MODE_SUBSTITUTERS
See Also:
Constant Field Values
Constructor Detail

LoadTestEditor

public LoadTestEditor(CommonEditorExtension ext)
Parameters:
ext -
Method Detail

getEditorName

public String getEditorName()
Description copied from class: TestEditor
Returns editor name.

Overrides:
getEditorName in class TestEditor
Returns:
String editor name.

createMenuManager

protected RptMenuManager createMenuManager()
Registers menu groups with TestEditorPlugin.getMenuManager() Creates following groups:
  • "lt.add"
  • "lt.add.custom.code"
  • "lt.add.vp"
  • "lt.insert"
  • "lt.insert.custom_code"
  • Overrides:
    createMenuManager in class TestEditor

    verifyDatapools

    public void verifyDatapools()

    cacheDataSource

    public void cacheDataSource(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)

    getCachedDataSources

    public List<com.ibm.rational.test.common.models.behavior.cbdata.DataSource> getCachedDataSources()
    Returns a list of cached (recently accessed) DataSources.

    Returns:
    List

    removeFromCache

    public boolean removeFromCache(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
    Remove specified DataSource from cache. This is typically alled when the DataqSource is being deleted

    Parameters:
    ds - DataSource
    Returns:
    boolean true if deleted, false if not.

    getApplicableTypes

    public String[] getApplicableTypes()
    Override base class' implementation to load only those extensions that support LTTest type. This editor provides an ActionHandler, LabelProvider and LayoutProvider classes that handle such elements as IF and Loop. However, CommonActionHandler does not allow for addition of any of these objects, even though the CommonLabelProvider and CommonLayoutProvider "know" how to display them. You extension will have to specify which objects of Common it permits to be added.

    Overrides:
    getApplicableTypes in class TestEditor
    Returns:
    array of types that this editor is going to support. Base editor class will filter out all extensions that do NOT list any of these types as supported in their <forTypes>
    See Also:
    TestEditor.getApplicableTypes()

    createEditorForm

    protected LoadTestEditorForm createEditorForm()
    Description copied from class: TestEditor
    Creates and returns EditorForm

    Overrides:
    createEditorForm in class TestEditor
    Returns:
    LoadTestEditorForm - the editor form

    initHeading

    public void initHeading(com.ibm.rational.common.test.editor.framework.kernel.AbstractLoadTestEditorForm form)
    Specified by:
    initHeading in class TestEditor

    createTestObject

    public CBTest createTestObject()
    Calls
    LttestFactory.eINSTANCE.loadLTTest( getTestSuite() )
    . Clients must not call this method directly.

    Specified by:
    createTestObject in class TestEditor
    Returns:
    CBTest loaded LTTest
    See Also:
    TestEditor.createTestObject()

    formatMessage

    protected String formatMessage(com.ibm.rational.test.common.models.behavior.exceptions.CommonModelException e1)
    Overrides:
    formatMessage in class TestEditor

    getLtTest

    public LTTest getLtTest()
    Returns LTTest

    Returns:
    LTTest test

    unload

    public void unload(boolean reserved)
    Description copied from class: TestEditor
    This method is called when TestEditor is being unloaded.

    Overrides:
    unload in class TestEditor

    addDatapool

    public Datapool[] addDatapool()
    Prompts user for a datapool file. This is a shortcut to
     DatapoolUtil.addDatapool( this, false, null, null );
     

    Returns:
    Datapool[] imported Datapools (an array with one element of Datapool type)
    See Also:
    Datapool

    removeDatapools

    public boolean removeDatapools(Object[] objects)
    Removes specified datapools from the test.

    Parameters:
    objects - An array of Objects that are Datapools
    See Also:
    DatapoolUtil.removeDatapoolsEx(LoadTestEditor, Object[])

    searchForDataSources

    public void searchForDataSources(IDCStringLocator location,
                                     com.ibm.rational.test.common.models.behavior.cbdata.Substituter existing)
    Parameters:
    location -
    existing -

    displayObject

    public void displayObject(com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITargetDescriptor target)
    Description copied from class: TestEditor
    Directs TestEditor to locate and select specified model element in the tree section. Optionally, ITargetDescriptor may contain additional, more precise, information about attribute and position within attribute of the target model element.

    NOTE this mechanism is subject to chage in the future versions of TestEditor.

    Overrides:
    displayObject in class TestEditor
    Parameters:
    target - ITargetDescriptor
    See Also:
    ITargetDescriptor, ExtLayoutProvider.navigateTo(ITargetDescriptor)

    restoreState

    protected void restoreState()
    Description copied from class: TestEditor
    Restores editor state upon load. Clients should not call this method directly.

    Overrides:
    restoreState in class TestEditor

    saveState

    public void saveState()
    Description copied from class: TestEditor
    Saves editor state

    Overrides:
    saveState in class TestEditor

    verifyDatapools

    public void verifyDatapools(String oldFile,
                                String newFile)
    This method is called from DatapoolMonitor and should not be called directly by clients.

    Parameters:
    oldFile -
    newFile -

    getLastDatapool

    public com.ibm.rational.test.common.models.behavior.cbdata.DatapoolHarvester getLastDatapool()
    Returns:
    Returns the lastDatapool.

    setLastDatapool

    public void setLastDatapool(com.ibm.rational.test.common.models.behavior.cbdata.DatapoolHarvester lastDatapool)
    Stores least recently used DatapoolHarvester

    Parameters:
    lastDatapool - The lastDatapool to set.

    propertyChange

    public void propertyChange(PropertyChangeEvent event)
    Specified by:
    propertyChange in interface IPropertyChangeListener

    refreshTree

    public void refreshTree()

    refreshDetails

    public void refreshDetails()

    displayMatch

    public void displayMatch(Object match)
    Display SearchMatch or FieldMatch

    Overrides:
    displayMatch in class TestEditor
    Parameters:
    match - Object
    See Also:
    TestEditor.displayMatch(java.lang.Object)

    getBuiltinDataSources

    public BuiltinDatasources getBuiltinDataSources()
    Returns:
    Returns the builtinDataSources.

    fillContextMenu

    public void fillContextMenu(IMenuManager menu)
    Description copied from class: TestEditor
    Fills content menu for TestEditor's MainSection

    Overrides:
    fillContextMenu in class TestEditor
    Parameters:
    menu - IMenuManager

    create

    public void create()
    Description copied from class: TestEditor
    Creates editor contents.

    Overrides:
    create in class TestEditor

    doFirstTimeInit

    protected void doFirstTimeInit()
    Description copied from class: TestEditor
    This method is called when a test is opened in th editor for the very first time.

    Overrides:
    doFirstTimeInit in class TestEditor

    activate

    public void activate(boolean active)
    Overrides:
    activate in class TestEditor

    setInput

    public void setInput(Object arg0)
    Description copied from class: TestEditor
    This method is called when the test is opening in the Eclipse editor. Clients must not call it directly.

    Overrides:
    setInput in class TestEditor

    getSupportedDataSources

    public final IConfigurationElement[] getSupportedDataSources(String catId)

    getSupportedDataSourcesTypes

    public final String[] getSupportedDataSourcesTypes()
    Returns array of IDs of DataSources that this LTTest can support. These IDs are loaded from DataSourceViewPage.DATASOURCE_CAT_ID extensions.

    Returns:
    String[].
    See Also:
    DataSourceViewPage, DataSourceView}, DataCorrelatingTextAttrField

    getTestSearchQuery

    public ISearchQuery getTestSearchQuery(com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs,
                                           int what)
    Description copied from class: TestEditor
    Returns instanceof SearchQuery. Extensing classes may override and return null if no search is supported, or some more specialized query. When this method is called from SearchPage, the second argument is QuerySpecification.QUERY_TYPE_DEFALT.

    Overrides:
    getTestSearchQuery in class TestEditor
    Parameters:
    specs - QuerySpecification query specification
    Returns:
    ISearchQuery

    connectToEclipse

    protected void connectToEclipse(IEditorPart part)
    Overrides:
    connectToEclipse in class TestEditor

    getViewMode

    public byte getViewMode()
    Overrides:
    getViewMode in class TestEditor

    setViewMode

    protected void setViewMode(byte newViewMode,
                               StructuredSelection ssel)
    Description copied from class: TestEditor
    This implementation does nothing.

    Overrides:
    setViewMode in class TestEditor
    Parameters:
    newViewMode - byte. Editor mode.
    ssel - Selection of objects to display innew mode.

    addAvailableType

    public void addAvailableType(String type)
    Overrides:
    addAvailableType in class TestEditor

    markDirty

    public void markDirty()
    Calls SplitTestAction.resetCachedSplitParticipantStatus(getLtTest())

    Overrides:
    markDirty in class TestEditor
    See Also:
    TestEditor.markDirty()

    getToggleViewModeAction

    public LoadTestEditor.ToggleEditorViewModeAction getToggleViewModeAction()

    addSplitoutRegion

    public com.ibm.rational.common.test.editor.framework.kernel.util.TestTreeRegion addSplitoutRegion(String fileName,
                                                                                                      IStructuredSelection selection)

    getElementRegion

    public com.ibm.rational.test.lt.testeditor.main.LoadTestEditor.SplitTestRegion getElementRegion(CBActionElement element)

    removeRegionsFor

    public ArrayList<String> removeRegionsFor(Object[] array)

    isOkToSave

    public boolean isOkToSave()
    Description copied from class: TestEditor
    Always returns true.

    Overrides:
    isOkToSave in class TestEditor
    Returns:
    boolean.

    isReferencesNeedReview

    public boolean isReferencesNeedReview()

    setReferencesNeedReview

    public void setReferencesNeedReview(boolean isReferencesNeedReview)

    createExceptionsUI

    public com.ibm.rational.common.test.editor.framework.extensions.ExceptionsUI createExceptionsUI(ExtLayoutProvider provider)
    Specified by:
    createExceptionsUI in class TestEditor

    getRuleSetGeneratorHelper

    public com.ibm.rational.test.lt.datacorrelation.rules.ui.generator.RuleSetGenerationUIHelper getRuleSetGeneratorHelper()

    dataSourceRemoved

    public void dataSourceRemoved(com.ibm.rational.test.common.models.behavior.cbdata.DataSourceHost _dsh,
                                  com.ibm.rational.test.common.models.behavior.cbdata.CoreHarvester _ch)

    isRulesAccumulationEnabled

    public boolean isRulesAccumulationEnabled()

    setAllowRulesAccumulation

    public final void setAllowRulesAccumulation(boolean _allowRulesAccumulation)

    getShowAccumulatedRulesAction

    public com.ibm.rational.test.lt.testeditor.actions.ShowAccumulatedRulesAction getShowAccumulatedRulesAction()

    getAllowRulesAccumulationAction

    public final com.ibm.rational.test.lt.testeditor.actions.AllowRulesAccumulatonAction getAllowRulesAccumulationAction()

    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

    attachHiddenVarsContainer

    public void attachHiddenVarsContainer()

    detachHiddenVarsContainer

    public void detachHiddenVarsContainer()

    unloading

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

    getHiddenVarsContainer

    public com.ibm.rational.test.common.models.behavior.variables.CBVarContainer getHiddenVarsContainer()

    setHiddenVarsContainer

    public void setHiddenVarsContainer(com.ibm.rational.test.common.models.behavior.variables.CBVarContainer hiddenVarsContainer)

    IBM Rational Performance Tester SDK

    © Copyright IBM Corp. 2012. All rights reserved.