package org.mote.wiimote.whiteboard.gui;

import java.awt.Toolkit;
import java.awt.event.KeyEvent;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;

import org.jdesktop.application.Application;
import org.mote.wiimote.whiteboard.WiimoteWhiteboard;
import org.mote.wiimote.whiteboard.util.Util;

@SuppressWarnings("serial")
public class MenuBar extends JMenuBar {
	
	public MenuBar(PreferencesWindow pf, AboutWindow af, /*HelpHandler hh*/, LogWindow lw) {
		JMenu menu;
		JMenuItem item;
		
		if (!Util.MAC_OS_X) {
			menu = new JMenu(Util.getResourceMap(MenuBar.class).getString("editMenu"));
			menu.add(new JMenuItem(Util.getAction(pf, "preferences")));
			add(menu);
		}
		
		//menu = new JMenu(Util.getResourceMap(HelpHandler.class).getString("help"));
		
		//menu.add(item = new JMenuItem(Util.getAction(hh, "help")));
		if (Util.MAC_OS_X)
			item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, KeyEvent.SHIFT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
		
		//menu.addSeparator();

		//if (!Util.MAC_OS_X)
		//	menu.add(new JMenuItem(Util.getAction(af, "about")));
		
		//menu.add(new JMenuItem(Util.getAction(lw, "log")));
		
		//menu.addSeparator();
		
		//menu.add(new JMenuItem(Util.getAction(Application.getInstance(WiimoteWhiteboard.class), "donate")));

		add(menu);
	}

}
