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);
}
});
}