Re: [abbot - Help] Issue with JTextTester.actionEnterText
Timothy Wall <twall <at> users.sf.net>
2009-09-30 17:25:39 GMT
Yes. Abbot will only generate key released events for those
characters it knows from its keymap. Abbot's language-specific
keymaps tell it which keys correspond to which characters.
You might consider listening to the text component document instead.
On Sep 30, 2009, at 12:22 PM, Chen, Min wrote:
> The event UI code is listening to duplicate the text is
> "keyReleased", is this the reason?
>
> -min
>
> -----Original Message-----
> From: Timothy Wall [mailto:twall <at> users.sf.net]
> Sent: Tuesday, September 29, 2009 6:54 PM
> To: Abbot Users
> Cc: minchencm <at> users.sf.net
> Subject: Re: [abbot - Help] Issue with JTextTester.actionEnterText
>
>
> On Sep 29, 2009, at 9:27 PM, SourceForge.net wrote:
>
>>
>> Read and respond to this message at:
>> https://sourceforge.net/projects/abbot/forums/forum/168262/topic/3415421
>> By: minchencm
>>
>> Hi there,
>> I am testing a Swing panel using abbot. In this Swing
>> panel,
>> there are two JTextField, when user typed something into JTextField
>> 1, JTextField
>> 2 will be automatically populated with value of JTextField 1.
>
> At what point is the text duplicated? What are you listening to in
> order to duplicate the text? Do you copy each character as it is
> typed, or when the user types "Enter"?
>
>
>> However, if I used JTextComponentTester.actionEnterText(JTextField1,
>> value),
>> I can see from playback that value is not set to JTextField2,
>> obviously listener
>> registered in JTextField1 is not triggered by abbot tester, and I
>> don't understand
>> why? Posting key event from abbot is different from user keyboard
>> actions?
>
> No, it's identical, except for keys for which the appropriate
> keystrokes can't be determined. For such keys, key down/up events
> won't be generated, only key typed events.
>
>> Strangely,
>> I also noticed that if I add the following call after
>> actionEnterText, JTextField2
>> will be populated with right value:
>>
>> actionActionMap(c, DefaultEditorKit.selectAllAction);
>
> Again, it depends on what events you're listening to in order to
> duplicate the text.
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9-12, 2009. Register
> now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> abbot-users mailing list
> abbot-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/abbot-users
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf