1 /*
2  * Created on 02-dic-2005
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */
7 package org.herac.tuxguitar.gui.items.menu;
8 
9 import org.eclipse.swt.SWT;
10 import org.eclipse.swt.widgets.Menu;
11 import org.eclipse.swt.widgets.MenuItem;
12 import org.eclipse.swt.widgets.Shell;
13 import org.herac.tuxguitar.gui.TuxGuitar;
14 import org.herac.tuxguitar.gui.actions.help.ShowAboutAction;
15 import org.herac.tuxguitar.gui.actions.help.ShowDocAction;
16 import org.herac.tuxguitar.gui.items.MenuItems;
17 
18 /**
19  * @author julian
20  *
21  * TODO To change the template for this generated type comment go to
22  * Window - Preferences - Java - Code Style - Code Templates
23  */
24 public class HelpMenuItem extends MenuItems{
25 	private MenuItem helpMenuItem;
26 	private Menu menu;
27 	private MenuItem doc;
28 	private MenuItem about;
29 
HelpMenuItem(Shell shell,Menu parent, int style)30 	public HelpMenuItem(Shell shell,Menu parent, int style) {
31 		this.helpMenuItem = new MenuItem(parent, style);
32 		this.menu = new Menu(shell, SWT.DROP_DOWN);
33 	}
34 
showItems()35 	public void showItems(){
36 		//--Doc
37 		this.doc = new MenuItem(this.menu, SWT.PUSH);
38 		this.doc.addSelectionListener(TuxGuitar.instance().getAction(ShowDocAction.NAME));
39 
40 		//--ABOUT
41 		this.about = new MenuItem(this.menu, SWT.PUSH);
42 		this.about.addSelectionListener(TuxGuitar.instance().getAction(ShowAboutAction.NAME));
43 
44 		this.helpMenuItem.setMenu(this.menu);
45 
46 		this.loadIcons();
47 		this.loadProperties();
48 	}
49 
loadProperties()50 	public void loadProperties(){
51 		setMenuItemTextAndAccelerator(this.helpMenuItem, "help", null);
52 		setMenuItemTextAndAccelerator(this.doc, "help.doc", ShowDocAction.NAME);
53 		setMenuItemTextAndAccelerator(this.about, "help.about", ShowAboutAction.NAME);
54 	}
55 
loadIcons()56 	public void loadIcons(){
57 		//Nothing to do
58 	}
59 
update()60 	public void update(){
61 		//Nothing to do
62 	}
63 }
64