2
* Created on 02-dic-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.gui.items.menu;
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.marker.AddMarkerAction;
15
import org.herac.tuxguitar.gui.actions.marker.GoFirstMarkerAction;
16
import org.herac.tuxguitar.gui.actions.marker.GoLastMarkerAction;
17
import org.herac.tuxguitar.gui.actions.marker.GoNextMarkerAction;
18
import org.herac.tuxguitar.gui.actions.marker.GoPreviousMarkerAction;
19
import org.herac.tuxguitar.gui.actions.marker.ListMarkersAction;
20
import org.herac.tuxguitar.gui.items.MenuItems;
25
* TODO To change the template for this generated type comment go to
26
* Window - Preferences - Java - Code Style - Code Templates
28
public class MarkerMenuItem implements MenuItems{
29
private MenuItem markerMenuItem;
32
private MenuItem list;
33
private MenuItem first;
34
private MenuItem last;
35
private MenuItem next;
36
private MenuItem previous;
38
public MarkerMenuItem(Shell shell,Menu parent, int style) {
39
this.markerMenuItem = new MenuItem(parent, style);
40
this.menu = new Menu(shell, SWT.DROP_DOWN);
43
public void showItems(){
45
this.add = new MenuItem(this.menu, SWT.PUSH);
46
this.add.addSelectionListener(TuxGuitar.instance().getAction(AddMarkerAction.NAME));
49
this.list = new MenuItem(this.menu, SWT.PUSH);
50
this.list.addSelectionListener(TuxGuitar.instance().getAction(ListMarkersAction.NAME));
53
new MenuItem(this.menu, SWT.SEPARATOR);
56
this.first = new MenuItem(this.menu, SWT.PUSH);
57
this.first.addSelectionListener(TuxGuitar.instance().getAction(GoFirstMarkerAction.NAME));
60
this.previous = new MenuItem(this.menu, SWT.PUSH);
61
this.previous.addSelectionListener(TuxGuitar.instance().getAction(GoPreviousMarkerAction.NAME));
64
this.next = new MenuItem(this.menu, SWT.PUSH);
65
this.next.addSelectionListener(TuxGuitar.instance().getAction(GoNextMarkerAction.NAME));
68
this.last = new MenuItem(this.menu, SWT.PUSH);
69
this.last.addSelectionListener(TuxGuitar.instance().getAction(GoLastMarkerAction.NAME));
71
this.markerMenuItem.setMenu(this.menu);
74
this.loadProperties();
81
public void loadProperties(){
82
this.markerMenuItem.setText(TuxGuitar.getProperty("marker"));
83
this.add.setText(TuxGuitar.getProperty("marker.add"));
84
this.list.setText(TuxGuitar.getProperty("marker.list"));
85
this.first.setText(TuxGuitar.getProperty("marker.first"));
86
this.last.setText(TuxGuitar.getProperty("marker.last"));
87
this.previous.setText(TuxGuitar.getProperty("marker.previous"));
88
this.next.setText(TuxGuitar.getProperty("marker.next"));
91
public void loadIcons(){
92
this.add.setImage(TuxGuitar.instance().getIconManager().getMarkerAdd());
93
this.list.setImage(TuxGuitar.instance().getIconManager().getMarkerList());
94
this.first.setImage(TuxGuitar.instance().getIconManager().getMarkerFirst());
95
this.previous.setImage(TuxGuitar.instance().getIconManager().getMarkerPrevious());
96
this.next.setImage(TuxGuitar.instance().getIconManager().getMarkerNext());
97
this.last.setImage(TuxGuitar.instance().getIconManager().getMarkerLast());