~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/gui/items/tool/MarkerToolItems.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2007-02-04 01:41:23 UTC
  • Revision ID: james.westby@ubuntu.com-20070204014123-9pv7okph0iaiqkvw
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.tool;
 
8
 
 
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.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.ToolItems;
 
21
/**
 
22
 * @author julian
 
23
 *
 
24
 * TODO To change the template for this generated type comment go to
 
25
 * Window - Preferences - Java - Code Style - Code Templates
 
26
 */
 
27
public class MarkerToolItems  extends ToolItems{
 
28
    public static final String NAME = "marker.items";
 
29
    
 
30
    private ToolBar toolBar;
 
31
        private ToolItem add;
 
32
        private ToolItem list;
 
33
    private ToolItem first;
 
34
        private ToolItem last;
 
35
        private ToolItem previous;
 
36
        private ToolItem next;
 
37
                
 
38
    public MarkerToolItems(){
 
39
        super(NAME);
 
40
    }
 
41
   
 
42
    public void showItems(ToolBar toolBar){
 
43
        this.toolBar = toolBar;         
 
44
        //--ADD--
 
45
        this.add = new ToolItem(toolBar, SWT.PUSH);
 
46
        this.add.setImage(SystemImages.MARKER_ADD);
 
47
        this.add.addSelectionListener(TuxGuitar.instance().getAction(AddMarkerAction.NAME));
 
48
 
 
49
        //--LIST--
 
50
        this.list = new ToolItem(toolBar, SWT.PUSH);
 
51
        this.list.setImage(SystemImages.MARKER_LIST);
 
52
        this.list.addSelectionListener(TuxGuitar.instance().getAction(ListMarkersAction.NAME));        
 
53
        
 
54
        //--SEPARATOR--
 
55
        new ToolItem(toolBar, SWT.SEPARATOR);        
 
56
        
 
57
        //--FIRST--
 
58
        this.first = new ToolItem(toolBar, SWT.PUSH);
 
59
        this.first.setImage(SystemImages.MARKER_FIRST);
 
60
        this.first.addSelectionListener(TuxGuitar.instance().getAction(GoFirstMarkerAction.NAME));        
 
61
 
 
62
        //--PREVIOUS--
 
63
        this.previous = new ToolItem(toolBar, SWT.PUSH);
 
64
        this.previous.setImage(SystemImages.MARKER_PREVIOUS);
 
65
        this.previous.addSelectionListener(TuxGuitar.instance().getAction(GoPreviousMarkerAction.NAME));        
 
66
        
 
67
        //--PREVIOUS--
 
68
        this.next = new ToolItem(toolBar, SWT.PUSH);
 
69
        this.next.setImage(SystemImages.MARKER_NEXT);
 
70
        this.next.addSelectionListener(TuxGuitar.instance().getAction(GoNextMarkerAction.NAME));        
 
71
        
 
72
        //--LAST--
 
73
        this.last = new ToolItem(toolBar, SWT.PUSH);
 
74
        this.last.setImage(SystemImages.MARKER_LAST);
 
75
        this.last.addSelectionListener(TuxGuitar.instance().getAction(GoLastMarkerAction.NAME));  
 
76
 
 
77
        this.loadProperties();
 
78
    }
 
79
 
 
80
    
 
81
    
 
82
    public void update(){    
 
83
    }
 
84
    
 
85
    public void loadProperties(){
 
86
        this.add.setToolTipText(TuxGuitar.getProperty("marker.add"));
 
87
        this.list.setToolTipText(TuxGuitar.getProperty("marker.list"));
 
88
        this.first.setToolTipText(TuxGuitar.getProperty("marker.first"));
 
89
        this.last.setToolTipText(TuxGuitar.getProperty("marker.last"));
 
90
        this.previous.setToolTipText(TuxGuitar.getProperty("marker.previous"));
 
91
        this.next.setToolTipText(TuxGuitar.getProperty("marker.next")); 
 
92
    }        
 
93
}
 
94