1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

avoid "Menu has no enabled items" exception

This commit is contained in:
Federico Fissore 2012-11-06 15:16:32 +01:00
parent 73649c2f60
commit 90ecc3773d

View File

@ -1140,7 +1140,6 @@ public class Base {
// Cycle through all packages
for (TargetPackage targetPackage : packages.values()) {
String packageName = targetPackage.getName();
// For every package cycle through all platform
for (TargetPlatform targetPlatform : targetPackage.platforms()) {
String platformName = targetPlatform.getName();
@ -1247,15 +1246,15 @@ public class Base {
}
}
}
}
if (menuItemsToClickAfterStartup.isEmpty()) {
menuItemsToClickAfterStartup.add(selectFirstEnabledMenuItem(boardsMenu));
}
if (menuItemsToClickAfterStartup.isEmpty()) {
menuItemsToClickAfterStartup.add(selectFirstEnabledMenuItem(boardsMenu));
}
for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup) {
menuItemToClick.setSelected(true);
menuItemToClick.getAction().actionPerformed(new ActionEvent(this, -1, ""));
}
for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup) {
menuItemToClick.setSelected(true);
menuItemToClick.getAction().actionPerformed(new ActionEvent(this, -1, ""));
}
}