View Javadoc

1   package org.xmlhammer.gui.acceptance;
2   
3   import java.io.File;
4   import java.net.URI;
5   
6   import javax.xml.bind.JAXBException;
7   import javax.xml.transform.TransformerException;
8   
9   import org.apache.log4j.Logger;
10  import org.xmlhammer.gui.XMLHammer;
11  import org.xmlhammer.gui.actions.OpenAction;
12  import org.xmlhammer.model.project.Project;
13  
14  public class DummyApplication extends XMLHammer {
15      private static final long serialVersionUID = 1961343420519943727L;
16      
17      public DummyApplication() {
18          super(false);
19          System.setProperty("xml.catalog.ignoreMissing", "true");
20      }
21  
22      public void open(File file) {
23          URI uri = file.toURI();
24          
25          try {
26  	        Project project = OpenAction.open(uri);
27  	        openProject( uri, project);
28          } catch (JAXBException e) {
29          	Logger.getLogger(DummyApplication.class).error("JAXB Error", e);
30          } catch (TransformerException e) {
31          	Logger.getLogger(DummyApplication.class).error("Transformer Error", e);
32          }
33      }
34      
35      protected void storePreferences() { 
36          // do nothing
37      }
38      
39      protected void exit(int level) {
40          dispose();
41      }
42  }