Package org.eclipse.sapphire.sdk.xml.schema.normalizer

Examples of org.eclipse.sapphire.sdk.xml.schema.normalizer.CreateNormalizedXmlSchemaOp


        }
   
        @Override
        protected String compute()
        {
            final CreateNormalizedXmlSchemaOp op = context( CreateNormalizedXmlSchemaOp.class );
            final IResource resource = op.getContext().content();
           
            if( resource instanceof IFile && resource.getName().toLowerCase().endsWith( ".xsd" ) )
            {
                return resource.getFullPath().makeRelative().toPortableString();
            }
View Full Code Here


        {
            super.dispose();
           
            if( this.listener != null )
            {
                final CreateNormalizedXmlSchemaOp op = context( CreateNormalizedXmlSchemaOp.class );
               
                if( ! op.disposed() )
                {
                    op.getContext().detach( this.listener );
                }
            }
        }
View Full Code Here

    public static final class SourceFileListener extends FilteredListener<PropertyContentEvent>
    {
        @Override
        protected void handleTypedEvent( final PropertyContentEvent event )
        {
            final CreateNormalizedXmlSchemaOp op = (CreateNormalizedXmlSchemaOp) event.property().element();
            final Path sourceFilePath = op.getSourceFile().content();
           
            String folder = null;
            String fileName = null;
           
            if( sourceFilePath != null && sourceFilePath.segmentCount() >= 2 )
            {
                final IFile sourceFile = ResourcesPlugin.getWorkspace().getRoot().getFile( PathBridge.create( sourceFilePath ) );
               
                if( sourceFile.exists() )
                {
                    folder = sourceFile.getParent().getFullPath().makeRelative().toPortableString();
                   
                    fileName = sourceFile.getName();
                   
                    if( fileName.toLowerCase().endsWith( ".xsd" ) )
                    {
                        fileName = fileName.substring( 0, fileName.length() - 4 ) + "-normalized.xsd";
                    }
                    else
                    {
                        fileName = null;
                    }
                }
            }
           
            op.setFolder( folder );
            op.setFile( fileName );
           
            final PersistedState state = PersistedStateManager.load( sourceFilePath );
           
            if( state == null )
            {
                op.getRootElements().clear();
            }
            else
            {
                try
                {
                    op.getRootElements().copy( state );
                    op.getExclusions().copy( state );
                    op.getTypeSubstitutions().copy( state );
                    op.getSortSequenceContent().copy( state );
                    op.getRemoveWildcards().copy( state );
                }
                finally
                {
                    state.dispose();
                }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.sdk.xml.schema.normalizer.CreateNormalizedXmlSchemaOp

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.