Source:
<code>private void buildSketchMenu(JMenu sketchMenu) { sketchMenu.removeAll(); JMenuItem item = newJMenuItem(tr("Verify/Compile"), 'R'); item.addActionListener(event -> handleRun(false, presentHandler, runHandler)); sketchMenu.add(item); item = newJMenuItem(tr("Upload"), 'U'); item.addActionListener(event -> handleExport(false)); sketchMenu.add(item); <START> String OS = System.getProperty("os.name").toLowerCase(); <END> if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") >= 0){ item = newJMenuItemAlt(tr("Upload Using Programmer"), 'U'); } else { item = newJMenuItemShift(tr("Upload Using Programmer"), 'U'); } item.addActionListener(event -> handleExport(true)); sketchMenu.add(item); item = newJMenuItemAlt(tr("Export compiled Binary"), 'S'); item.addActionListener(event -> { if (!(new CanExportInSketchFolder().test(sketchController))) { System.out.println(tr("Export canceled, changes must first be saved.")); return; } handleRun(false, new CanExportInSketchFolder(), presentAndSaveHandler, runAndSaveHandler); }); sketchMenu.add(item); sketchMenu.addSeparator(); item = newJMenuItem(tr("Show Sketch Folder"), 'K'); item.addActionListener(event -> Base.openFolder(sketch.getFolder())); sketchMenu.add(item); item.setEnabled(Base.openFolderAvailable()); if (importMenu == null) { importMenu = new JMenu(tr("Include Library")); MenuScroller.setScrollerFor(importMenu); base.rebuildImportMenu(importMenu); } sketchMenu.add(importMenu); item = new JMenuItem(tr("Add File...")); item.addActionListener(event -> sketchController.handleAddFile()); sketchMenu.add(item); }</code><technical_language>helpers recognize operating systems, them. THis if (OSUtils.isWindows()) { item = newJMenuItemShift(tr("Upload Programmer"), 'U'); } else { item = newJMenuItemAlt(tr("Upload Programmer"), 'U'); }</technical_language>

Target:
private void buildSketchMenu(JMenu sketchMenu) { sketchMenu.removeAll(); JMenuItem item = newJMenuItem(tr("Verify/Compile"), 'R'); item.addActionListener(event -> handleRun(false, presentHandler, runHandler)); sketchMenu.add(item); item = newJMenuItem(tr("Upload"), 'U'); item.addActionListener(event -> handleExport(false)); sketchMenu.add(item); if (OSUtils.isLinux()) { item = newJMenuItemAlt(tr("Upload Using Programmer"), 'U'); } else { item = newJMenuItemShift(tr("Upload Using Programmer"), 'U'); } item.addActionListener(event -> handleExport(true)); sketchMenu.add(item); item = newJMenuItemAlt(tr("Export compiled Binary"), 'S'); item.addActionListener(event -> { if (!(new CanExportInSketchFolder().test(sketchController))) { System.out.println(tr("Export canceled, changes must first be saved.")); return; } handleRun(false, new CanExportInSketchFolder(), presentAndSaveHandler, runAndSaveHandler); }); sketchMenu.add(item); sketchMenu.addSeparator(); item = newJMenuItem(tr("Show Sketch Folder"), 'K'); item.addActionListener(event -> Base.openFolder(sketch.getFolder())); sketchMenu.add(item); item.setEnabled(Base.openFolderAvailable()); if (importMenu == null) { importMenu = new JMenu(tr("Include Library")); MenuScroller.setScrollerFor(importMenu); base.rebuildImportMenu(importMenu); } sketchMenu.add(importMenu); item = new JMenuItem(tr("Add File...")); item.addActionListener(event -> sketchController.handleAddFile()); sketchMenu.add(item); }