MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / addItem

Method addItem

ij/src/main/java/ij/Menus.java:462–486  ·  view source on GitHub ↗
(Menu menu, String label, int shortcut, boolean shift)

Source from the content-addressed store, hash-verified

460 }
461
462 static void addItem(Menu menu, String label, int shortcut, boolean shift) {
463 if (menu==null)
464 return;
465 MenuItem item;
466 if (shortcut==0)
467 item = new MenuItem(label);
468 else {
469 if (shift) {
470 item = new MenuItem(label, new MenuShortcut(shortcut, true));
471 shortcuts.put(Integer.valueOf(shortcut+200),label);
472 } else {
473 item = new MenuItem(label, new MenuShortcut(shortcut));
474 shortcuts.put(Integer.valueOf(shortcut),label);
475 }
476 }
477 if (addSorted) {
478 if (menu==pluginsMenu)
479 addItemSorted(menu, item, userPluginsIndex);
480 else
481 addOrdered(menu, item);
482 } else
483 menu.add(item);
484 item.addActionListener(ij);
485 fixFontSize(item);
486 }
487
488 void addPlugInItem(Menu menu, String label, String className, int shortcut, boolean shift) {
489 pluginsTable.put(label, className);

Callers 11

addMenuBarMethod · 0.95
addPlugInItemMethod · 0.95
addPluginItemMethod · 0.95
addMethod · 0.95
replaceItemsMethod · 0.45
addChoiceMethod · 0.45
replaceItemsMethod · 0.45
actionPerformedMethod · 0.45
createComboPanelMethod · 0.45

Calls 7

addItemSortedMethod · 0.95
addOrderedMethod · 0.95
fixFontSizeMethod · 0.95
valueOfMethod · 0.80
addActionListenerMethod · 0.80
addMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected