Mailingliste - Einträge 2006


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] What does MPRC event actually do with components and numeric index


  • Subject: Re: [qftestJUI] What does MPRC event actually do with components and numeric index
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 09 Jun 2006 10:23:17 +0200

Hello Mark,

in case of a JEditorPane with structured text or HTML contents, the
qftestJUI item represents a javax.swing.text.Element in the
javax.swing.text.Document of the JEditorPane.

In case of a textual or regexp item index, the text contents of the
Element are used. A numerical index represents a text offset between
the Element's getStartOffset and getEndOffset. So all indexes within
this range address the same Element with the same pixel coordinates.

At least that's what I remember withoug digging through the code :-)

Best regards,
    Greg

"Michaelis, Mark" <mark.michaelis@?.com> writes:

> Hello Greg,
> 
> thanks for the answer. I already started to write a SUT script using
> setCaretPosition.
> 
> But still it would be interesting to know what exact a "target item" is in
> the given example. I. e. it feels strange that for some numeric indices the
> cursor does not seem to move. I assume that in these cases an "invisible"
> item is focussed which is not visible as character but is rather part of the
> underlying model. Is there any way to trace what is actually focussed?
> 
> Regards,
> 	Mark
> 
> > -----Original Message-----
> > From: Gregor Schmid [mailto:Gregor.Schmid@?.de] 
> > Sent: Friday, June 09, 2006 9:48 AM
> > To: qftestJUI-list@?.de
> > Cc: Michaelis, Mark
> > Subject: Re: [qftestJUI] What does MPRC event actually do 
> > with components and numeric index
> > 
> > 
> > Hello Mark,
> > 
> > there's no problem in mixing scripts with qftest nodes to achieve
> > something that is not easily done with nodes alone. That's exactly
> > what SUT scripts are for :-)
> > 
> > As for your question: qftest first determines the location of the
> > target "item" (line, position, etc.) then simulates mouse MOVED,
> > PRESSED, RELEASED and CLICKED events on that location plus the offset
> > from the MPRC node's X and Y attribute. qftest doesn't call
> > setCaretPosition at all, that's a side effect from the mouse events.
> > 
> > Best regards,
> >     Greg
> > 
> > 
> > "Michaelis, Mark" <mark.michaelis@?.com> writes:
> > 
> > > Hello,
> > > 
> > > I currently have a problem to place the cursor at the 
> > correct location in a
> > > JTextPane. 
> > > 
> > > The specific problem:
> > > 
> > > The underlying document used is a HTMLDocument (a derived 
> > class) and I want
> > > to place the cursor into a table cell. As the cell is empty 
> > I need to use
> > > numeric indices. I want to write a procedure which is 
> > somewhat more generic
> > > and allows the user to set the cursor by row/cell indices 
> > into the table.
> > > 
> > > Analysis so far:
> > > 
> > > While I may have found a way doing so with setCaretPosition 
> > I would prefer
> > > to actually stay as close to the qftest functions as 
> > possible. I observed
> > > that MPRC with numeric index actually does not use 
> > setCaretPosition but
> > > makes something different. E. g. for a content like:
> > > 
> > > 123<br/>
> > > 
> > > the cursor will remain in front of "1" for indices 0 to 3 
> > and for index 4 it
> > > will jump to the next empty line. In contrast with 
> > setCaretPosition() you
> > > can place the cursor anywhere inside this string.
> > > 
> > > So perhaps the actual description how this index is handled 
> > would help to
> > > find a solution for the focus problem.
> > > 
> > > Regards
> > > 	Mark
> 
> --
> Mark Michaelis
> Software Engineer Quality Assurance
> 
> CoreMedia AG
> Ludwig-Erhard-Str. 18
> 20459 Hamburg, Germany
> www.coremedia.com

-- 
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen