Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » find a context menu (which has a keyboard shortcut)
find a context menu (which has a keyboard shortcut) [message #826081] Wed, 21 March 2012 16:23 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1419
Registered: July 2009
Senior Member
Hi

I have no problem in finding context menus by name, but when they have
an associated keyboard shortcut (e.g. "Undo Ctrl+Z") what is the right
way to retrieve it? Should I pass also the shortcut? but how?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
Re: find a context menu (which has a keyboard shortcut) [message #826575 is a reply to message #826081] Thu, 22 March 2012 08:35 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1419
Registered: July 2009
Senior Member
On 03/21/2012 05:23 PM, Lorenzo Bettini wrote:
> Hi
>
> I have no problem in finding context menus by name, but when they have
> an associated keyboard shortcut (e.g. "Undo Ctrl+Z") what is the right
> way to retrieve it? Should I pass also the shortcut? but how?
>
> thanks in advance
> Lorenzo
>

OK, I solved this myself: it looks like that due to the way the swtbot
matcher is built (withMnemonic), for context menu entries with a
shortcut you must specify the menu label and a single space, so, for the
example above it is

"Undo "

is it a bug? or the intended behavior?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
Previous Topic:source level debug of SWTBot code
Next Topic:SWTBot UI Test
Goto Forum:
  


Current Time: Mon Dec 22 22:52:46 GMT 2014

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

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