Package org.eclipse.sapphire.modeling.xml

Examples of org.eclipse.sapphire.modeling.xml.XmlResource


            {
                final Resource resource = element.resource();
               
                if( resource instanceof XmlResource )
                {
                    final XmlResource r = (XmlResource) resource;
                    final XmlNode xmlNode = ( (XmlValueBindingImpl) r.binding( element.property( property ) ) ).getXmlNode();
                   
                    if( xmlNode != null )
                    {
                        return Collections.singletonList( xmlNode );
                    }
View Full Code Here


           
            try
            {
                final FileResourceStore fileResourceStore = new FileResourceStore( file );
                final XmlResourceStore xmlResourceStore = new XmlResourceStore( fileResourceStore );
                final XmlResource xmlResource = new RootXmlResource( xmlResourceStore );
               
                return PersistedState.TYPE.instantiate( xmlResource );
            }
            catch( ResourceStoreException e )
            {
View Full Code Here

        final IProject project = project();
       
        final IFile xmlFile = project.getFile( "file.xml" );
        xmlFile.create( new ByteArrayInputStream( new byte[ 0 ] ), true, null );
       
        final XmlResource xmlFileResource = service.convert( xmlFile, XmlResource.class );
        assertNotNull( xmlFileResource );

        final IFile txtFile = project.getFile( "file.txt" );
        txtFile.create( new ByteArrayInputStream( new byte[ 0 ] ), true, null );
       
        final XmlResource txtFileStore = service.convert( txtFile, XmlResource.class );
        assertNull( txtFileStore );
    }
View Full Code Here

        assertSame( xmlElement, xmlResource.getXmlElement().getDomNode() );
        assertSame( xmlElement, xmlResource.adapt( Element.class ) );
       
        final XmlConversionTestElement.ListEntry childElement = elementOnXml.getList().insert();
        final Element childXmlElement = service.convert( childElement.resource(), Element.class );
        final XmlResource childXmlResource = (XmlResource) childElement.resource();
       
        assertNotNull( childXmlElement );
        assertSame( childXmlElement, childXmlResource.getXmlElement().getDomNode() );
        assertSame( childXmlElement, childXmlResource.adapt( Element.class ) );
        assertNotSame( childXmlElement, xmlElement );
    }
View Full Code Here

        assertSame( xmlElement, xmlResource.getXmlElement() );
        assertSame( xmlElement, xmlResource.adapt( XmlElement.class ) );
       
        final XmlConversionTestElement.ListEntry childElement = elementOnXml.getList().insert();
        final XmlElement childXmlElement = service.convert( childElement.resource(), XmlElement.class );
        final XmlResource childXmlResource = (XmlResource) childElement.resource();
       
        assertNotNull( childXmlElement );
        assertSame( childXmlElement, childXmlResource.getXmlElement() );
        assertSame( childXmlElement, childXmlResource.adapt( XmlElement.class ) );
        assertNotSame( childXmlElement, xmlElement );
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.xml.XmlResource

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.