use of java.awt.MenuItem in project jdk8u_jdk by JetBrains.
the class CMenu method setEnabled.
@Override
public final void setEnabled(final boolean b) {
super.setEnabled(b);
final Menu target = (Menu) getTarget();
final int count = target.getItemCount();
for (int i = 0; i < count; ++i) {
MenuItem item = target.getItem(i);
MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item);
if (p != null) {
p.setEnabled(b && item.isEnabled());
}
}
}
use of java.awt.MenuItem in project processdash by dtuma.
the class MenuHandler method makeShowWindowMenuItem.
private MenuItem makeShowWindowMenuItem(ProcessDashboard pdash) {
String windowTitle = pdash.getTitle();
String menuText = res.format("Show_Window_FMT", windowTitle);
MenuItem showWindow = new MenuItem(menuText);
showWindow.addActionListener(showWindowAction);
return showWindow;
}
use of java.awt.MenuItem in project processdash by dtuma.
the class MenuHandler method makeChangeTaskMenuItem.
private MenuItem makeChangeTaskMenuItem() {
MenuItem changeTaskItem = new MenuItem(res.getString("Change_Task"));
changeTaskItem.addActionListener(changeTaskAction);
return changeTaskItem;
}
use of java.awt.MenuItem in project screenbird by adamhub.
the class ScreenRecorder method createTray.
/**
* Sets up the system tray for screenRecorder application
*/
private void createTray() {
PopupMenu menu = new PopupMenu();
MenuItem aboutItem = new MenuItem("About");
aboutItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(jfRecorderPanel, String.format("Screenbird%nBuild Version %s", RecorderPanel.resources.getString("BUILD")));
}
});
menu.add(aboutItem);
// Open the settings menu
MenuItem settingsItem = new MenuItem("Preferences");
settingsItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (jpRecorderPanel.isRecorderConfigSate())
jpRecorderPanel.showSettingsForm();
}
});
menu.add(settingsItem);
// Hide or show the recorder
MenuItem messageItem = new MenuItem("Hide/Show");
messageItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (jfRecorderPanel.getState() == JFrame.NORMAL) {
jfRecorderPanel.setState(JFrame.ICONIFIED);
} else {
jfRecorderPanel.setState(JFrame.NORMAL);
}
}
});
menu.add(messageItem);
MenuItem closeItem = new MenuItem("Quit/Exit");
closeItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
destroy();
}
});
menu.add(closeItem);
// Loads the pastevid logo
Image icon = Toolkit.getDefaultToolkit().getImage(getClass().getResource(ResourceUtil.LOGO_16));
if (!MediaUtil.osIsWindows()) {
icon = Toolkit.getDefaultToolkit().getImage(getClass().getResource(ResourceUtil.LOGO_24));
}
// Assigns the pastevid logo
TrayIcon tray = new TrayIcon(icon, "Screenbird", menu);
try {
SystemTray.getSystemTray().add(tray);
} catch (AWTException ex) {
log(ex);
}
}
use of java.awt.MenuItem in project openblocks by mikaelhg.
the class ContextMenu method initRemoveCommentMenu.
/**
* Initializes the context menu for deleting Comments.
*/
private static void initRemoveCommentMenu() {
removeCommentItem = new MenuItem("Delete Comment");
removeCommentItem.setActionCommand(REMOVE_COMMENT_BLOCK);
removeCommentItem.addActionListener(rndBlockMenu);
removeCommentMenu.add(removeCommentItem);
//rndBlockMenu.add(runBlockItem);
removeCommentMenuInit = true;
}
Aggregations