groovy

Mnemonics don't work correctly in SwingBuilder

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-4
  • Fix Version/s: 1.0-beta-6
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP
  • Number of attachments :
    0

Description

If I have an entry something like this:

menuBar {
menu(text:'Help', mnemonic:'H') {

The Mnemonic is not set, in fact this throws an 'Argument type or mismatch' exception.

changing the code to

menuBar {
menu(text:'Help', mnemonic:1) {

helps in that there is no exception but I still don't get the mnemonic.

James suggested this as a work around:

menu(text:'Help', mnemonic:'H'.charAt(0)) {

and that works.

However if I have the following

menuItem() {
action(name:'Open', mnemonic:'O'.charAt(0), closure:{ ... })

The mnemonic still doesn't work

Activity

Hide
james strachan added a comment -

Here you go!

Show
james strachan added a comment - Here you go!
Hide
Danno Ferrin added a comment -

Patch is in GROOVY-333.

Rather than unsing mnemonicKey use mnemonic:. Passing in a number will use the number, anything else will take the first character of the toString(). Yes an empty string will blow it up.

Show
Danno Ferrin added a comment - Patch is in GROOVY-333. Rather than unsing mnemonicKey use mnemonic:. Passing in a number will use the number, anything else will take the first character of the toString(). Yes an empty string will blow it up.
Hide
Guillaume Laforge added a comment -

Fixed by GROOVY-501

Show
Guillaume Laforge added a comment - Fixed by GROOVY-501

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: