Examples of XFile


Examples of com.nexirius.util.XFile

    public void parse(MenuCreator creator) throws Exception {
        parse(createStream(), creator);
    }

    private PushbackInputStream createStream() {
        XFile xf = new XFile(menuFileName);

        try {
            return new PushbackInputStream(xf.getBufferedInputStream());
        } catch (Exception ex) {
            throw new RuntimeException("Can't open menu file '" + menuFileName + "'");
        }
    }
View Full Code Here

Examples of com.nexirius.util.XFile

    public DataModel createHomeModel() {
        MainModel mainModel;

        mainModel = new MainModel();

        XFile textFile = getTextFile();

        if (textFile.exists()) {
            try {
                mainModel.dropData(new String(textFile.getBytes()));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

Examples of com.nexirius.util.XFile

    }

    public static XFile getTextFile() {
        File dir = new File(File.separator, "tmp");
        dir.mkdirs();
        XFile file = new XFile(dir, "jnexHtmlExample.txt");
        return file;
    }
View Full Code Here

Examples of com.nexirius.util.XFile

    }
    //Method that maps Template-Names to Template-Files.
    public HTMLStreamMapEntry[] getStreamMapperEntries() {
        return new HTMLStreamMapEntry[]{
            new HTMLStreamMapEntry("header", new XFile("html/header.html")),
            new HTMLStreamMapEntry("footer", new XFile("html/footer.html")),
            new HTMLStreamMapEntry("overview", new XFile("html/overview.html")),
            new HTMLStreamMapEntry("newPerson", new XFile("html/newPerson.html")),
            new HTMLStreamMapEntry("editPerson", new XFile("html/editPerson.html")),
            new HTMLStreamMapEntry("person", new XFile("html/model/person.html")),
            new HTMLStreamMapEntry("personTableRow", new XFile("html/model/personTableRow.html")),
            new HTMLStreamMapEntry("mandatory", new XFile("html/mandatory.html")),
        };
    }
View Full Code Here

Examples of com.nexirius.util.XFile

            if (!DialogManager.ask("ReallyExit", "yes", "no", true)) {
                return;
            }
        }

        XFile settingsFile = new XFile(SETTINGS_FILENAME);

        try {
            settingsFile.writeText(settings.dragData());
        } catch (Exception e) {
            e.printStackTrace()//TODO
        }

        super.exit();
View Full Code Here

Examples of com.nexirius.util.XFile

        settings = new SettingsModel();

        mainModel.setFileNameModel(settings.getFileNameModel());

        XFile settingsFile = new XFile(SETTINGS_FILENAME);

        if (settingsFile.exists() && settingsFile.canRead()) {
            String fullName = null;
            try {
                PushbackInputStream in = new PushbackInputStream(settingsFile.getBufferedInputStream());
                settings.readDataFrom(in);
                fullName = settings.getFileNameModel().getFullName();
                in.close();
            } catch (Exception e) {
                return;
            }

            try {

                XFile file = new XFile(fullName);

                if (file.canRead()) {
                    mainModel.openFile(fullName);
                    updateApplicationTitle();
                }
            } catch (Exception e) {
                error("Cannot open file: {0}", new Object[] {fullName});
View Full Code Here

Examples of com.nexirius.util.XFile

        public void doAction() {
            System.out.println("About");
            StringModel about = new StringModel("");
            try {
                XFile aboutFile = new XFile("about.htm");

                about.setText(new String(aboutFile.getBytes()));
            } catch (Exception ex) {
                about.setText(ex.getClass().getName());
                ex.printStackTrace();
            }
View Full Code Here

Examples of com.nexirius.util.XFile

    }

    public void showHelp(String text) {
        StringModel about = new StringModel("");
        try {
            XFile aboutFile = new XFile(text);

            about.setText(new String(aboutFile.getBytes()));
        } catch (Exception ex) {
            about.setText(ex.getClass().getName());
            ex.printStackTrace();
        }
View Full Code Here

Examples of com.nexirius.util.XFile

        return arrayModel;
    }

    public ArrayModel createArrayFromExcel(boolean readAll) throws IOException, BiffException {
        String fileName = excelFileName.getText();
        XFile file = new XFile(fileName);

        if (!file.canRead()) {
            DialogManager.error("CannotRead{0}", fileName);

            return null;
        }
View Full Code Here

Examples of com.nexirius.util.XFile

        if (excelFileName.getText().toUpperCase().endsWith(".XLS")) {
            return createArrayFromExcel(readAll);
        }

        String fileName = excelFileName.getText();
        XFile file = new XFile(fileName);

        if (!file.canRead()) {
            DialogManager.error("CannotRead{0}", fileName);

            return null;
        }

        StringVector sv;

        try {
            sv = new StringVector();
            BufferedInputStream in = file.getBufferedInputStream();
            ByteArrayOutputStream line = new ByteArrayOutputStream(102400);

            int oldc = 0;

            while (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.