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.file.NewFileAction;
15
import org.herac.tuxguitar.gui.actions.file.OpenFileAction;
16
import org.herac.tuxguitar.gui.actions.file.PrintAction;
17
import org.herac.tuxguitar.gui.actions.file.PrintPreviewAction;
18
import org.herac.tuxguitar.gui.actions.file.SaveAsFileAction;
19
import org.herac.tuxguitar.gui.actions.file.SaveFileAction;
20
import org.herac.tuxguitar.gui.items.ToolItems;
24
* TODO To change the template for this generated type comment go to
25
* Window - Preferences - Java - Code Style - Code Templates
27
public class FileToolItems extends ToolItems {
28
public static final String NAME = "file.items";
29
private ToolBar toolBar;
30
private ToolItem newSong;
31
private ToolItem openSong;
32
private ToolItem saveSong;
33
private ToolItem saveAsSong;
34
private ToolItem printSong;
35
private ToolItem printPreviewSong;
37
public FileToolItems(){
41
public void showItems(ToolBar toolBar){
42
this.toolBar = toolBar;
43
newSong = new ToolItem(toolBar, SWT.PUSH);
44
newSong.setImage(SystemImages.NEW_IMAGE);
45
newSong.addSelectionListener(TuxGuitar.instance().getAction(NewFileAction.NAME));
47
openSong = new ToolItem(toolBar, SWT.PUSH);
48
openSong.setImage(SystemImages.OPEN_IMAGE);
49
openSong.addSelectionListener(TuxGuitar.instance().getAction(OpenFileAction.NAME));
51
saveSong = new ToolItem(toolBar, SWT.PUSH);
52
saveSong.setImage(SystemImages.SAVE_IMAGE);
53
saveSong.addSelectionListener(TuxGuitar.instance().getAction(SaveFileAction.NAME));
55
saveAsSong = new ToolItem(toolBar, SWT.PUSH);
56
saveAsSong.setImage(SystemImages.SAVE_AS_IMAGE);
57
saveAsSong.addSelectionListener(TuxGuitar.instance().getAction(SaveAsFileAction.NAME));
59
printSong = new ToolItem(toolBar, SWT.PUSH);
60
printSong.setImage(SystemImages.PRINT_IMAGE);
61
printSong.addSelectionListener(TuxGuitar.instance().getAction(PrintAction.NAME));
63
printPreviewSong = new ToolItem(toolBar, SWT.PUSH);
64
printPreviewSong.setImage(SystemImages.PRINT_PREVIEW_IMAGE);
65
printPreviewSong.addSelectionListener(TuxGuitar.instance().getAction(PrintPreviewAction.NAME));
67
this.loadProperties();
75
public void loadProperties(){
76
this.newSong.setToolTipText(TuxGuitar.getProperty("file.new"));
77
this.openSong.setToolTipText(TuxGuitar.getProperty("file.open"));
78
this.saveSong.setToolTipText(TuxGuitar.getProperty("file.save"));
79
this.saveAsSong.setToolTipText(TuxGuitar.getProperty("file.save-as"));
80
this.printSong.setToolTipText(TuxGuitar.getProperty("file.print"));
81
this.printPreviewSong.setToolTipText(TuxGuitar.getProperty("file.print-preview"));