Package com.simpleplugin.psi

Examples of com.simpleplugin.psi.SimpleProperty


                SimpleFile simpleFile = (SimpleFile) PsiManager.getInstance(project).findFile(file);
                ASTNode lastChildNode = simpleFile.getNode().getLastChildNode();
                if (lastChildNode != null && !lastChildNode.getElementType().equals(SimpleTypes.CRLF)) {
                    simpleFile.getNode().addChild(SimpleElementFactory.createCRLF(project).getNode());
                }
                SimpleProperty property = SimpleElementFactory.createProperty(project, key, "");
                simpleFile.getNode().addChild(property.getNode());
                ((Navigatable) property.getLastChild().getNavigationElement()).navigate(true);
                FileEditorManager.getInstance(project).getSelectedTextEditor().getCaretModel().
                        moveCaretRelatively(2, 0, false, false, false);
            }
        });
    }
View Full Code Here


    public static PsiElement setName(SimpleProperty element, String newName) {
        ASTNode keyNode = element.getNode().findChildByType(SimpleTypes.KEY);
        if (keyNode != null) {

            SimpleProperty property = SimpleElementFactory.createProperty(element.getProject(), newName);
            ASTNode newKeyNode = property.getFirstChild().getNode();
            element.getNode().replaceChild(keyNode, newKeyNode);
        }
        return element;
    }
View Full Code Here

TOP

Related Classes of com.simpleplugin.psi.SimpleProperty

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.