Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.PropertyDef


    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final PropertyDef property = context.find( PropertyDef.class );
           
            if( property == null )
            {
                final ElementType type = context.find( Element.class ).type();
                return ( type.hasAnnotation( Validation.class ) || type.hasAnnotation( Validations.class ) );
            }
            else
            {
                return ( property.hasAnnotation( Validation.class ) || property.hasAnnotation( Validations.class ) );
            }
        }
View Full Code Here


    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final PropertyDef property = context.find( PropertyDef.class );
           
            if( property != null )
            {
                return property.hasAnnotation( InitialValue.class );
            }
           
            return false;
        }
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final PropertyDef property = context.find( PropertyDef.class );
           
            if( property != null )
            {
                return property.hasAnnotation( DefaultValue.class );
            }
           
            return false;
        }
View Full Code Here

                final ElementType memberType = property.definition().getType();
                final SortedSet<PropertyDef> properties = memberType.properties();
               
                if( properties.size() == 1 )
                {
                    final PropertyDef memberProperty = properties.first();
                   
                    return ( memberProperty instanceof ValueProperty );
                }
            }
   
View Full Code Here

    public static final class Factory extends PropertyEditorPresentationFactory
    {
        @Override
        public PropertyEditorPresentation create( final PropertyEditorPart part, final SwtPresentation parent, final Composite composite )
        {
            final PropertyDef property = part.property().definition();
           
            if( property.isOfType( Integer.class ) )
            {
                final NumericRange rangeAnnotation = property.getAnnotation( NumericRange.class );
               
                if( rangeAnnotation != null )
                {
                    final String minStr = rangeAnnotation.min();
                    final String maxStr = rangeAnnotation.max();
View Full Code Here

   
    @Override
    protected void initVersionCompatibilityService()
    {
        final Element element = context( Element.class );
        final PropertyDef property = context( PropertyDef.class );
       
        this.versionCompatibilityTargetService = VersionCompatibilityTargetService.find( element, property );
       
        this.versionCompatibilityTargetServiceListener = new Listener()
        {
            @Override
            public void handle( final Event event )
            {
                refresh();
            }
        };
       
        this.versionCompatibilityTargetService.attach( this.versionCompatibilityTargetServiceListener );
       
        Function function = null;
       
        final VersionCompatibility versionCompatibilityAnnotation = property.getAnnotation( VersionCompatibility.class );

        if( versionCompatibilityAnnotation != null )
        {
            try
            {
                function = ExpressionLanguageParser.parse( versionCompatibilityAnnotation.value() );
            }
            catch( Exception e )
            {
                Sapphire.service( LoggingService.class ).log( e );
            }
        }
        else
        {
            final Since sinceAnnotation = property.getAnnotation( Since.class );
           
            try
            {
                function = ExpressionLanguageParser.parse( sinceAnnotation.value() );
            }
View Full Code Here

    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final Element element = context.find( Element.class );
            final PropertyDef property = context.find( PropertyDef.class );
           
            return ( property.hasAnnotation( VersionCompatibility.class ) || property.hasAnnotation( Since.class ) ) &&
                   ( VersionCompatibilityTargetService.find( element, property ) != null );
        }
View Full Code Here

    public static final class ValuePropertyCondition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final PropertyDef property = context.find( PropertyDef.class );
           
            return
            (
                ( property instanceof ValueProperty ) &&
                property.hasAnnotation( PossibleValues.class ) &&
                property.getAnnotation( PossibleValues.class ).values().length > 0
            );
        }
View Full Code Here

    public static final class ListPropertyCondition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final PropertyDef property = context.find( PropertyDef.class );
           
            return
            (
                ( property instanceof ListProperty ) &&
                property.hasAnnotation( PossibleValues.class ) &&
                property.getAnnotation( PossibleValues.class ).values().length > 0
            );
        }
View Full Code Here

    public static final class Factory extends PropertyEditorPresentationFactory
    {
        @Override
        public PropertyEditorPresentation create( final PropertyEditorPart part, final SwtPresentation parent, final Composite composite )
        {
            final PropertyDef property = part.property().definition();
           
            if( property instanceof ValueProperty && property.isOfType( Boolean.class ) )
            {
                return new CheckBoxPropertyEditorPresentation( part, parent, composite );
            }
           
            return null;
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.PropertyDef

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.