trayMenuExit.addActionListener(arg0 -> System.exit(0)); trayMenuAutorip = new CheckboxMenuItem("Clipboard Autorip"); trayMenuAutorip.addItemListener(arg0 -> { ClipboardUtils.setClipboardAutoRip(trayMenuAutorip.getState()); configClipboardAutorip.setSelected(trayMenuAutorip.getState());
private void addItem(String name) { CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet)); item.addItemListener(this); switchPopup.add(item); }
private void addItem(String name) { CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet)); item.addItemListener(this); switchPopup.add(item); }
private void addBuiltInTool(String name) { CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet)); item.addItemListener(this); item.setActionCommand("Tool"); switchPopup.add(item); }
CheckboxMenuItem addCheckboxItem(Menu menu, String label, String className) { pluginsTable.put(label, className); nPlugins++; CheckboxMenuItem item = new CheckboxMenuItem(label); menu.add(item); item.addItemListener(ij); item.setState(false); return item; }
private void addPluginTool(String name) { CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet)); item.addItemListener(this); item.setActionCommand("Plugin Tool"); switchPopup.add(item); }
CheckboxMenuItem addCheckboxItem(Menu menu, String label, String className) { pluginsTable.put(label, className); nPlugins++; CheckboxMenuItem item = new CheckboxMenuItem(label); menu.add(item); item.addItemListener(ij); item.setState(false); return item; }
private void addPluginTool(String name) { CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet)); item.addItemListener(this); item.setActionCommand("Plugin Tool"); switchPopup.add(item); }
private void addBuiltInTool(String name) { CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet)); item.addItemListener(this); item.setActionCommand("Tool"); switchPopup.add(item); }
cbmi.addItemListener(this); cbmi.setState(false); items.add(cbmi);
MenuItem addPopupItem(PopupMenu popupMenu, String s, boolean isCheckboxItem) { MenuItem mi = null; if (isCheckboxItem) { mi = new CheckboxMenuItem(s); ((CheckboxMenuItem)mi).addItemListener(this); } else { mi = new MenuItem(s); mi.addActionListener(this); } popupMenu.add(mi); return mi; }
MenuItem addPopupItem(PopupMenu popupMenu, String s, boolean isCheckboxItem) { MenuItem mi = null; if (isCheckboxItem) { mi = new CheckboxMenuItem(s); ((CheckboxMenuItem)mi).addItemListener(this); } else { mi = new MenuItem(s); mi.addActionListener(this); } popupMenu.add(mi); return mi; }
_native.addItemListener(this.callback);
/** Adds one image to the end of the Window menu. */ static synchronized void addWindowMenuItem(ImagePlus imp) { if (ij==null) return; String name = imp.getTitle(); String size = ImageWindow.getImageSize(imp); CheckboxMenuItem item = new CheckboxMenuItem(name+" "+size); item.setActionCommand("" + imp.getID()); window.add(item); item.addItemListener(ij); }
/** Inserts one item (a non-image window) into the Window menu. */ static synchronized void insertWindowMenuItem(Window win) { if (ij==null || win==null) return; String title = win instanceof Frame?((Frame)win).getTitle():((Dialog)win).getTitle(); CheckboxMenuItem item = new CheckboxMenuItem(title); item.addItemListener(ij); int index = WINDOW_MENU_ITEMS+windowMenuItems2; if (windowMenuItems2>=2) index--; window.insert(item, index); windowMenuItems2++; if (windowMenuItems2==1) { window.insertSeparator(WINDOW_MENU_ITEMS+windowMenuItems2); windowMenuItems2++; } }
/** Adds one image to the end of the Window menu. */ static synchronized void addWindowMenuItem(ImagePlus imp) { if (ij==null) return; String name = imp.getTitle(); String size = ImageWindow.getImageSize(imp); CheckboxMenuItem item = new CheckboxMenuItem(name+" "+size); item.setActionCommand("" + imp.getID()); window.add(item); item.addItemListener(ij); }
/** Inserts one item (a non-image window) into the Window menu. */ static synchronized void insertWindowMenuItem(Window win) { if (ij==null || win==null) return; String title = win instanceof Frame?((Frame)win).getTitle():((Dialog)win).getTitle(); CheckboxMenuItem item = new CheckboxMenuItem(title); item.addItemListener(ij); int index = WINDOW_MENU_ITEMS+windowMenuItems2; if (windowMenuItems2>=2) index--; window.insert(item, index); windowMenuItems2++; if (windowMenuItems2==1) { window.insertSeparator(WINDOW_MENU_ITEMS+windowMenuItems2); windowMenuItems2++; } }
public PlayerTrayIcon(boolean windowVisible) { icon = new TrayIcon(NORMAL_ICON, "Radioblock"); startItem = new MenuItem("Start"); startItem.setActionCommand("start"); startItem.setEnabled(true); startItem.addActionListener(e -> listener.startPlayer()); stopItem = new MenuItem("Stop"); stopItem.setActionCommand("stop"); stopItem.setEnabled(false); stopItem.addActionListener(e -> listener.stopPlayer()); showWindowItem = new CheckboxMenuItem("Show window"); showWindowItem.setState(windowVisible); showWindowItem.addItemListener(e -> listener.setWindowVisibility(showWindowItem.getState())); MenuItem quitItem = new MenuItem("Quit"); quitItem.setActionCommand("quit"); quitItem.addActionListener(e -> System.exit(0)); final PopupMenu popup = new PopupMenu(); popup.add(startItem); popup.add(stopItem); popup.add(showWindowItem); popup.add(quitItem); icon.setPopupMenu(popup); try { SystemTray.getSystemTray().add(icon); } catch (AWTException e) { throw new RuntimeException(e); } }
public void createPopup() { popup = new PopupMenu(""); add = new MenuItem("Add Label"); popup.add(add); remove = new MenuItem("Remove Label"); // FIXME: there's no point in adding this option since // it just creates a RuntimeException at the moment. // popup.add(remove); rename = new MenuItem("Rename Label"); popup.add(rename); color = new MenuItem("Change Color"); popup.add(color); popup.addSeparator(); lock = new CheckboxMenuItem("Locked"); popup.add(lock); add.addActionListener(this); remove.addActionListener(this); rename.addActionListener(this); color.addActionListener(this); lock.addItemListener(this); add(popup); }
compress.addItemListener(e -> userPreferences.setCompressFile(compress.getState())); sync.addItemListener(e -> userPreferences.setSyncMaps(sync.getState()));