MCPcopy Index your code
hub / github.com/processing/processing / newJMenuItem

Method newJMenuItem

app/src/processing/app/ui/Toolkit.java:179–184  ·  view source on GitHub ↗

A software engineer, somewhere, needs to have their abstraction taken away. Who crafts the sort of API that would require a five-line helper function just to set the shortcut key for a menu item?

(String title, int what)

Source from the content-addressed store, hash-verified

177 * menu item?
178 */
179 static public JMenuItem newJMenuItem(String title, int what) {
180 JMenuItem menuItem = new JMenuItem(title);
181 int modifiers = awtToolkit.getMenuShortcutKeyMask();
182 menuItem.setAccelerator(KeyStroke.getKeyStroke(what, modifiers));
183 return menuItem;
184 }
185
186
187 /**

Callers 7

rebuildToolbarMenuMethod · 0.95
buildFileMenuMethod · 0.95
buildFileMenuMethod · 0.95
buildEditMenuMethod · 0.95
buildSketchMenuMethod · 0.95
buildSketchMenuMethod · 0.95
buildDebugMenuMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected