()
| 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()) { |
no test coverage detected