@@ -47,7 +47,9 @@ public ExecuteCommandPopup(Shell parent, IWorkbench workbench, MenuDataList menu
4747 for (Character ch ='a' ;ch <='z' ;ch ++) {
4848 chars .add (ch );
4949 }
50- int charsSize = menuDataList .size ();
50+ int charsSize = chars .size ();
51+ if (menuDataList .size () < charsSize )
52+ charsSize = menuDataList .size ();
5153 String info = "use '0'" ;
5254 if (charsSize > 1 ) {
5355 if ( charsSize <= 10 ) {
@@ -71,7 +73,7 @@ protected Control createDialogArea(Composite parent) {
7173 listView .addKeyListener (this );
7274 for (int i =0 ;i <menuDataList .size ();i ++) {
7375 MenuData item = menuDataList .get (i );
74- String prefix = Character .toString (chars .get (i )) + ": " ;
76+ String prefix = ( i < chars . size () ? Character .toString (chars .get (i )) : "?" ) + ": " ;
7577 listView .add (prefix + item .getNameExpanded ());
7678 }
7779 listView .select (0 );
@@ -87,7 +89,7 @@ private void executeCommandFromList(int index) {
8789 index = selIndex ;
8890 }
8991 if (index < 0 || index >= menuDataList .size ()) {
90- //Activator.logError("executeCommandFromList: bad index " + index, null);
92+ //Activator.logError("executeCommandFromList: bad index " + index, null);
9193 return ;
9294 }
9395 listView .setSelection (index );
@@ -121,7 +123,7 @@ public void keyPressed(KeyEvent e) {
121123 executeCommandFromList ((e .keyCode - 'a' ) + ('9' - '0' + 1 ));
122124 }
123125 } else {
124- //Activator.logError("keyPressed", null);
126+ //Activator.logError("keyPressed", null);
125127 }
126128 }
127129
0 commit comments