예제 #1
0
 protected void saveSettings(final String xmlFilename) throws IOException {
   final Element root = new Element("Settings");
   root.addContent(viewer.stateToXml());
   root.addContent(setupAssignments.toXml());
   root.addContent(manualTransformation.toXml());
   root.addContent(bookmarks.toXml());
   final Document doc = new Document(root);
   final XMLOutputter xout = new XMLOutputter(Format.getPrettyFormat());
   xout.output(doc, new FileWriter(xmlFilename));
 }
예제 #2
0
 protected void loadSettings(final String xmlFilename) throws IOException, JDOMException {
   final SAXBuilder sax = new SAXBuilder();
   final Document doc = sax.build(xmlFilename);
   final Element root = doc.getRootElement();
   viewer.stateFromXml(root);
   setupAssignments.restoreFromXml(root);
   manualTransformation.restoreFromXml(root);
   bookmarks.restoreFromXml(root);
   activeSourcesDialog.update();
   viewer.requestRepaint();
 }