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.SystemImages;
13
import org.herac.tuxguitar.gui.TuxGuitar;
14
import org.herac.tuxguitar.gui.actions.composition.ChangeTempoAction;
15
import org.herac.tuxguitar.gui.actions.composition.ChangeTimeSignatureAction;
16
import org.herac.tuxguitar.gui.actions.insert.CloseRepeatAction;
17
import org.herac.tuxguitar.gui.actions.insert.OpenRepeatAction;
18
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 CompositionToolItems extends ToolItems{
27
public static final String NAME = "composition.items";
29
private ToolBar toolBar;
30
private ToolItem tempo;
31
private ToolItem timeSignature;
32
private ToolItem openRepeat;
33
private ToolItem closeRepeat;
35
public CompositionToolItems(){
39
public void showItems(ToolBar toolBar){
40
this.toolBar = toolBar;
42
this.tempo = new ToolItem(toolBar, SWT.PUSH);
43
this.tempo.setImage(SystemImages.TEMPO_ICON_IMAGE);
44
this.tempo.addSelectionListener(TuxGuitar.instance().getAction(ChangeTempoAction.NAME));
46
this.timeSignature = new ToolItem(toolBar, SWT.PUSH);
47
this.timeSignature.setImage(SystemImages.TIME_SIGNATURE_IMAGE);
48
this.timeSignature.addSelectionListener(TuxGuitar.instance().getAction(ChangeTimeSignatureAction.NAME));
50
new ToolItem(toolBar, SWT.SEPARATOR);
52
this.openRepeat = new ToolItem(toolBar, SWT.PUSH);
53
this.openRepeat.setImage(SystemImages.OPEN_REPEAT_IMAGE);
54
this.openRepeat.addSelectionListener(TuxGuitar.instance().getAction(OpenRepeatAction.NAME));
56
this.closeRepeat = new ToolItem(toolBar, SWT.PUSH);
57
this.closeRepeat.setImage(SystemImages.CLOSE_REPEAT_IMAGE);
58
this.closeRepeat.addSelectionListener(TuxGuitar.instance().getAction(CloseRepeatAction.NAME));
60
this.loadProperties();
63
public void loadProperties(){
64
this.tempo.setToolTipText(TuxGuitar.getProperty("composition.tempo"));
65
this.timeSignature.setToolTipText(TuxGuitar.getProperty("composition.timesignature"));
66
this.openRepeat.setToolTipText(TuxGuitar.getProperty("repeat.open"));
67
this.closeRepeat.setToolTipText(TuxGuitar.getProperty("repeat.close"));