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

Method rebuildProgrammerMenu

app/src/processing/app/Base.java:1694–1719  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1692 }
1693
1694 public void rebuildProgrammerMenu() {
1695 programmerMenus = new LinkedList<>();
1696 ButtonGroup group = new ButtonGroup();
1697
1698 TargetBoard board = BaseNoGui.getTargetBoard();
1699 if (board != null) {
1700 TargetPlatform boardPlatform = board.getContainerPlatform();
1701 TargetPlatform corePlatform = null;
1702
1703 String core = board.getPreferences().get("build.core");
1704 if (core != null && core.contains(":")) {
1705 String[] split = core.split(":", 2);
1706 corePlatform = BaseNoGui.getCurrentTargetPlatformFromPackage(split[0]);
1707 }
1708
1709 addProgrammersForPlatform(boardPlatform, programmerMenus, group);
1710 if (corePlatform != null)
1711 addProgrammersForPlatform(corePlatform, programmerMenus, group);
1712 }
1713
1714 if (programmerMenus.isEmpty()) {
1715 JMenuItem item = new JMenuItem(tr("No programmers available for this board"));
1716 item.setEnabled(false);
1717 programmerMenus.add(item);
1718 }
1719 }
1720
1721 public void addProgrammersForPlatform(TargetPlatform platform, List<JMenuItem> menus, ButtonGroup group) {
1722 for (String programmer : platform.getProgrammers().keySet()) {

Callers 5

BaseMethod · 0.95
onIndexesUpdatedMethod · 0.95
openBoardsManagerMethod · 0.95
actionPerformedMethod · 0.95
buildToolsMenuMethod · 0.80

Calls 11

getTargetBoardMethod · 0.95
getContainerPlatformMethod · 0.95
getPreferencesMethod · 0.95
splitMethod · 0.80
trMethod · 0.80
getMethod · 0.65
isEmptyMethod · 0.45
setEnabledMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected