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.schemavalidator;
22
23 import javax.swing.ImageIcon;
24
25 import org.bounce.RunnableAction;
26 import org.xmlhammer.gui.XMLHammer;
27 import org.xmlhammer.gui.wizard.NewSchemaValidatorWizard;
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 NewSchemaValidatorAction extends RunnableAction {
37 private static final long serialVersionUID = -1438716057457615978L;
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 NewSchemaValidatorAction( XMLHammer parent) {
48 super( "Schema Validator");
49
50 this.parent = parent;
51
52 putValue( SMALL_ICON, new ImageIcon( getClass().getResource("/org/xmlhammer/gui/icons/etool16/newschemavalidator.gif")));
53 putValue( SHORT_DESCRIPTION, "New Schema Validator");
54 }
55
56 /***
57 * The implementation of the new document action.
58 */
59 public void run() {
60
61 NewSchemaValidatorWizard wizard = new NewSchemaValidatorWizard(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 NewSchemaValidatorWizard wizard = new NewSchemaValidatorWizard(parent);
73 parent.openProject(null, wizard.getProject());
74 }
75 }