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.tool;
9
import org.eclipse.swt.SWT;
10
import org.eclipse.swt.widgets.ToolBar;
11
import org.eclipse.swt.widgets.ToolItem;
12
import org.herac.tuxguitar.gui.TuxGuitar;
13
import org.herac.tuxguitar.gui.actions.marker.AddMarkerAction;
14
import org.herac.tuxguitar.gui.actions.marker.GoFirstMarkerAction;
15
import org.herac.tuxguitar.gui.actions.marker.GoLastMarkerAction;
16
import org.herac.tuxguitar.gui.actions.marker.GoNextMarkerAction;
17
import org.herac.tuxguitar.gui.actions.marker.GoPreviousMarkerAction;
18
import org.herac.tuxguitar.gui.actions.marker.ListMarkersAction;
19
import org.herac.tuxguitar.gui.items.ToolItems;
23
* TODO To change the template for this generated type comment go to
24
* Window - Preferences - Java - Code Style - Code Templates
26
public class MarkerToolItems extends ToolItems{
27
public static final String NAME = "marker.items";
30
private ToolItem list;
31
private ToolItem first;
32
private ToolItem last;
33
private ToolItem previous;
34
private ToolItem next;
36
public MarkerToolItems(){
40
public void showItems(ToolBar toolBar){
42
this.add = new ToolItem(toolBar, SWT.PUSH);
43
this.add.addSelectionListener(TuxGuitar.instance().getAction(AddMarkerAction.NAME));
46
this.list = new ToolItem(toolBar, SWT.PUSH);
47
this.list.addSelectionListener(TuxGuitar.instance().getAction(ListMarkersAction.NAME));
50
new ToolItem(toolBar, SWT.SEPARATOR);
53
this.first = new ToolItem(toolBar, SWT.PUSH);
54
this.first.addSelectionListener(TuxGuitar.instance().getAction(GoFirstMarkerAction.NAME));
57
this.previous = new ToolItem(toolBar, SWT.PUSH);
58
this.previous.addSelectionListener(TuxGuitar.instance().getAction(GoPreviousMarkerAction.NAME));
61
this.next = new ToolItem(toolBar, SWT.PUSH);
62
this.next.addSelectionListener(TuxGuitar.instance().getAction(GoNextMarkerAction.NAME));
65
this.last = new ToolItem(toolBar, SWT.PUSH);
66
this.last.addSelectionListener(TuxGuitar.instance().getAction(GoLastMarkerAction.NAME));
69
this.loadProperties();
76
public void loadProperties(){
77
this.add.setToolTipText(TuxGuitar.getProperty("marker.add"));
78
this.list.setToolTipText(TuxGuitar.getProperty("marker.list"));
79
this.first.setToolTipText(TuxGuitar.getProperty("marker.first"));
80
this.last.setToolTipText(TuxGuitar.getProperty("marker.last"));
81
this.previous.setToolTipText(TuxGuitar.getProperty("marker.previous"));
82
this.next.setToolTipText(TuxGuitar.getProperty("marker.next"));
85
public void loadIcons(){
86
this.add.setImage(TuxGuitar.instance().getIconManager().getMarkerAdd());
87
this.list.setImage(TuxGuitar.instance().getIconManager().getMarkerList());
88
this.first.setImage(TuxGuitar.instance().getIconManager().getMarkerFirst());
89
this.previous.setImage(TuxGuitar.instance().getIconManager().getMarkerPrevious());
90
this.next.setImage(TuxGuitar.instance().getIconManager().getMarkerNext());
91
this.last.setImage(TuxGuitar.instance().getIconManager().getMarkerLast());