MCPcopy Index your code
hub / github.com/benfry/processing4 / rebuildToolbarMenu

Method rebuildToolbarMenu

app/src/processing/app/Mode.java:411–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

409
410
411 protected void rebuildToolbarMenu() { //JMenu menu) {
412 JMenuItem item;
413 if (toolbarMenu == null) {
414 toolbarMenu = new JMenu();
415 } else {
416 toolbarMenu.removeAll();
417 }
418
419 //System.out.println("rebuilding toolbar menu");
420 // Add the single "Open" item
421 item = Toolkit.newJMenuItem("Open...", 'O');
422 item.addActionListener(e -> base.handleOpenPrompt());
423 toolbarMenu.add(item);
424
425 insertToolbarRecentMenu();
426
427 item = Toolkit.newJMenuItemShift("Examples...", 'O');
428 item.addActionListener(e -> showExamplesFrame());
429 toolbarMenu.add(item);
430
431 item = new JMenuItem(Language.text("examples.add_examples"));
432 item.addActionListener(e -> ContributionManager.openExamples());
433 toolbarMenu.add(item);
434
435 // Add a list of all sketches and subfolders
436 toolbarMenu.addSeparator();
437 base.populateSketchbookMenu(toolbarMenu);
438// boolean found = false;
439// try {
440// found = base.addSketches(toolbarMenu, base.getSketchbookFolder(), true);
441// } catch (IOException e) {
442// Base.showWarning("Sketchbook Toolbar Error",
443// "An error occurred while trying to list the sketchbook.", e);
444// }
445// if (!found) {
446// JMenuItem empty = new JMenuItem("(empty)");
447// empty.setEnabled(false);
448// toolbarMenu.add(empty);
449// }
450 }
451
452
453 protected int importMenuIndex = -1;

Callers 3

getToolbarMenuMethod · 0.95
rebuildSketchbookMethod · 0.80

Calls 9

newJMenuItemMethod · 0.95
newJMenuItemShiftMethod · 0.95
showExamplesFrameMethod · 0.95
textMethod · 0.95
openExamplesMethod · 0.95
handleOpenPromptMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected