MCPcopy
hub / github.com/arduino/Arduino / addProgrammersForPlatform

Method addProgrammersForPlatform

app/src/processing/app/Base.java:1721–1739  ·  view source on GitHub ↗
(TargetPlatform platform, List<JMenuItem> menus, ButtonGroup group)

Source from the content-addressed store, hash-verified

1719 }
1720
1721 public void addProgrammersForPlatform(TargetPlatform platform, List<JMenuItem> menus, ButtonGroup group) {
1722 for (String programmer : platform.getProgrammers().keySet()) {
1723 String id = platform.getContainerPackage().getId() + ":" + programmer;
1724
1725 @SuppressWarnings("serial")
1726 AbstractAction action = new AbstractAction(platform.getProgrammer(programmer).get("name")) {
1727 public void actionPerformed(ActionEvent actionevent) {
1728 PreferencesData.set("programmer", "" + getValue("id"));
1729 }
1730 };
1731 action.putValue("id", id);
1732 JMenuItem item = new JRadioButtonMenuItem(action);
1733 if (PreferencesData.get("programmer").equals(id)) {
1734 item.setSelected(true);
1735 }
1736 group.add(item);
1737 menus.add(item);
1738 }
1739 }
1740
1741 /**
1742 * Scan a folder recursively, and add any sketches found to the menu

Callers 1

rebuildProgrammerMenuMethod · 0.95

Calls 8

getMethod · 0.95
getProgrammersMethod · 0.65
getIdMethod · 0.65
getContainerPackageMethod · 0.65
getMethod · 0.65
getProgrammerMethod · 0.65
equalsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected