1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.xmlhammer.gui.xslt;
22
23 import javax.swing.ImageIcon;
24
25 import org.bounce.RunnableAction;
26 import org.xmlhammer.gui.XMLHammer;
27 import org.xmlhammer.gui.wizard.NewXSLTransformationWizard;
28
29
30 /***
31 * An action that can be used to create a new XML Hammer project.
32 *
33 * @version $Revision$, $Date$
34 * @author Edwin Dankert <edankert@gmail.com>
35 */
36 public class NewXSLTAction extends RunnableAction {
37 private static final long serialVersionUID = 761137810540859340L;
38
39 private XMLHammer parent = null;
40
41 /***
42 * The constructor for the action which creates a new
43 * document.
44 *
45 * @param parent the parent frame.
46 */
47 public NewXSLTAction( XMLHammer parent) {
48
49 super( "XSL Transform");
50
51 this.parent = parent;
52
53 putValue( SMALL_ICON, new ImageIcon( getClass().getResource( "/org/xmlhammer/gui/icons/etool16/newtransform.gif")));
54 putValue( SHORT_DESCRIPTION, "New XSL Transformation");
55 }
56
57 /***
58 * The implementation of the new document action.
59 */
60 public void run() {
61 NewXSLTransformationWizard wizard = new NewXSLTransformationWizard(parent);
62 wizard.setVisible(true);
63
64 if (!wizard.isCancelled()) {
65 parent.openProject(null, wizard.getProject());
66 }
67 }
68
69
70 public void runWithoutWizard() {
71
72 NewXSLTransformationWizard wizard = new NewXSLTransformationWizard(parent);
73 parent.openProject(null, wizard.getProject());
74 }
75 }