Examples of RootXmlResource


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

   
    @Test
   
    public void testWithCustomContext()
    {
        final RootXmlResource resource = new RootXmlResource()
        {
            @Override
            @SuppressWarnings( "unchecked" )
           
            public <A> A adapt( final Class<A> adapterType )
View Full Code Here

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

            final JavaType elementJavaType = def.getElementType().target();
            type = ElementType.read( (Class<?>) elementJavaType.artifact(), true );
        }
       
        final XmlEditorResourceStore store = createResourceStore( this.sourcePage );
        return type.instantiate( new RootXmlResource( store ) );
    }
View Full Code Here

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

    {
        final ByteArrayResourceStore store = service( MasterConversionService.class ).convert( object, ByteArrayResourceStore.class );
       
        if( compatible( store ) )
        {
            return new RootXmlResource( new XmlResourceStore( store ) );
        }
       
        return null;
    }
View Full Code Here

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

   
    public void testUniqueValue() throws Exception
    {
        final ByteArrayResourceStore byteArrayResourceStore = new ByteArrayResourceStore( generateTestData( 10 ) );
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( byteArrayResourceStore );
        final TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
        final ElementList<TestElement.ListEntry> list = element.getList();
       
        assertValidationOk( element );
       
        list.get( 0 ).setValue( "9" );
View Full Code Here

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

   
    public void testUniqueValue_ValidateNull() throws Exception
    {
        final ByteArrayResourceStore byteArrayResourceStore = new ByteArrayResourceStore( generateTestData( 10 ) );
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( byteArrayResourceStore );
        final TestElementValidateNull element = TestElementValidateNull.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
        final ElementList<TestElementValidateNull.ListEntry> list = element.getList();
       
        assertValidationOk( element );
       
        list.get( 0 ).setValue( "9" );
View Full Code Here

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

        final ByteArrayResourceStore byteArrayResourceStore = new ByteArrayResourceStore( generateTestData( entries ) );
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( byteArrayResourceStore );
       
        counter.reset();
       
        final TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
        element.validation();
        assertEquals( entries, counter.read() );
       
        counter.reset();
       
View Full Code Here

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

   
    protected TestElement createTestElement() throws Exception
    {
        final IJavaProject project = this.helper.getJavaProject();
        final IFile file = project.getProject().getFile( "foobar.xml" );
        return TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( file ) ) ) );
    }
View Full Code Here

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

    {
        final IJavaProject project = getJavaProject();
        writeJavaSourceFile( "foo.bar", "TestClass", "public class TestClass {}" );
       
        final IFile file = project.getProject().getFile( "foobar.xml" );
        final TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( file ) ) ) );
        element.setSomeClass( "foo.bar.TestClass" );
       
        final JavaType type = element.getSomeClass().target();

        assertNotNull( type );
View Full Code Here

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

    {
        final IJavaProject project = getJavaProject();
        writeJavaSourceFile( "foo.bar", "TestClass", "public class TestClass { public static class Inner {} }" );
       
        final IFile file = project.getProject().getFile( "foobar.xml" );
        final TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( file ) ) ) );
        element.setSomeClass( "foo.bar.TestClass$Inner" );
       
        final JavaType type = element.getSomeClass().target();

        assertNotNull( type );
View Full Code Here

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

{
    @Test
   
    public void testAddNewElement1() throws Exception
    {
        final RootXmlResource rootXmlResource = new RootXmlResource( new XmlResourceStore( loadResource( "TestData.xml" ) ) );
        final TestRootElement root = TestRootElement.TYPE.instantiate( rootXmlResource );
       
        root.getChildren().insert();
       
        try
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.