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

Method createToolMenuItem

app/src/processing/app/Editor.java:953–968  ·  view source on GitHub ↗
(String className)

Source from the content-addressed store, hash-verified

951 }
952
953 JMenuItem createToolMenuItem(String className) {
954 try {
955 final Tool tool = getOrCreateToolInstance(className);
956
957 JMenuItem item = new JMenuItem(tool.getMenuTitle());
958
959 tool.init(Editor.this);
960
961 item.addActionListener(event -> SwingUtilities.invokeLater(tool));
962 return item;
963
964 } catch (Exception e) {
965 e.printStackTrace();
966 return null;
967 }
968 }
969
970 private Tool getOrCreateToolInstance(String className) {
971 Tool internalTool = internalToolCache.get(className);

Callers 2

addInternalToolsMethod · 0.95
configurePopupMenuMethod · 0.80

Calls 4

getMenuTitleMethod · 0.95
initMethod · 0.95
printStackTraceMethod · 0.80

Tested by

no test coverage detected