Package com.vaadin.sass.internal.tree

Examples of com.vaadin.sass.internal.tree.ImportNode


        nodeStack.peek().appendChild(node);
    }

    @Override
    public void importStyle(String uri, SACMediaList media, boolean isURL) {
        ImportNode node = new ImportNode(uri, media, isURL);
        nodeStack.peek().appendChild(node);
    }
View Full Code Here


            throw new ParseException("Nested import in an invalid context");
        }
        ArrayList<Node> c = new ArrayList<Node>(node.getChildren());
        for (Node n : c) {
            if (n instanceof ImportNode) {
                ImportNode importNode = (ImportNode) n;
                if (!importNode.isPureCssImport()) {
                    try {
                        StringBuilder filePathBuilder = new StringBuilder(
                                styleSheet.getFileName());
                        filePathBuilder.append(File.separatorChar).append(
                                importNode.getUri());
                        if (!filePathBuilder.toString().endsWith(".scss")) {
                            filePathBuilder.append(".scss");
                        }

                        // set parent's charset to imported node.
                        ScssStylesheet imported = ScssStylesheet.get(
                                filePathBuilder.toString(),
                                styleSheet.getCharset());
                        if (imported == null) {
                            imported = ScssStylesheet.get(importNode.getUri());
                        }
                        if (imported == null) {
                            throw new FileNotFoundException(importNode.getUri()
                                    + " (parent: "
                                    + ScssStylesheet.get().getFileName() + ")");
                        }

                        traverse(imported);

                        String prefix = getUrlPrefix(importNode.getUri());
                        if (prefix != null) {
                            updateUrlInImportedSheet(imported, prefix);
                        }

                        node.appendChildrenAfter(
View Full Code Here

        nodeStack.peek().appendChild(node);
    }

    @Override
    public void importStyle(String uri, SACMediaList media, boolean isURL) {
        ImportNode node = new ImportNode(uri, media, isURL);
        nodeStack.peek().appendChild(node);
    }
View Full Code Here

    public static void traverse(ScssStylesheet node) {
        ArrayList<Node> c = new ArrayList<Node>(node.getChildren());
        for (Node n : c) {
            if (n instanceof ImportNode) {
                ImportNode importNode = (ImportNode) n;
                if (!importNode.isPureCssImport()) {
                    try {
                        StringBuilder filePathBuilder = new StringBuilder(
                                node.getFileName());
                        filePathBuilder.append(File.separatorChar).append(
                                importNode.getUri());
                        if (!filePathBuilder.toString().endsWith(".scss")) {
                            filePathBuilder.append(".scss");
                        }

                        // set parent's charset to imported node.
                        ScssStylesheet imported = ScssStylesheet.get(
                                filePathBuilder.toString(), node.getCharset());
                        if (imported == null) {
                            imported = ScssStylesheet.get(importNode.getUri());
                        }
                        if (imported == null) {
                            throw new FileNotFoundException(importNode.getUri()
                                    + " (parent: "
                                    + ScssStylesheet.get().getFileName() + ")");
                        }

                        traverse(imported);

                        String prefix = getUrlPrefix(importNode.getUri());
                        if (prefix != null) {
                            updateUrlInImportedSheet(imported, prefix);
                        }

                        Node pre = importNode;
View Full Code Here

TOP

Related Classes of com.vaadin.sass.internal.tree.ImportNode

Copyright © 2018 www.massapicom. 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.