Skip to content

Commit c4b89df

Browse files
committed
#149 "Unhandled event loop exception" with 36 menu items and quick menu
Signed-off-by: Andre Bossert <[email protected]>
1 parent b57b79d commit c4b89df

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

plugin/src/de/anbos/eclipse/easyshell/plugin/commands/ExecuteCommandPopup.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

plugin/src/de/anbos/eclipse/easyshell/plugin/types/Version.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public enum Version {
2525
v2_0_004(5, "v2.0 beta 4"),
2626
v2_0_005(6, "v2.0 RC1 / RC2"),
2727
v2_0_006(7, "v2.0 RC3 / Final"),
28-
v2_1_001(8, "v2.1 alpha 1"),
29-
v2_1_002(9, "v2.1 alpha 2"),
30-
v2_1_003(10, "v2.1 beta 1 / 2"),
31-
v2_1_004(11, "v2.1 beta 3"),
32-
v2_1_005(12, "v2.1 RC1");
28+
v2_1_001(8, "v2.1 alpha 1"),
29+
v2_1_002(9, "v2.1 alpha 2"),
30+
v2_1_003(10, "v2.1 beta 1 / 2"),
31+
v2_1_004(11, "v2.1 beta 3"),
32+
v2_1_005(12, "v2.1 beta 4 / RC1");
3333
// actual version is always the last one!
3434
public static Version actual = Version.values()[Version.values().length-1];
3535
// attributes

0 commit comments

Comments
 (0)