Package org.eclipse.sapphire.workspace

Examples of org.eclipse.sapphire.workspace.WorkspaceFileResourceStore


    @Override
    public WorkspaceFileResourceStore convert( final IFile file )
    {
        try
        {
            return new WorkspaceFileResourceStore( file );
        }
        catch( ResourceStoreException e )
        {
            Sapphire.service( LoggingService.class ).log( e );
        }
View Full Code Here


   
    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

    {
        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

    {
        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

           
            monitor.worked( 1 );
           
            try
            {
                final WorkspaceFileResourceStore fileResourceStore = new WorkspaceFileResourceStore( targetSchemaFile );
                final XmlResourceStore xmlResourceStore = new XmlResourceStore( fileResourceStore );
                final XmlElement root = new XmlElement( xmlResourceStore, xmlResourceStore.getDomDocument().getDocumentElement() );
               
                final String targetNamespace = root.getAttributeText( "targetNamespace" );
                String targetNamespacePrefix = null;
View Full Code Here

        if (this.editorInput instanceof IFileEditorInput)
        {
          IFileEditorInput fileInput = (IFileEditorInput)this.editorInput;
          IFolder layoutFolder = (IFolder)fileInput.getFile().getParent();
          IFile layoutFile = layoutFolder.getFile(fileName);
          resourceStore = new XmlResourceStore( new WorkspaceFileResourceStore(layoutFile));
        }
          else if (this.editorInput instanceof FileStoreEditorInput)
          {
            FileStoreEditorInput fileStoreInput = (FileStoreEditorInput)this.editorInput;
              IFileStore store = EFS.getStore(fileStoreInput.getURI());
View Full Code Here

      if (fileName != null)
      {
        IFile layoutFile = getLayoutPersistenceFile(fileName);
        if (layoutFile != null)
        {
          final XmlResourceStore resourceStore = new XmlResourceStore( new WorkspaceFileResourceStore(layoutFile));
          layoutModel = StandardDiagramLayout.TYPE.instantiate(new RootXmlResource( resourceStore ));
        }
      }
    }
    catch (Exception 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 WorkspaceFileResourceStore xmlFileStore = service.convert( xmlFile, WorkspaceFileResourceStore.class );
        assertNotNull( xmlFileStore );
       
        final IFile txtFile = project.getFile( "file.txt" );
        txtFile.create( new ByteArrayInputStream( new byte[ 0 ] ), true, null );
       
        final WorkspaceFileResourceStore txtFileStore = service.convert( txtFile, WorkspaceFileResourceStore.class );
        assertNotNull( txtFileStore );
       
        final IFile binFile = project.getFile( "file.bin" );
        binFile.create( new ByteArrayInputStream( new byte[ 0 ] ), true, null );
       
        final WorkspaceFileResourceStore binFileStore = service.convert( binFile, WorkspaceFileResourceStore.class );
        assertNotNull( binFileStore );
    }
View Full Code Here

    @Test
   
    public void testWorkspaceRelativePath() throws Exception
    {
        final ValueProperty property = TestElement.PROP_WORKSPACE_RELATIVE_PATH;
        final TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( this.aa ) ) ) );
       
        testValidationOk( element, property, this.a.getFullPath() );
        testValidationOk( element, property, this.aa.getFullPath() );
        testValidationOk( element, property, this.ab.getFullPath() );
        testValidationOk( element, property, this.aba.getFullPath() );
View Full Code Here

   
    public void testProjectRelativePath() throws Exception
    {
        final ValueProperty property = TestElement.PROP_PROJECT_RELATIVE_PATH;
       
        TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( this.aa ) ) ) );
       
        testValidationOk( element, property, this.aa.getProjectRelativePath() );
        testValidationOk( element, property, this.ab.getProjectRelativePath() );
        testValidationOk( element, property, this.aba.getProjectRelativePath() );
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.workspace.WorkspaceFileResourceStore

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.