Examples of XmlDocument


Examples of com.intellij.psi.xml.XmlDocument

                final PsiFile psiFile = psiMgr.getPsiFile(document);
                if (!(psiFile instanceof XmlFile))
                    return;

                final XmlFile xmlFile = (XmlFile) psiFile;
                final XmlDocument xmlDoc = xmlFile.getDocument();
                if (xmlDoc == null)
                    return;

                final XmlTag projectTag = xmlDoc.getRootTag();
                if (projectTag == null)
                    return;

                final XmlTag[] goals = projectTag.findSubTags("goal");
                final String goalName = pGoal.getName();
View Full Code Here

Examples of com.jcabi.xml.XMLDocument

                    "lock should be taken before method call"
                );
            }
            this.lock.lock();
            try {
                return new XMLDocument(
                    FileUtils.readFileToString(
                        new File(this.name), Charsets.UTF_8
                    )
                );
            } finally {
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

        Error = false;

        // This procedure should parallel Application.open():
        try {
            InputStream in = new FileInputStream(file);
            XmlDocument xmlDoc;
            try {
                xmlDoc = new XmlDocument(in);
            }
            catch (IOException e) {
                // Maybe it's an image:
                try {
                    ImageInfo info = ImageInfo.getInstanceFor(file);
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

            Document doc = null;
            try {
                // First try as a saved-document:
                InputStream in = new FileInputStream(file);
                XmlDocument xmlDoc = null;
                try {
                    xmlDoc = new XmlDocument(in);
                }
                catch (IOException e) {
                    // If xmlDoc is null, we fall back to image-import.
                }
                if (xmlDoc != null) {
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

     * cache node, and interpreting the cache contents as image data.
     */
    public PlanarImage getImage( ImageInfo imageInfo, ProgressThread thread )
        throws BadImageFileException, IOException, UserCanceledException
    {
        final XmlDocument xml = getDocument( imageInfo );
        final XmlNode cache = getCacheNode( xml );
        final byte[] bytes = cache.getData();
        if (bytes == null) {
            // no cache data in the file
            throw new BadImageFileException( imageInfo.getFile() );
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

                CS_RGB,
                90
            );
            writer.putImage( image );

            final XmlDocument xml = getDocument( imageInfo );
            final XmlNode cache = getCacheNode( xml );
            cache.setData( buf.toByteArray() );

            final OutputStream out =
                new FileOutputStream( imageInfo.getFile() );
            try {
                xml.write( out );
            }
            finally {
                out.close();
            }
        }
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

     */
    private static XmlDocument getDocument( ImageInfo info )
        throws IOException
    {
        final InputStream in = new FileInputStream( info.getFile() );
        return new XmlDocument( in );
    }
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

        TemplateNamespaceTreeNode parent, TemplateKey key
    ) throws TemplateDatabase.TemplateException, XMLException {
        this.key = key;
        this.parent = parent;
        this.key = key;
        XmlDocument xml = TemplateDatabase.getTemplateDocument(key);
        XmlNode root = xml.getRoot();
        // Tag name copied from Document.ControlTag:
        node = root.getChild("Controls");
    }
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

        }
        return keys;
    }

    private void importTemplate(File file) {
        XmlDocument doc;
        try {
            InputStream in = new FileInputStream(file);
            doc = new XmlDocument(in);
        }
        catch (IOException e) {
            showError(
                LOCALE.get("TemplateImportError", file.getName()), e
            );
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

        if (dir.isFile()) {
            dir = dir.getParentFile();
        }
        List<TemplateKey> keys = getSelectedTemplateKeys();
        for (TemplateKey key : keys) {
            XmlDocument doc;
            try {
                doc = TemplateDatabase.getTemplateDocument(key);
            }
            catch (TemplateDatabase.TemplateException e) {
                showError(
                    LOCALE.get("TemplateAccessSpecificError", key.toString()), e
                );
                continue;
            }
            File file = new File(dir, key + ".lzt");
            try {
                OutputStream out = new FileOutputStream(file);
                doc.write(out);
                out.close();
            }
            catch (IOException e) {
                showError(
                    LOCALE.get(
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.