()
| 259 | |
| 260 | |
| 261 | public JMenu buildHelpMenu() { |
| 262 | JMenu menu = new JMenu(Language.text("menu.help")); |
| 263 | JMenuItem item; |
| 264 | |
| 265 | // macOS already has its own about menu |
| 266 | if (!Platform.isMacOS()) { |
| 267 | item = new JMenuItem(Language.text("menu.help.about")); |
| 268 | item.addActionListener(e -> new About(JavaEditor.this)); |
| 269 | menu.add(item); |
| 270 | } |
| 271 | |
| 272 | item = new JMenuItem(Language.text("menu.help.welcome")); |
| 273 | item.addActionListener(e -> { |
| 274 | try { |
| 275 | new Welcome(base); |
| 276 | } catch (IOException ioe) { |
| 277 | Messages.showWarning("Unwelcome Error", |
| 278 | "Please report this error to\n" + |
| 279 | "https://github.com/processing/processing4/issues", ioe); |
| 280 | } |
| 281 | }); |
| 282 | menu.add(item); |
| 283 | |
| 284 | item = new JMenuItem(Language.text("menu.help.environment")); |
| 285 | item.addActionListener(e -> showReference("../environment/index.html")); |
| 286 | menu.add(item); |
| 287 | |
| 288 | item = new JMenuItem(Language.text("menu.help.reference")); |
| 289 | item.addActionListener(e -> showReference("index.html")); |
| 290 | menu.add(item); |
| 291 | |
| 292 | item = Toolkit.newJMenuItemShift(Language.text("menu.help.find_in_reference"), 'F'); |
| 293 | item.addActionListener(e -> { |
| 294 | if (textarea.isSelectionActive()) { |
| 295 | handleFindReference(); |
| 296 | } else { |
| 297 | statusNotice(Language.text("editor.status.find_reference.select_word_first")); |
| 298 | } |
| 299 | }); |
| 300 | menu.add(item); |
| 301 | |
| 302 | // Not gonna use "update" since it's more about re-downloading: |
| 303 | // it doesn't make sense to "update" the reference because it's |
| 304 | // specific to a version of the software anyway. [fry 221125] |
| 305 | // item = new JMenuItem(isReferenceDownloaded() ? |
| 306 | // "menu.help.reference.update" : "menu.help.reference.download"); |
| 307 | item = new JMenuItem(Language.text("menu.help.reference.download")); |
| 308 | item.addActionListener(e -> new Thread(this::downloadReference).start()); |
| 309 | menu.add(item); |
| 310 | |
| 311 | menu.addSeparator(); |
| 312 | |
| 313 | final JMenu libRefSubmenu = new JMenu(Language.text("menu.help.libraries_reference")); |
| 314 | |
| 315 | // Adding this in case references are included in a core library, |
| 316 | // or other core libraries are included in the future |
| 317 | boolean isCoreLibMenuItemAdded = |
| 318 | addLibReferencesToSubMenu(mode.coreLibraries, libRefSubmenu); |
nothing calls this directly
no test coverage detected