Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » [AGR] Double click in StyledText?
[AGR] Double click in StyledText? [message #71247] Thu, 18 May 2006 16:44 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Hello.

I have a StyledText in which I have implemented the double mouse click
as a means of selecting an entire word in the field (same as in an
normal text field). However when I try to record the double click in
position based recording, although I see my word being selected, the
macro shows two subsequent single clicks with exactly the same
coordinates, as follows:

<command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>
<command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>

During playback, the selection does not happen. Any pointer?

TIA,
B.
Re: [AGR] Double click in StyledText? [message #71367 is a reply to message #71247] Sat, 20 May 2006 21:20 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
The combination of the two clicks should behave just like a double click (I
verified this with a quick test case).
Your operating system may be configured to register double clicks at a
different speed. Try putting a wait statement in between the two click
commands. For example:

<command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>
<command type="wait" time-to-wait="100"/>
<command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>


"Barbara Rosi-Schwartz" <Barbara.Rosi-Schwartz@Etish.org> wrote in message
news:e4i89u$bqq$1@utils.eclipse.org...
> Hello.
>
> I have a StyledText in which I have implemented the double mouse click
> as a means of selecting an entire word in the field (same as in an
> normal text field). However when I try to record the double click in
> position based recording, although I see my word being selected, the
> macro shows two subsequent single clicks with exactly the same
> coordinates, as follows:
>
> <command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>
> <command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>
>
> During playback, the selection does not happen. Any pointer?
>
> TIA,
> B.
Re: [AGR] Double click in StyledText? [message #71466 is a reply to message #71367] Mon, 22 May 2006 09:15 Go to previous message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Ali Mehregani wrote:
> The combination of the two clicks should behave just like a double click (I
> verified this with a quick test case).
> Your operating system may be configured to register double clicks at a
> different speed. Try putting a wait statement in between the two click
> commands. For example:
>
> <command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>
> <command type="wait" time-to-wait="100"/>
> <command type="mouse-click" detail="1" x-coord="847" y-coord="155"/>
>
>

Ali, thanks for your reply.

Unfortunately your suggestion does not help. Double click appears to
work correctly during playback when I perform it in a normal Text
component, but not in a StyledText one.

The macro below may work as a simple test case to show aberrant
behaviour. The macro does the following:
1) start Eclipse in the Resource view
2) create a simple project (named p)
3) create a simple file (named f) in project p
4) in the text editor that is automatically opened by Eclipse, insert
the words "Some text here"
5) switch to position based recording, place the cursor between the
words "Some" and "text" and add the word "more"
6) double click on the word "more" to select it.

If I run this macro in quick mode, it all works fine. If I play it back
in the standard mode, the word "more" is inserted at the beginning of
the sentence, it does not get selected and the editor gets maximized to
take up the whole workbench.

I hope this helps in clarifying the problems. Please let me know if I am
doing something wrong or if this should go into Bugzilla.

Cheerio,
B.

---------- Macro begins -------------
<macro version="0.1" >
<shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
<command type="select" contextId="toolbar"
widgetId="contribid/newWizardDropDown"/>
<shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
<command type="item-select"
contextId="wizard-page/newWizardSelectionPage"
widgetId="org.eclipse.swt.widgets.Tree#1">
<item
path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.ui.Basic}}-{{ 1.0}} "/>
</command>
<command type="item-expand"
contextId="wizard-page/newWizardSelectionPage"
widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
<item
path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.ui.Basic}}-{{ 1.0}} "/>
</command>
<command type="item-select"
contextId="wizard-page/newWizardSelectionPage"
widgetId="org.eclipse.swt.widgets.Tree#1">
<item
path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.ui.wizards.ne w.project}}-{{1.0}} "/>
</command>
<command type="select" contextId="wizard"
widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
<command type="modify"
contextId="wizard-page/basicNewProjectPage"
widgetId="org.eclipse.swt.widgets.Text#1">
<![CDATA[p]]>
</command>
<command type="select" contextId="wizard"
widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
</shell>
<command type="wait"/>
<command type="item-select"
contextId="view/org.eclipse.ui.views.ResourceNavigator"
widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
<item path="org.eclipse.swt.widgets.TreeItem#{{/p}}-{{1.0}}"/>
</command>
<command type="focus"
contextId="view/org.eclipse.ui.views.ResourceNavigator"
widgetId="org.eclipse.swt.widgets.Composite#1"/>
<command type="select"
contextId=" popup/view/org.eclipse.ui.views.ResourceNavigator/org.eclips e.swt.widgets.Tree#{{/}}-{{1.0}} "
widgetId=" org.eclipse.ui.actions.NewWizardMenu#{{Ne&amp;w-&amp ;File}}-{{0.8}}{{0|3}}-{{0.6}}{{true}}-{{0.1}}{{9}}-{{0.1}}{ {&amp;Folder}}-{{0.2}}{{&amp;Untitled
Text File}}-{{0.2}}"/>
<shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
<command type="modify" contextId="wizard-page/newFilePage1"
widgetId="org.eclipse.swt.widgets.Text#2">
<![CDATA[f]]>
</command>
<command type="select" contextId="wizard"
widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
<command type="wait"/>
</shell>
<command type="modify"
contextId="editor/org.eclipse.ui.DefaultTextEditor/f"
widgetId="org.eclipse.swt.custom.StyledText#1">
<![CDATA[Some text here]]>
</command>
<command type="mouse-click" detail="1" x-coord="502" y-coord="97"/>
<command type="key-press" detail="109" ischarset="true"/>
<command type="key-press" detail="111" ischarset="true"/>
<command type="key-down" detail="114" ischarset="true"/>
<command type="key-press" detail="101" ischarset="true"/>
<command type="key-press" detail="32" ischarset="true"/>
<command type="mouse-click" detail="1" x-coord="510" y-coord="97"/>
<command type="mouse-click" detail="1" x-coord="510" y-coord="97"/>
<command type="wait" time-to-wait="5000"/>
</shell>
</macro>
---------- Macro ends -------------
Previous Topic:Could not initialize class org.eclipse.hyades.models.hierarchy.HierarchyPackage
Next Topic:Eclipse runtime workspace crash during test execution
Goto Forum:
  


Current Time: Fri Apr 26 17:15:04 GMT 2024

Powered by FUDForum. Page generated in 0.02975 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top