|
IBM Rational Performance Tester SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.rational.test.lt.testeditor.common.StyledTextLogic
com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText
DataCorrelatingTextAttrField
instead.
public abstract class ExtendedStyledText
ExtendedStyledText
Implements datacorrelation handling for text attributes of ModelElements. A ModelElement
must implement DataSourceHost
and/or SubstituterHost
interfaces.
Field Summary | |
---|---|
protected com.ibm.rational.test.lt.testeditor.common.VisualCue |
m_cue
Deprecated. |
protected boolean |
m_isEncodingEnabled
Deprecated. |
protected boolean |
m_isHarvestEnabled
Deprecated. |
protected boolean |
m_isJumpToEnabled
Deprecated. |
protected boolean |
m_isPlainTextEnabled
Deprecated. |
protected boolean |
m_isSubstitutorEnabled
Deprecated. |
protected DataBoundStyleRange |
m_theCurrentDataRange
Deprecated. |
Fields inherited from class com.ibm.rational.test.lt.testeditor.common.StyledTextLogic |
---|
ACTION_NEXT_RANGE, ACTION_PREV_RANGE, EXTENDED_LOGIC, m_mmenu, m_st |
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 |
Constructor Summary | |
---|---|
ExtendedStyledText(ExtLayoutProvider hostLayoutProvider,
CBActionElement element,
StyledText stext,
String attributeName)
Deprecated. Constructor |
|
ExtendedStyledText(ExtLayoutProvider hostLayoutProvider,
com.ibm.rational.test.lt.testeditor.common.IContentHidingHelper contentHidingHelper,
StyledText stext,
String attributeName)
Deprecated. Constructor |
Method Summary | |
---|---|
protected boolean |
attributeMatch(String otherAttribute)
Deprecated. 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 boolean |
canPerform(int action)
Deprecated. Provides addition checking for conditions for Cut/Paste/Delete actions. |
protected void |
clearFieldHarvester(boolean removeFormCache)
Deprecated. |
protected void |
createActions()
Deprecated. Creates internal actions. |
protected void |
createBuiltinSubstituter()
Deprecated. Substitutes selected text to or changes datasource in the existing substituter to one obtained from DatacorrelatorSelectionWizardDialog . |
protected void |
createDatapoolSubstituter()
Deprecated. Substitutes selected text to or changes datasource in the existing substituter to one obtained from DatapoolAndColumnSelectionDialog . |
protected MenuManager |
createMenuManager()
Deprecated. Creates MenuManager. |
protected void |
createNewHarvester(boolean fieldRef)
Deprecated. Creates new Reference. |
protected abstract String |
doDecode(String selection)
Deprecated. This method is called by createDatapoolSubstituter and createBuiltinSubstituter methods. |
protected void |
fillMenu(IMenuManager menu)
Deprecated. Fills context menu with datacorrelation related actions. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.CreateReferenceAction |
getActionCreateFieldReference()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.CreateReferenceAction |
getActionCreateReference()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.RemoveReferenceAction |
getActionRemoveFieldReference()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.RemoveReferenceAction |
getActionRemoveReference()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.SearchForOtherInputAction |
getActionSearchForOtherInput()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.SubstFromBuiltInAction |
getActionSubstFromBuiltIn()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.SubstFromDatapoolAction |
getActionSubstFromDatapool()
Deprecated. |
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.ToggleEncodingAction |
getActionToggleEncoding()
Deprecated. |
String |
getAttrName()
Deprecated. |
com.ibm.rational.test.lt.testeditor.common.VisualCue |
getCue()
Deprecated. |
LoadTestEditor |
getEditor()
Deprecated. |
protected com.ibm.rational.test.common.models.behavior.cbdata.CorrelationHarvester |
getFieldHarvester()
Deprecated. |
CBActionElement |
getHostElement()
Deprecated. |
protected List |
getListOfHarvesters()
Deprecated. Returns list of data sources or empty list. |
protected List |
getListOfSubstituters()
Deprecated. Returns list of substituters or an empty list. |
static ExtendedStyledText |
getLogic(StyledText st)
Deprecated. |
protected abstract CBActionElement |
getRelatedHostElement()
Deprecated. |
protected DataBoundStyleRange |
getSelectedRange()
Deprecated. |
protected IDCStringLocator |
getStringLocatorFromData(DataBoundStyleRange dbsr)
Deprecated. Utility method creates, populates and returns an instance of IDCStringLocator with contents,
representing correlation attribute contained in the arguemnt. |
protected IDCStringLocator |
getStringLocatorFromSelection(Point selection)
Deprecated. Utility method creates, populates and returns an instance of IDCStringLocator with
contents (offset and length) representing range contained in the arguemnt. |
static String |
getText(StyledText st)
Deprecated. |
protected String |
getToolTipFor(StyleRange sr)
Deprecated. |
static boolean |
hasExtendedLogic(StyledText st)
Deprecated. |
void |
keyReleased(KeyEvent e)
Deprecated. Updates statusLine in the Editor. |
void |
mouseDown(MouseEvent e)
Deprecated. Updates status line in the editor. |
void |
mouseUp(MouseEvent e)
Deprecated. Updates status line in the editor. |
protected void |
parse()
Deprecated. Refreshes internal lists of references (harvesters) and substituters and updates visual que. |
protected void |
parseHarvesters()
Deprecated. If getHostElement() is not DataSourceHost , does nothing. |
protected void |
parseSubstituters()
Deprecated. If getHostElement() is not SubstituterHost , does nothing. |
protected boolean |
removeCorrelationAttribute(boolean isFieldRef)
Deprecated. Deletes datacorrelation attribute (reference or substituter). |
protected void |
setAttrName(String attrName)
Deprecated. |
protected void |
setEncoding()
Deprecated. Calls su.setEncode( ! |
void |
setEncodingEnabled(boolean isEncodingEnabled)
Deprecated. Sets flag that allows the encoding of substituted text behavior. |
void |
setHarvestEnabled(boolean b)
Deprecated. Enables/disables "Create Reference" and "Create Field Reference" actions in the context menu. |
void |
setHarvestEnabled(boolean enableReference,
boolean enableFieldReference)
Deprecated. Enables/disables "Create Reference" and "Create Field Reference" actions in the context menu. |
protected void |
setHostElement(CBActionElement req)
Deprecated. Sets host element. |
void |
setJumpToEnabled(boolean b)
Deprecated. Enables/disabled navigate context menus. |
void |
setPlainTextEnabled(boolean b)
Deprecated. Enables/disables "Remove Field Reference" and "Clear Reference" actions in the context menu. |
protected void |
setStatusLineErrorMessage(String string)
Deprecated. Utility method, calls getEditor().setStatusLineMessage( string, true ); |
protected void |
setStatusLineMessage(String string)
Deprecated. Utility method, calls getEditor().setStatusLineMessage( string ); |
void |
setStyledText(StyledText text)
Deprecated. Initializes this instance with new StyledText . |
void |
setSubstitutionEnabled(boolean b)
Deprecated. Enables/disables "Substitute From" sub-menu in the context menu. |
void |
setText(String text)
Deprecated. |
void |
setText(String text,
CBActionElement httpreq)
Deprecated. |
protected int |
shift(int start,
int len,
int shift,
String replacedText)
Deprecated. Called in response to ModifyEvent after text in StyledText is modified. |
static String |
trimMenuText(String mtext)
Deprecated. Trims long text that is about to be used as a menu item. |
void |
widgetDisposed(DisposeEvent e)
Deprecated. |
Methods inherited from class com.ibm.rational.test.lt.testeditor.common.StyledTextLogic |
---|
add, addListeners, clear, containsPoint, createKeyBindings, doPerform, enableKeyBindings, get, getHighlights, getRangeForSelection, getStyledText, getText, isCursorInRange, isMouseInRange, isSelectionOverlapsWithRangesEx, keyPressed, lineGetBackground, lineGetStyle, modifyText, mouseDoubleClick, mouseEnter, mouseExit, mouseHover, paintControl, remove, remove, removeListeners, setTooltipText, size, updateActions, verifyKey, verifyText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean m_isHarvestEnabled
protected boolean m_isSubstitutorEnabled
protected boolean m_isPlainTextEnabled
protected boolean m_isJumpToEnabled
protected boolean m_isEncodingEnabled
protected DataBoundStyleRange m_theCurrentDataRange
protected com.ibm.rational.test.lt.testeditor.common.VisualCue m_cue
Constructor Detail |
---|
public ExtendedStyledText(ExtLayoutProvider hostLayoutProvider, com.ibm.rational.test.lt.testeditor.common.IContentHidingHelper contentHidingHelper, StyledText stext, String attributeName)
hostLayoutProvider
- ExtLayotProvider
that displays this attribue.contentHidingHelper
- IContentHidingHelperstext
- StyledText
to be extended.attributeName
- String
attribute name to be used for filtering during parse call and for new datacorrelation attributes.public ExtendedStyledText(ExtLayoutProvider hostLayoutProvider, CBActionElement element, StyledText stext, String attributeName)
hostLayoutProvider
- ExtLayotProvider
that displays this attribue.element
- CBActionElement host model element. Must implement DataSOurceHost
or SubstituterHost
or both.stext
- StyledText
to be extended.attributeName
- String
attribute name to be used for filtering during parse call and for new datacorrelation attributes.Method Detail |
---|
protected void createActions()
super.createActions
first.
createActions
in class StyledTextLogic
StyledTextLogic.createActions()
public static ExtendedStyledText getLogic(StyledText st)
st
- StyledText
.
ExtendeedStyledText
if argument has one attached to it, null
otherwise.public static boolean hasExtendedLogic(StyledText st)
st
- StyledText
true
if argument has ExtendedStyledText attached to it, false
otherwise.public static String getText(StyledText st)
st
- StyledText
StyledText
argument.protected MenuManager createMenuManager()
Clients should not override this method.
createMenuManager
in class StyledTextLogic
StyledTextLogic.createMenuManager()
protected void fillMenu(IMenuManager menu)
- 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"
fillMenu
in class StyledTextLogic
menu
- IMenuManagerStyledTextLogic.fillMenu(org.eclipse.jface.action.IMenuManager)
protected void setEncoding()
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.
protected void createDatapoolSubstituter()
DatapoolAndColumnSelectionDialog
.
This method is called from SubstituteFromDatapoolAction.run()
.
protected void createNewHarvester(boolean fieldRef)
DataCorrelationUtil.createCorrelationHarvester
and updates visual state and
internal data. This method is called from CreateReferenceAction.run()
.
public void setSubstitutionEnabled(boolean b)
b
- public void setHarvestEnabled(boolean b)
b
- public void setHarvestEnabled(boolean enableReference, boolean enableFieldReference)
enableReference
- enableFieldReference
- public void setPlainTextEnabled(boolean b)
b
- public void setJumpToEnabled(boolean b)
protected boolean canPerform(int action)
canPerform
in class StyledTextLogic
action
- one of the supported actions (ST.COPY, ST.CUT, ST.PASTE, ST.SELECT_ALL, ST.DELETE_NEXT
)
true
if action is allowed, false
otherwise.StyledTextLogic.canPerform(int)
public LoadTestEditor getEditor()
protected void setStatusLineMessage(String string)
getEditor().setStatusLineMessage( string );
string
- text message.protected void setStatusLineErrorMessage(String string)
getEditor().setStatusLineMessage( string, true );
string
- text message.protected abstract CBActionElement getRelatedHostElement()
For example, in HTTP protocol, HTTP Request may contain datacorrelation objects for itself, its HTTP Responce object,
for HTTP request headers and for HTTP Response headers. HTTP Protocol extension then would need to create four
derived classes (of ExtendedStyledText) that would implement getRelatedHostElement()
to return,
HTTPRequest, HTTPResponse, HTTPRequestHeader and HTTPResponseHeader.
public CBActionElement getHostElement()
protected void setHostElement(CBActionElement req)
DataSourceHost
and/or SubstituterHost
interfaces.
req
- The CBActionElement to set.public String getAttrName()
ModelElement
.ExtendedStyledText.getHostElement()
protected boolean attributeMatch(String otherAttribute)
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() )
otherAttribute
- datacorrelation attribute, must not be null
.
protected void setAttrName(String attrName)
attrName
- The attrName to set. Attribute Name is string that will be used by dataCorrelation routines
to identify and references datacorrelation objects contained in this ModelElement
.public void setStyledText(StyledText text)
StyledText
.
setStyledText
in class StyledTextLogic
StyledTextLogic.setStyledText(org.eclipse.swt.custom.StyledText)
public void widgetDisposed(DisposeEvent e)
widgetDisposed
in interface DisposeListener
widgetDisposed
in class StyledTextLogic
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
keyReleased
in class StyledTextLogic
KeyListener.keyReleased(org.eclipse.swt.events.KeyEvent)
public void mouseUp(MouseEvent e)
mouseUp
in interface MouseListener
mouseUp
in class StyledTextLogic
MouseListener.mouseUp(org.eclipse.swt.events.MouseEvent)
public void mouseDown(MouseEvent e)
mouseDown
in interface MouseListener
mouseDown
in class StyledTextLogic
MouseListener.mouseDown(org.eclipse.swt.events.MouseEvent)
public com.ibm.rational.test.lt.testeditor.common.VisualCue getCue()
protected int shift(int start, int len, int shift, String replacedText)
ModifyEvent
after text in StyledText is modified. Loops over internal lists
of references and substituters and adjusts their offsets and lengths.
shift
in class StyledTextLogic
StyledTextLogic.shift(int, int, int, java.lang.String)
protected void parse()
Clients should not override this method.
protected void parseSubstituters()
getHostElement()
is not SubstituterHost
, does nothing.
Otherwise, calls DataCorrelationLabelProvider.getSubstitutersFor
to obtain list of Substituter
s,
and stores them in the internal list.
protected void parseHarvesters()
getHostElement()
is not DataSourceHost
, does nothing.
Otherwise, calls DataCorrelationLabelProvider.getHarvestersFor
to obtain list of DataSources, and
stores them in the internal list.
protected DataBoundStyleRange getSelectedRange()
getRangeForSelection
),
or has coursor inside its boundaries (calls isCursorInRange( false, true )
.Some actions consider these two situations identical for their purposes.
Cursor position is considered to be inside a range if a character at its left belongs to range.
protected com.ibm.rational.test.common.models.behavior.cbdata.CorrelationHarvester getFieldHarvester()
null
if Fierd Reference does not exist.protected IDCStringLocator getStringLocatorFromSelection(Point selection)
IDCStringLocator
with
contents (offset and length) representing range contained in the arguemnt.Cleints should not override this method.
selection
- Point reresenting selection in the styled text.
protected IDCStringLocator getStringLocatorFromData(DataBoundStyleRange dbsr)
IDCStringLocator
with contents,
representing correlation attribute contained in the arguemnt.Cleints should not override this method.
dbsr
- DataBoundStyleRange
protected boolean removeCorrelationAttribute(boolean isFieldRef)
isFieldRef
- boolean If true
and there is a field reference, it will be removed.false
, the method getSelectedRange
is called to find the currently selected
datacorrelation range.
true
if correlation attribute was successfully removed,
false
otherwies.protected List getListOfHarvesters()
if( getHostElement() instanceof DataSourceHost ) return ((DataSourceHost)getHostElement()).getDataSources(); return Collections.EMPTY_LIST;
protected List getListOfSubstituters()
if( getHostElement() instanceof SubstituterHost ) return ((SubstituterHost)getHostElement()).getSubstituters(); return Collections.EMPTY_LIST;
protected void clearFieldHarvester(boolean removeFormCache)
protected String getToolTipFor(StyleRange sr)
getToolTipFor
in class StyledTextLogic
sr
- DataBoundStyledRange
DataCorrelationLabelProvider.describe
methods.StyledTextLogic.getToolTipFor(org.eclipse.swt.custom.StyleRange)
protected void createBuiltinSubstituter()
DatacorrelatorSelectionWizardDialog
.
This method is called from SubstituteFromBuiltInAction.run()
.
public static String trimMenuText(String mtext)
mtext
-
protected abstract String doDecode(String selection)
createDatapoolSubstituter
and createBuiltinSubstituter
methods.
Clients may want to change passed selection
text according to their protocol's specifications.
For example, createDatapoolSubstituter
will pass two values (columnName and columnValue) to
DatapoolAndColumnSelectionDialog
. These values may end up in the .datapool file, in which case
they must be converted to approporiate form. HTTP Protocol implementation should call URLDecoder.decode()
.
selection
-
protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.CreateReferenceAction getActionCreateFieldReference()
CreateReferenceAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.CreateReferenceAction getActionCreateReference()
CreateReferenceAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.RemoveReferenceAction getActionRemoveFieldReference()
RemoveReferenceAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.RemoveReferenceAction getActionRemoveReference()
RemoveReferenceAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.SearchForOtherInputAction getActionSearchForOtherInput()
SearchForOtherInputAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.SubstFromBuiltInAction getActionSubstFromBuiltIn()
SubstFromBuiltInAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.SubstFromDatapoolAction getActionSubstFromDatapool()
SubstFromDatapoolAction
. Clients can call various methods of this class, but must not dispose of it.protected com.ibm.rational.test.lt.testeditor.common.ExtendedStyledText.ToggleEncodingAction getActionToggleEncoding()
ToggleEncodingAction
. Clients can call various methods of this class, but must not dispose of it.public void setEncodingEnabled(boolean isEncodingEnabled)
ToggleEncodingAction
action in the context menu.
isEncodingEnabled
- true
encoding enabled, encoding
disabled.public void setText(String text, CBActionElement httpreq)
public void setText(String text)
setText
in class StyledTextLogic
|
IBM Rational Performance Tester SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |