@@ -1424,15 +1424,31 @@ protected void onIndexesUpdated() throws Exception {
14241424 onBoardOrPortChange ();
14251425 }
14261426
1427+ public void setMenuItemIncrementalMnemonic (JMenuItem item , int i ) {
1428+ char c ;
1429+ if (i >=0 && i <26 ) {
1430+ c = (char )(i +'a' );
1431+ } else if (i >=26 && i <26 *2 ) {
1432+ c = (char )(i -26 +'A' );
1433+ } else if (i >=26 *2 && i <26 *2 + 10 ) {
1434+ c = (char )(i -26 *2 +'0' );
1435+ } else {
1436+ return ;
1437+ }
1438+ item .setText (c + ". " + item .getText ());
1439+ item .setMnemonic (c );
1440+ }
1441+
14271442 public void rebuildBoardsMenu () throws Exception {
14281443 boardsCustomMenus = new LinkedList <>();
14291444
14301445 // The first custom menu is the "Board" selection submenu
14311446 JMenu boardMenu = new JMenu (tr ("Board" ));
1447+ boardMenu .setMnemonic ('B' );
14321448 boardMenu .putClientProperty ("removeOnWindowDeactivation" , true );
14331449 MenuScroller .setScrollerFor (boardMenu ).setTopFixedCount (1 );
14341450
1435- boardMenu . add ( new JMenuItem (new AbstractAction (tr ("Boards Manager..." )) {
1451+ JMenuItem menuItem = new JMenuItem (new AbstractAction (tr ("Boards Manager..." )) {
14361452 public void actionPerformed (ActionEvent actionevent ) {
14371453 String filterText = "" ;
14381454 String dropdownItem = "" ;
@@ -1448,7 +1464,9 @@ public void actionPerformed(ActionEvent actionevent) {
14481464 e .printStackTrace ();
14491465 }
14501466 }
1451- }));
1467+ });
1468+ menuItem .setMnemonic ('M' );
1469+ boardMenu .add (menuItem );
14521470 boardsCustomMenus .add (boardMenu );
14531471
14541472 // If there are no platforms installed we are done
@@ -1522,9 +1540,14 @@ public void actionPerformed(ActionEvent actionevent) {
15221540 }
15231541 } else {
15241542 // For multiple platforms, use submenus
1543+ // int i=0;
1544+ String keys ="" ;
1545+ int i =0 ;
15251546 for (JMenu platformMenu : platformMenus ) {
15261547 if (firstBoardItem == null && platformMenu .getItemCount () > 0 )
15271548 firstBoardItem = platformMenu .getItem (0 );
1549+ setMenuItemIncrementalMnemonic (platformMenu , i );
1550+ i ++;
15281551 boardMenu .add (platformMenu );
15291552 }
15301553 }
0 commit comments