GraphicalEditorPage.java 文件源码

java
阅读 41 收藏 0 点赞 0 评论 0

项目:bdf2 作者:
public void synchroGraphicalToXml(){
    Document doc=this.buildDocument();
    if(doc==null)return;
    TransformerFactory factory=TransformerFactory.newInstance();
    try{
        Transformer transformer=factory.newTransformer();
        transformer.setOutputProperty("encoding","utf-8");
        transformer.setOutputProperty(OutputKeys.INDENT,"yes");             
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        transformer.transform(new DOMSource(doc),new StreamResult(out));
        xmlEditor.getDocumentProvider().getDocument(xmlEditor.getEditorInput()).set(out.toString("utf-8"));
        out.close();
    }catch(Exception ex){
        ex.printStackTrace();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号