@@ -47,7 +47,9 @@ public ExecuteCommandPopup(Shell parent, IWorkbench workbench, MenuDataList menu
47
47
for (Character ch ='a' ;ch <='z' ;ch ++) {
48
48
chars .add (ch );
49
49
}
50
- int charsSize = menuDataList .size ();
50
+ int charsSize = chars .size ();
51
+ if (menuDataList .size () < charsSize )
52
+ charsSize = menuDataList .size ();
51
53
String info = "use '0'" ;
52
54
if (charsSize > 1 ) {
53
55
if ( charsSize <= 10 ) {
@@ -71,7 +73,7 @@ protected Control createDialogArea(Composite parent) {
71
73
listView .addKeyListener (this );
72
74
for (int i =0 ;i <menuDataList .size ();i ++) {
73
75
MenuData item = menuDataList .get (i );
74
- String prefix = Character .toString (chars .get (i )) + ": " ;
76
+ String prefix = ( i < chars . size () ? Character .toString (chars .get (i )) : "?" ) + ": " ;
75
77
listView .add (prefix + item .getNameExpanded ());
76
78
}
77
79
listView .select (0 );
@@ -87,7 +89,7 @@ private void executeCommandFromList(int index) {
87
89
index = selIndex ;
88
90
}
89
91
if (index < 0 || index >= menuDataList .size ()) {
90
- //Activator.logError("executeCommandFromList: bad index " + index, null);
92
+ //Activator.logError("executeCommandFromList: bad index " + index, null);
91
93
return ;
92
94
}
93
95
listView .setSelection (index );
@@ -121,7 +123,7 @@ public void keyPressed(KeyEvent e) {
121
123
executeCommandFromList ((e .keyCode - 'a' ) + ('9' - '0' + 1 ));
122
124
}
123
125
} else {
124
- //Activator.logError("keyPressed", null);
126
+ //Activator.logError("keyPressed", null);
125
127
}
126
128
}
127
129
0 commit comments