Package org.eclipse.sapphire.modeling.annotations

Examples of org.eclipse.sapphire.modeling.annotations.Documentation


        if( property == null )
        {
            return;
        }
       
        final Documentation docAnnotation = property.getAnnotation( Documentation.class );
       
        if( docAnnotation == null || docAnnotation.mergeStrategy() != DocumentationMergeStrategy.REPLACE )
        {
            init( property.getBase(), content, topics );
        }
       
        if( docAnnotation != null )
        {
            final LocalizationService localization = property.getLocalizationService();
            final DocumentationMergeStrategy docMergeStrategy = docAnnotation.mergeStrategy();
            final String docAnnotationContent = localization.text( docAnnotation.content().trim(), CapitalizationType.NO_CAPS, false );
           
            if( docAnnotationContent.length() > 0 )
            {
                if( docMergeStrategy == DocumentationMergeStrategy.REPLACE || content.length() == 0 )
                {
                    content.append( docAnnotationContent );
                }
                else if( docMergeStrategy == DocumentationMergeStrategy.APPEND )
                {
                    content.append( PARAGRAPH_BREAK );
                    content.append( docAnnotationContent );
                }
                else
                {
                    content.insert( 0, PARAGRAPH_BREAK );
                    content.insert( 0, docAnnotationContent );
                }
            }
           
            final List<Topic> docAnnotationTopics = convert( docAnnotation.topics(), localization );
           
            if( ! docAnnotationTopics.isEmpty() )
            {
                if( docMergeStrategy != DocumentationMergeStrategy.PREPEND || topics.isEmpty() )
                {
View Full Code Here


    @Override
    protected void initStandardDocumentationService( final StringBuilder content,
                                                     final List<Topic> topics )
    {
        final ElementType type = context( ElementType.class );
        final Documentation docAnnotation = type.getAnnotation( Documentation.class );
       
        if( docAnnotation != null )
        {
            final LocalizationService localization = type.getLocalizationService();
            final String docAnnotationContent = localization.text( docAnnotation.content().trim(), CapitalizationType.NO_CAPS, false );
           
            if( docAnnotationContent.length() > 0 )
            {
                content.append( docAnnotationContent );
            }
           
            topics.addAll( convert( docAnnotation.topics(), localization ) );
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.annotations.Documentation

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.