IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.testeditor.common
Class DataCorrelatingTextAttrField

java.lang.Object
  extended by com.ibm.rational.common.test.editor.framework.kernel.AbstractAttributeField
      extended by com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField
          extended by com.ibm.rational.common.test.editor.framework.extensions.MarkerAttributeField
              extended by com.ibm.rational.common.test.editor.framework.extensions.FilteredTextAttributeField
                  extended by com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
                      extended by com.ibm.rational.test.lt.testeditor.common.DataCorrelatingTextAttrField
All Implemented Interfaces:
IEditorStateListener, com.ibm.rational.common.test.editor.framework.kernel.actions.ITestEditorActionIDs, com.ibm.rational.common.test.editor.framework.kernel.interfaces.IAttributeFieldHandler, com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITextGlobalActionHandler, com.ibm.rational.test.lt.testeditor.common.ITestDataDecoder, com.ibm.rational.test.lt.testeditor.dc.IDcDecoder, EventListener, IAdaptable, ISelectionProvider, ExtendedModifyListener, LineBackgroundListener, LineStyleListener, VerifyKeyListener, KeyListener, ModifyListener, MouseListener, MouseTrackListener, PaintListener, VerifyListener, org.eclipse.swt.internal.SWTEventListener

public abstract class DataCorrelatingTextAttrField
extends com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField.HandleContentVpAction, com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField.RemoveAllSubsAction, com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField.StyledTextSearcherDc, com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField.SubstitutionAction
 
Nested classes/interfaces inherited from class com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField
com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField.FieldFindReplaceAction, com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField.FindReplaceAdapter, com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField.StyledTextSearcher
 
Nested classes/interfaces inherited from class com.ibm.rational.common.test.editor.framework.kernel.AbstractAttributeField
com.ibm.rational.common.test.editor.framework.kernel.AbstractAttributeField.FieldAttributeInternalAction
 
Field Summary
 
Fields inherited from class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
ACTION_NEXT_RANGE, ACTION_PREV_RANGE, AID_CREATE_FIELD_REF, AID_CREATE_REF, AID_JUMP_TO, AID_REMOVE_ALL_DC, AID_REMOVE_ALL_SUBS, AID_REMOVE_DC, AID_REMOVE_FIELD_REF, AID_SUBST, AID_SUBST_FROM_BLD, AID_SUBST_FROM_DP, AID_SUBST_OTHER, AID_TOGGLE_ENC, GID_NAV_END, GID_NAV_START, GID_REFERENCES_END, GID_REFERENCES_START, GID_SUBST_END, GID_SUBST_START, m_actions, m_findAndSubstituteAction, m_handleContentVpAction, m_isEncodingEnabled, m_isFieldHarvestEnabled, m_isHarvestEnabled, m_isJumpToEnabled, m_isRemoveFieldReferenceEnabled, m_isRemoveReferenceEnabled, m_isRemoveSubstitutorEnabled, m_isSubstitutionEnabled, m_textSearcher
 
Fields inherited from class com.ibm.rational.common.test.editor.framework.kernel.AbstractAttributeField
m_actionCopy, m_actionCut, m_actionDelete, m_actionPaste, m_actionSelect, m_mmenu
 
Fields inherited from interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IAttributeFieldHandler
ID, USE_DEFAULT
 
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.extensions.IEditorStateListener
AFTER_SAVE, BEFORE_SAVE, LOADED, UNLOADING
 
Constructor Summary
DataCorrelatingTextAttrField(ExtLayoutProvider hostLayoutProvider)
          Constructor
DataCorrelatingTextAttrField(ExtLayoutProvider hostLayoutProvider, com.ibm.rational.test.lt.testeditor.common.IContentHidingHelper contentHidingHelper)
          Constructor
DataCorrelatingTextAttrField(ExtLayoutProvider provider, int minValue, int maxValue)
          Creates a data correlatable field for numeric model value/attribute.
 
Method Summary
protected  boolean attributeMatch(String otherAttribute)
          When parsing lists of harvesters (references) and substituters, ExtendedStyledText will call this method to filter out those datacorrelation objects that do not belong to this atttribute/field.
protected  void collectFieldMarkers()
          Refreshes internal lists of references (harvesters) and substituters and updates visual que.
protected  void createActions()
           
protected  void disassociate()
           
protected  void doInit()
           
protected  void fillMenu(IMenuManager menu)
          Fills context menu with datacorrelation related actions.
protected  com.ibm.rational.test.lt.testeditor.common.DefaultAttributeMatcher getAttributeMatcher()
          Returns DefaultAttributeMatcher.
 String getAttributeName()
           
 void modelElementChanged(boolean internalChange)
           
 void objectChanged(Point pt, boolean update, String msg)
           
protected  void parseHarvesters()
          If getHostElement() is not DataSourceHost, does nothing.
protected  void parseSubstituters()
          If getHostElement() is not SubstituterHost, does nothing.
 void setControl(Control control)
           
protected  void setEncoding()
          Calls su.setEncode( !
 void setModelValue()
           
protected  int shift(int start, int len, int shift, String replacedText)
          Called in response to ModifyEvent after text in StyledText is modified.
 void unloading(TestEditor editor)
           
protected  void updateActions()
           
 
Methods inherited from class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
add, addHarvester, addHarvester, addListenersInternal, addModelUpdateListeners, addSubstituter, addSubstituter, addSubstituter, applyModelText, cache, canPerform, checkFilterCondition, clearFieldHarvester, clearMarkers, compareFieldName, createBinaryDataEditor, createBuiltinSubstituter, createDatapoolSubstituter, createFieldSubstitutionTarget, createKeyBindings, createNewHarvester, createNewSubstituterFor, createNewSubstituterFor, decode, decode, dispose, doDecode, enableKeyBindings, fillFindMenu, fillGoToMenu, fillSubstSubMenu, fillSubstSubMenuOld, getActionCreateFieldReference, getActionCreateReference, getActionRemoveDcObject, getActionRemoveFieldReference, getActionRemoveSubs, getActionSearchForOtherInput, getActionSubstFromBuiltIn, getActionSubstFromDatapool, getActionToggleEncoding, getCue, getCurrentDataRange, getDataAsBytes, getDataSourceMenuText, getDataSourceMenuText, getDcAction, getDcMarkers, getDecoderLabel, getEnableDisableAction, getFieldHarvester, getFilterMessage, getHostElement, getListOfHarvesters, getListOfSubstituters, getLoadTestEditor, getMaxIntValue, getMenuTextForDsCategory, getMinIntValue, getRelatedHostElement, getSelectedDcRanges, getSelection, getStringLocatorFromData, getStringLocatorFromSelection, getStringLocatorFromSelection, getSubstituterMenuText, getSubstituterMenuText, getSupportedDataSourceTypes, getSupportedDataSourceTypes2, getTextSearcher, getToolTipFor, isAllowExternalEditor, isCursorInRange, isEncodingEnabled, isFieldHarvestEnabled, isFileSubstitutionEnabled, isHarvestEnabled, isJumpToEnabled, isNumericOnly, isRemoveFieldReferenceEnabled, isRemoveReferenceEnabled, isRemoveSubstitutorEnabled, isSubstitutionEnabled, isSubstitutionEnabled, isSupportedDsType, isWholeText1DcOnly, keyReleased, lineGetStyle, modifyText, mouseDoubleClick, navigateTo, objectChanged, okToRemove, okToRemove, onEditRegex, onSubstituterTypeChanged, onTextMatchFound, onTextSelectionChanged, refreshRegion, remove, removeDataCorrelation, removeListenersInternal, removeModelUpdateListeners, setBytesValue, setCurrentDataRange, setCurrentRange, setEncodingEnabled, setFieldHarvestEnabled, setHarvestEnabled, setHarvestEnabled, setJumpToEnabled, setLayoutProvider, setRemoveFieldReferenceEnabled, setRemoveReferenceEnabled, setRemoveSubstitutorEnabled, setSubstitutionEnabled, setWholeText1DcOnly, shiftText, shiftText, updateDataSourceView, updateStatusLine, verifyKey, verifyText
 
Methods inherited from class com.ibm.rational.common.test.editor.framework.extensions.FilteredTextAttributeField
forceShow, getFilterStyleRanges, getModelValue, getOriginalText, getUiText, isBinary, isFilterActive, isForceOriginalText, isHotKey, isHotKey, isWordWrapEnabled, mouseUp, performExternalEdit, setAllowExternalEditor, setBinary, setFilterActive, setForceOriginalText, setOriginalText, setSelection
 
Methods inherited from class com.ibm.rational.common.test.editor.framework.extensions.MarkerAttributeField
getCurrentRange, getMarkerManager, getNextRange, getOverlappedRanges, getPreviousRange, getRangeForSelection, getSelectedRange, isEmpty, isMouseInRange, isSelectionOverlapsWithRangesEx, keyPressed, lineGetBackground, mouseDown, mouseEnter, mouseExit, mouseHover, paintControl, setTooltipText, toPoint
 
Methods inherited from class com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField
addSelectionChangedListener, beforeSave, createControl, doPerform, getActionGoToLine, getActionGoToOffset, getAdapter, getCursorPosition, getDefaultValue, getFindReplaceAction, getSelectionFromWidget, getStyledText, getTextValue, initNavigationLocation, isCopyEnabled, isCutEnabled, isDeleteEnabled, isPasteEnabled, isSelectAllEnabled, modifyText, removeSelectionChangedListener, setCursorPosition, setSelection, setTextValue, validateValue
 
Methods inherited from class com.ibm.rational.common.test.editor.framework.kernel.AbstractAttributeField
afterSave, associate, canPerform, checkParent, createLabel, createMenu, createMenuManager, doCopy, doCut, doDelete, doPaste, doSelectAll, doSelectAll, getAttributeLabel, getControl, getEditor, getField, getLabelProvider, getLayoutProvider, isModelUpdated, isRefreshTreeOnEdit, loaded, setFocus, setModelUpdated, setRefreshTreeOnEdit, setStatusLineErrorMessage, setStatusLineMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IAttributeFieldHandler
getFieldName
 

Constructor Detail

DataCorrelatingTextAttrField

public DataCorrelatingTextAttrField(ExtLayoutProvider provider,
                                    int minValue,
                                    int maxValue)
Creates a data correlatable field for numeric model value/attribute.

Parameters:
provider - ExtLayoutProvider. Host layout provider.
minValue - int. Minimum acceptable value
maxValue - int. Maximum acceptable value.
Since:
7.0.1
See Also:
LoadTestWidgetFactory.setIntegerOnly(StyledText, boolean, int, int, int)

DataCorrelatingTextAttrField

public DataCorrelatingTextAttrField(ExtLayoutProvider hostLayoutProvider,
                                    com.ibm.rational.test.lt.testeditor.common.IContentHidingHelper contentHidingHelper)
Constructor

Parameters:
hostLayoutProvider - ExtLayotProvider that displays this attribue.
contentHidingHelper - helper for hiding the content in this field

DataCorrelatingTextAttrField

public DataCorrelatingTextAttrField(ExtLayoutProvider hostLayoutProvider)
Constructor

Parameters:
hostLayoutProvider - ExtLayotProvider that displays this attribue.
Method Detail

doInit

protected void doInit()
Overrides:
doInit in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

disassociate

protected void disassociate()
Overrides:
disassociate in class com.ibm.rational.common.test.editor.framework.extensions.MarkerAttributeField

unloading

public void unloading(TestEditor editor)
Specified by:
unloading in interface IEditorStateListener
Overrides:
unloading in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

getAttributeName

public String getAttributeName()
Specified by:
getAttributeName in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
Returns:
Returns the datacorrelation attribute. Attribute Name is string that will be used by dataCorrelation routines to identify and references datacorrelation objects contained in this ModelElement. Default implementation calls getFieldName. Under ordinary circumstances, clients should not override this method (i.e. data correlation attribute should be the same as field Name.
See Also:
ExtendedStyledText.getHostElement()

createActions

protected void createActions()
Overrides:
createActions in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

fillMenu

protected void fillMenu(IMenuManager menu)
Fills context menu with datacorrelation related actions. Defines following group markers:
  • IWorkbenchActionConstants.MB_ADDITIONS + "-dc.ref.start"
  • IWorkbenchActionConstants.MB_ADDITIONS + "-dc.ref.end"
  • IWorkbenchActionConstants.MB_ADDITIONS + "-dc.subst.start"
  • IWorkbenchActionConstants.MB_ADDITIONS + "-dc.subst.end"
  • IWorkbenchActionConstants.MB_ADDITIONS + "-dc.nav.start"
  • IWorkbenchActionConstants.MB_ADDITIONS + "-dc.nav.end"
  • IWorkbenchActionConstants.MB_ADDITIONS
  • IWorkbenchActionConstants.MB_ADDITIONS + ".end"
  • Overrides:
    fillMenu in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
    See Also:
    StyledTextLogic.fillMenu(org.eclipse.jface.action.IMenuManager)

    setEncoding

    protected void setEncoding()
    Calls su.setEncode( !su.isEncode()) method for Substituter that is currently selected or under curser. Does nothing otherwise.

    This method is called from ToggleEncodingAction action and should not be called by clients.


    attributeMatch

    protected boolean attributeMatch(String otherAttribute)
    When parsing lists of harvesters (references) and substituters, ExtendedStyledText will call this method to filter out those datacorrelation objects that do not belong to this atttribute/field.

    For example, suppose that some model elemnt has two fields (attribues) A and B, both of which have data correlation. In the editor's UI, there are two StyledText widgets that display contents of these two attributes. For each of those widgets, there is instance of ExtendedStyledText class. One should look for datacorrelation objects with attribute A, the other should look for attribute B. Clients should override this method only if some more complex comparisons are needed. The default implementation calls:

            otherAttribute.equals( getAttrName() )
     

    Specified by:
    attributeMatch in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
    Parameters:
    otherAttribute - datacorrelation attribute, must not be null.
    Returns:
    boolean

    getAttributeMatcher

    protected com.ibm.rational.test.lt.testeditor.common.DefaultAttributeMatcher getAttributeMatcher()
    Returns DefaultAttributeMatcher. Client classes may override and return another type of matcher of more intiricate matching is required. This method is called often so the instance of the matcher is saved.

    Returns:
    DefaultAttributeMatcher

    setControl

    public void setControl(Control control)
                    throws IllegalArgumentException
    Specified by:
    setControl in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IAttributeFieldHandler
    Overrides:
    setControl in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
    Throws:
    IllegalArgumentException

    shift

    protected int shift(int start,
                        int len,
                        int shift,
                        String replacedText)
    Called in response to ModifyEvent after text in StyledText is modified. Loops over internal lists of references and substituters and adjusts their offsets and lengths.

    Overrides:
    shift in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField
    See Also:
    StyledTextLogic.shift(int, int, int, java.lang.String)

    modelElementChanged

    public void modelElementChanged(boolean internalChange)
    Specified by:
    modelElementChanged in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IAttributeFieldHandler
    Overrides:
    modelElementChanged in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

    collectFieldMarkers

    protected void collectFieldMarkers()
    Refreshes internal lists of references (harvesters) and substituters and updates visual que.

    Clients should not override this method.

    Overrides:
    collectFieldMarkers in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

    parseSubstituters

    protected void parseSubstituters()
    If getHostElement() is not SubstituterHost, does nothing. Otherwise, calls DataCorrelationLabelProvider.getSubstitutersFor to obtain list of Substituters, and stores them in the internal list.


    parseHarvesters

    protected void parseHarvesters()
    If getHostElement() is not DataSourceHost, does nothing. Otherwise, calls DataCorrelationLabelProvider.getHarvestersFor to obtain list of DataSources, and stores them in the internal list.


    objectChanged

    public void objectChanged(Point pt,
                              boolean update,
                              String msg)
    Overrides:
    objectChanged in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

    setModelValue

    public void setModelValue()
    Specified by:
    setModelValue in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.IAttributeFieldHandler
    Overrides:
    setModelValue in class com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField

    updateActions

    protected void updateActions()
    Overrides:
    updateActions in class com.ibm.rational.test.lt.testeditor.common.AbstractDataCorrelatingTextAttrField

    IBM Rational Performance Tester SDK

    © Copyright IBM Corp. 2012. All rights reserved.