public boolean isEnabled() { return true; }
    public void save() {        try {            //logger.info("save");            // write editor content to a temporary file            File file = File.createTempFile("wings", "txt");            PrintWriter out = new PrintWriter(new FileOutputStream(file));            out.print(textArea.getText());            out.close();            // create a file resource            FileResource resource = new FileResource(file);            // we only request this once, thats it.            resource.setExternalizerFlags(resource.getExternalizerFlags()                                          | ExternalizeManager.REQUEST);            // advice the browser to pop the save dialog            Map headers = new HashMap();            headers.put("Content-Disposition", "attachment; filename=blub");            resource.setHeaders(headers.entrySet());            // java script, that is executed "onload"; loads the file resource and triggers            // the named event "clear=X"            RequestURL url = (RequestURL) resource.getURL();            url.addParameter("clear=X");            final ScriptListener script = new JavaScriptListener("onload", "parent.location='" + url + "'");            final SFrame frame = getParentFrame();            frame.addScriptListener(script);            // register a request listener, that handles the named event "clear"            getSession().getDispatcher().register(new LowLevelEventListener() {                    public void processLowLevelEvent(String name, String[] values) {                        //logger.info("remove java script");                        frame.removeScriptListener(script);                    }                                        public String getName() { return "clear"; }                    public String getLowLevelEventId() { return ""; }                    public String getEncodedLowLevelEventId() { return ""; }                                        public void fireIntermediateEvents() {}                    public void fireFinalEvents() {}                });        }        catch (IOException e) {            System.err.println(e.getMessage());            e.printStackTrace(System.err);        }    }