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.actions;
22
23 import javax.swing.ImageIcon;
24
25 import org.bounce.RunnableAction;
26 import org.xmlhammer.gui.XMLHammer;
27 import org.xmlhammer.gui.wizard.NewXMLParserWizard;
28
29
30 /***
31 * An action that can be used to create a new XML Hammer project.
32 *
33 * @version $Revision: 1.8 $, $Date: 2007/07/04 19:42:49 $
34 * @author Edwin Dankert <edankert@gmail.com>
35 */
36 public class NewXMLValidatorAction 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 NewXMLValidatorAction( XMLHammer parent) {
48
49 super( "XML Parser");
50
51 this.parent = parent;
52
53 putValue( SMALL_ICON, new ImageIcon( getClass().getResource("/org/xmlhammer/gui/icons/etool16/newxmlparser.gif")));
54 putValue( SHORT_DESCRIPTION, "New XML Parser");
55 }
56
57 /***
58 * The implementation of the new document action.
59 */
60 public void run() {
61
62 NewXMLParserWizard wizard = new NewXMLParserWizard(parent);
63 wizard.setVisible(true);
64
65 if (!wizard.isCancelled()) {
66 parent.openProject(null, wizard.getProject());
67 }
68 }
69
70
71 public void runWithoutWizard() {
72
73 NewXMLParserWizard wizard = new NewXMLParserWizard(parent);
74 parent.openProject(null, wizard.getProject());
75 }
76 }