@@ -1195,31 +1195,13 @@ public void rebuildBoardsMenu(JMenu toolsMenu, final Editor editor) {
1195
1195
1196
1196
// For every platform cycle through all boards
1197
1197
for (final String boardID : targetPlatform .getBoards ().keySet ()) {
1198
-
1199
- // PreferencesMap boardAttributes = boards.get(boardID);
1200
- // AbstractAction action = new AbstractAction(boardAttributes.get("name")) {
1201
- //
1202
- // @Override
1203
- // public void actionPerformed(ActionEvent e) {
1204
- // Preferences.set("target_package", (String) getValue("package"));
1205
- // Preferences.set("target_platform", (String) getValue("platform"));
1206
- // Preferences.set("board", (String) getValue("board"));
1207
- //
1208
- // filterVisibilityOfSubsequentBoardMenus((String) getValue("board"), 1);
1209
- //
1210
- // onBoardOrPortChange();
1211
- // Sketch.buildSettingChanged();
1212
- // rebuildImportMenu(Editor.importMenu, editor);
1213
- // rebuildExamplesMenu(Editor.examplesMenu);
1214
- //=======
1215
1198
// Setup a menu item for the current board
1216
1199
String boardName = boards .get (boardID ).get ("name" );
1217
1200
@ SuppressWarnings ("serial" )
1218
- AbstractAction action = new AbstractAction (boardName ) {
1201
+ Action action = new AbstractAction (boardName ) {
1219
1202
public void actionPerformed (ActionEvent actionevent ) {
1220
1203
selectBoard ((String ) getValue ("b" ), editor );
1221
1204
}
1222
-
1223
1205
};
1224
1206
action .putValue ("b" , packageName + ":" + platformName + ":" + boardID );
1225
1207
@@ -1242,8 +1224,8 @@ public void actionPerformed(ActionEvent actionevent) {
1242
1224
MapWithSubkeys boardCustomMenu = customMenu .get (boardID );
1243
1225
final int currentIndex = i + 1 + 1 ; //plus 1 to skip the first board menu, plus 1 to keep the custom menu next to this one
1244
1226
for (final String customMenuOption : boardCustomMenu .getKeys ()) {
1245
- action = new AbstractAction ( _ ( boardCustomMenu . getValueOf ( customMenuOption ))) {
1246
-
1227
+ @ SuppressWarnings ( "serial" )
1228
+ Action subAction = new AbstractAction ( _ ( boardCustomMenu . getValueOf ( customMenuOption ))) {
1247
1229
@ Override
1248
1230
public void actionPerformed (ActionEvent e ) {
1249
1231
Preferences .set ("target_package" , (String ) getValue ("package" ));
@@ -1259,17 +1241,16 @@ public void actionPerformed(ActionEvent e) {
1259
1241
rebuildExamplesMenu (Editor .examplesMenu );
1260
1242
}
1261
1243
};
1262
- action .putValue ("properties" , boardCustomMenu .getValues ());
1263
- action .putValue ("board" , boardID );
1264
- action .putValue ("custom_menu_option" , customMenuOption );
1265
- action .putValue ("package" , packageName );
1266
- action .putValue ("platform" , platformName );
1244
+ subAction .putValue ("board" , boardID );
1245
+ subAction .putValue ("custom_menu_option" , customMenuOption );
1246
+ subAction .putValue ("package" , packageName );
1247
+ subAction .putValue ("platform" , platformName );
1267
1248
1268
1249
if (!buttonGroupsMap .containsKey (customMenuID )) {
1269
1250
buttonGroupsMap .put (customMenuID , new ButtonGroup ());
1270
1251
}
1271
1252
1272
- item = new JRadioButtonMenuItem (action );
1253
+ item = new JRadioButtonMenuItem (subAction );
1273
1254
menu .add (item );
1274
1255
buttonGroupsMap .get (customMenuID ).add (item );
1275
1256
0 commit comments