[Bojangles-cvs] cvs: bojangles /xml XmlHandler.java
Status: Alpha
Brought to you by:
nehresma
From: kai5263499 <boj...@li...> - 2002-08-19 20:54:13
|
kai5263499 Mon Aug 19 13:54:11 2002 EDT Modified files: /bojangles/xml XmlHandler.java Log: Made printXML prettier and made a function out of saveXML (so it can be used in other things. Also laied the groundwork for opening premade XML files and started a prefrences system. Oh, and made saveXML remember the last dir you saved in (but only keeps it while you have the app open, hence the prefrences file...) -Wes Index: bojangles/xml/XmlHandler.java diff -u bojangles/xml/XmlHandler.java:1.10 bojangles/xml/XmlHandler.java:1.11 --- bojangles/xml/XmlHandler.java:1.10 Wed Aug 14 20:13:03 2002 +++ bojangles/xml/XmlHandler.java Mon Aug 19 13:54:11 2002 @@ -21,6 +21,9 @@ doc = DocumentHelper.createDocument(); } + public void loadXML(File file) { + } + public void addProperty(String path, String name, String text) { if (null == path || path.equals("/")) { // need to actually throw and exception here and catch it up above @@ -166,7 +169,8 @@ public void saveXML(File of) { try { FileOutputStream outfile = new FileOutputStream(of); - XMLWriter saver = new XMLWriter(outfile); + OutputFormat format = OutputFormat.createPrettyPrint(); + XMLWriter saver = new XMLWriter(outfile, format); saver.write(this.doc); } catch (Exception e) { e.printStackTrace(); @@ -175,7 +179,8 @@ public void printXML() { try { - XMLWriter writer = new XMLWriter(System.out); + OutputFormat format = OutputFormat.createPrettyPrint(); + XMLWriter writer = new XMLWriter(System.out, format); writer.write(doc); } catch (Exception e) { e.printStackTrace(); |