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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Created on 17-dic-2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.herac.tuxguitar.gui.actions.help;

import org.eclipse.swt.events.TypedEvent;
import org.herac.tuxguitar.gui.TuxGuitar;
import org.herac.tuxguitar.gui.actions.Action;
import org.herac.tuxguitar.gui.help.doc.DocDialog;
import org.herac.tuxguitar.gui.help.doc.DocException;
import org.herac.tuxguitar.gui.util.MessageDialog;

/**
 * @author julian
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class ShowDocAction extends Action {
	public static final String NAME = "action.help.doc";
	
	public ShowDocAction() {
		super(NAME, AUTO_LOCK | AUTO_UNLOCK | KEY_BINDING_AVAILABLE );
	}
	
	protected int execute(TypedEvent e){
		try {
			new DocDialog().show(TuxGuitar.instance().getShell());
		} catch (DocException throwable) {
			MessageDialog.errorMessage(throwable);
		}
		return 0;
	}
}