Package org.eclipse.sapphire.modeling.annotations

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


    {
        final PropertyDef property = part.property().definition();
       
        if( property instanceof ValueProperty && property.isOfType( JavaTypeName.class ) )
        {
            final Reference referenceAnnotation = property.getAnnotation( Reference.class );
           
            if( referenceAnnotation != null && referenceAnnotation.target() == JavaType.class )
            {
                return true;
            }
        }
       
View Full Code Here


        {
            final Property property = part.property();
           
            if( property instanceof Value && property.definition().isOfType( JavaTypeName.class ) )
            {
                final Reference referenceAnnotation = property.definition().getAnnotation( Reference.class );
               
                return
                (
                    referenceAnnotation != null &&
                    referenceAnnotation.target() == JavaType.class &&
                    property.element().adapt( IJavaProject.class ) != null
                );
            }
           
            return false;
View Full Code Here

        {
            final Property property = part.property();
           
            if( property instanceof Value && property.definition().isOfType( JavaTypeName.class ) )
            {
                final Reference referenceAnnotation = property.definition().getAnnotation( Reference.class );
               
                return
                (
                    referenceAnnotation != null &&
                    referenceAnnotation.target() == JavaType.class &&
                    evaluate( property.service( JavaTypeConstraintService.class ) ) &&
                    property.element().adapt( IJavaProject.class ) != null
                );
            }
           
View Full Code Here

            final ISapphireUiDef def = context.find( ISapphireUiDef.class );
            final ValueProperty property = context.find( ValueProperty.class );
           
            if( def != null && property != null && property.getTypeClass() == JavaTypeName.class )
            {
                final Reference referenceAnnotation = property.getAnnotation( Reference.class );
   
                if( referenceAnnotation != null && referenceAnnotation.target() == JavaType.class )
                {
                    final IProject project = def.adapt( IProject.class );
                   
                    if( project != null )
                    {
View Full Code Here

        {
            final ValueProperty property = context.find( ValueProperty.class );
           
            if( property != null && property.getTypeClass() == JavaTypeName.class && context.find( ISapphireUiDef.class ) != null )
            {
                final Reference referenceAnnotation = property.getAnnotation( Reference.class );
               
                if( referenceAnnotation != null && referenceAnnotation.target() == JavaType.class )
                {
                    return true;
                }
            }
           
View Full Code Here

        {
            final Property property = context.find( Property.class );
           
            if( property.definition() instanceof ValueProperty )
            {
                final Reference referenceAnnotation = property.definition().getAnnotation( Reference.class );
   
                if( referenceAnnotation != null && referenceAnnotation.target() == JavaType.class )
                {
                    final IProject project = property.element().adapt( IProject.class );
                   
                    if( project != null )
                    {
View Full Code Here

        {
            final ValueProperty property = context.find( ValueProperty.class );
           
            if( property != null && property.getTypeClass() == JavaTypeName.class )
            {
                final Reference referenceAnnotation = property.getAnnotation( Reference.class );
               
                if( referenceAnnotation != null && referenceAnnotation.target() == JavaType.class )
                {
                    return true;
                }
            }
           
View Full Code Here

        {
            final Property property = context.find( Property.class );
           
            if( property != null && property.definition().getTypeClass() == JavaTypeName.class )
            {
                final Reference referenceAnnotation = property.definition().getAnnotation( Reference.class );
               
                if( referenceAnnotation != null && referenceAnnotation.target() == JavaType.class )
                {
                    return property.service( JavaTypeConstraintService.class ) != null;
                }
            }
           
View Full Code Here

           
            if( property instanceof ValueProperty )
            {
                text = element.property( (ValueProperty) property ).text();
               
                final Reference ref = property.getAnnotation( Reference.class );
               
                if( ref != null && ref.target() == Class.class )
                {
                    text = formatClassName( text );
                }
            }
            else if( property instanceof ListProperty )
View Full Code Here

   
    private void processValueProperty( final ClassWriter cw,
                                       final ValueProperty property )
    {
        final String propertyFieldName = findPropertyField( property ).getName();
        final Reference referenceAnnotation = property.getAnnotation( Reference.class );
        final boolean reference = ( referenceAnnotation != null );
       
        Method getter = findMethod( "get" + property.name() );
       
        if( getter == null )
        {
            getter = findMethod( "is" + property.name() );
        }
       
        if( getter != null )
        {
            this.implementedMethods.add( getter );
           
            final MethodVisitor mv = cw.visitMethod
            (
                ACC_PUBLIC,
                getter.getName(),
                Type.getMethodDescriptor( Type.getType( reference ? ReferenceValue.class : Value.class ), new Type[ 0 ] ),
                null,
                null
            );
           
            mv.visitCode();
           
            mv.visitVarInsn( ALOAD, 0 );
           
            mv.visitFieldInsn
            (
                GETSTATIC,
                this.typeInterfaceClassInternalName,
                propertyFieldName,
                Type.getDescriptor( ValueProperty.class )
            );
           
            mv.visitMethodInsn
            (
                INVOKEVIRTUAL,
                this.typeImplClassInternalName,
                "property",
                Type.getMethodDescriptor( Type.getType( Value.class ), new Type[] { Type.getType( ValueProperty.class ) } )
            );
           
            if( reference )
            {
                mv.visitTypeInsn( CHECKCAST, Type.getInternalName( ReferenceValue.class ) );               
            }
           
            mv.visitInsn( ARETURN );
           
            mv.visitMaxs( 0, 0 );
            mv.visitEnd();
        }
       
        implementSetterMethod( cw, property, String.class );
       
        final Class<?> propertyTypeClass = property.getTypeClass();
       
        if( propertyTypeClass != String.class )
        {
            implementSetterMethod( cw, property, propertyTypeClass );
        }
       
        if( reference )
        {
            implementSetterMethod( cw, property, referenceAnnotation.target() );
        }
    }
View Full Code Here

TOP

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

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.