Examples of VBProFileParser


Examples of edu.harvard.wcfia.yoshikoder.util.VBProFileParser

        if (i != JOptionPane.OK_OPTION)
            return;
               
        // parse the contents and insert the resulting dictionary
        tworker = new TaskWorker(yoshikoder){
            VBProFileParser parser = new VBProFileParser();
            protected void doWork() throws Exception {
                importedDictionary = parser.parse(f, preview.getSelectedEncoding().name());
                importedDictionary.setName(f.getName());
                if (parser.getErrors().size()>0)
                    throw new Exception("non-fatal import errors");
            }
            protected void onSuccess() {
                log.info("parsed dictionary without major errors");
                log.info("setting dictionary to imported version");
                yoshikoder.setDictionary(importedDictionary);
                yoshikoder.setUnsavedChanges(true);
            }
            protected void onError() {
                if (parser.getErrors() == null){
                    // serious error occurred before parser had a chance to work
                    DialogUtil.yelp(yoshikoder, "Could not parse contents of VBPro file", e);
                } else {
                    // nonfatal errors
                    List l = parser.getErrors();
                    if (l.size() > 0){
                        JTextArea area = new JTextArea(20, 40);
                        area.setFont(yoshikoder.getDisplayFont());
                        area.setEditable(false);
                        area.setLineWrap(true);
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.util.VBProFileParser

                    JOptionPane.PLAIN_MESSAGE);   
            if (i != JOptionPane.OK_OPTION)
                return;
           
            tworker = new TaskWorker(yoshikoder){
                VBProFileParser parser = new VBProFileParser();
                YKDictionary importedDictionary;
               
                protected void doWork() throws Exception {
                    importedDictionary = parser.parse(f, preview.getSelectedEncoding().name());
                    importedDictionary.setName(f.getName());
                    if (parser.getErrors().size()>0)
                        throw new Exception("non-fatal import errors");
                }
                protected void onSuccess() {
                    yoshikoder.setDictionary(importedDictionary);
                    yoshikoder.setUnsavedChanges(true);
                }
                protected void onError() {
                    if (parser.getErrors() == null){
                        // serious error occurred before parser had a chance to work
                        DialogUtil.yelp(yoshikoder, "Could not parse contents of VBPro file", e);
                    } else {
                        // nonfatal errors
                        List l = parser.getErrors();
                        if (l.size() > 0){
                            JTextArea area = new JTextArea(20, 40);
                            area.setFont(yoshikoder.getDisplayFont());
                            area.setEditable(false);
                            area.setLineWrap(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.