public void savePatternToFile() {
if (SETTINGS.APPLET_MODE) {
try {
FileSaveService save = (FileSaveService) ServiceManager
.lookup("javax.jnlp.FileSaveService");
Element root = new Element("SketchChairDoc");
root.addAttribute(new Attribute("version", String
.valueOf(SETTINGS.version)));
root.appendChild(GLOBAL.sketchChairs.getCurChair().toXML());
Document doc = new Document(root);
// outXML = ;// new FileOutputStream(name+".xml");
ByteArrayOutputStream outXML = new ByteArrayOutputStream();
Serializer serializer = new Serializer(outXML, "ISO-8859-1");
serializer.write(doc);
FileContents fc = save.saveFileDialog(null,
new String[] { "chair" }, new ByteArrayInputStream(
outXML.toByteArray()), null);
} catch (Exception ex) {
LOGGER.error("exception: " + ex);