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

Method rebuildToolbarMenu

app/src/processing/app/Base.java:1052–1077  ·  view source on GitHub ↗
(JMenu menu)

Source from the content-addressed store, hash-verified

1050
1051
1052 protected void rebuildToolbarMenu(JMenu menu) {
1053 JMenuItem item;
1054 menu.removeAll();
1055
1056 // Add the single "Open" item
1057 item = Editor.newJMenuItem(tr("Open..."), 'O');
1058 item.addActionListener(new ActionListener() {
1059 public void actionPerformed(ActionEvent e) {
1060 try {
1061 handleOpenPrompt();
1062 } catch (Exception e1) {
1063 e1.printStackTrace();
1064 }
1065 }
1066 });
1067 menu.add(item);
1068 menu.addSeparator();
1069
1070 // Add a list of all sketches and subfolders
1071 boolean sketches = addSketches(menu, BaseNoGui.getSketchbookFolder());
1072 if (sketches) menu.addSeparator();
1073
1074 // Add each of the subfolders of examples directly to the menu
1075 boolean found = addSketches(menu, BaseNoGui.getExamplesFolder());
1076 if (found) menu.addSeparator();
1077 }
1078
1079
1080 protected void rebuildSketchbookMenu(JMenu menu) {

Callers 2

runMethod · 0.95
EditorMethod · 0.80

Calls 6

newJMenuItemMethod · 0.95
addSketchesMethod · 0.95
getSketchbookFolderMethod · 0.95
getExamplesFolderMethod · 0.95
trMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected