Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Property


            {
                final ElementType type = property.getModelElementType();
               
                if( type.properties().size() == 1 )
                {
                    final Property parent = context.find( Element.class ).parent();
                   
                    if( parent != null && parent.definition() instanceof ListProperty && parent.service( PossibleValuesService.class ) != null )
                    {
                        return true;
                    }
                }
            }
View Full Code Here


    private Listener listener;
   
    @Override
    protected void initPossibleValuesService()
    {
        final Property property = context( Property.class );
        final Element element = property.element();
       
        final PossibleValues a = property.definition().getAnnotation( PossibleValues.class );
       
        this.path = new ModelPath( a.property() );

        final String invalidValueMessage = a.invalidValueMessage();
       
        if( invalidValueMessage.length() > 0 )
        {
            this.invalidValueMessage = invalidValueMessage;
        }
       
        this.invalidValueSeverity = a.invalidValueSeverity();
        this.ordered = a.ordered();
       
        this.listener = new FilteredListener<PropertyContentEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyContentEvent event )
            {
                if( ! property.disposed() )
                {
                    refresh();
                }
            }
        };
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final Property property = context.find( Property.class );
           
            if( property instanceof Value || property instanceof ElementList )
            {
                final PossibleValues possibleValuesAnnotation = property.definition().getAnnotation( PossibleValues.class );
               
                if( possibleValuesAnnotation != null && possibleValuesAnnotation.property().length() > 0 )
                {
                    return true;
                }
View Full Code Here

        {
            final String style = part.definition().getStyle().content();
           
            if( style != null && style.startsWith( "Sapphire.PropertyEditor.RadioButtonGroup" ) )
            {
                final Property property = part.property();
               
                if( property instanceof Value && property.definition().isOfType( Enum.class ) )
                {
                    Orientation orientation = null;
                   
                    if( style.equals( "Sapphire.PropertyEditor.RadioButtonGroup" ) || style.equals( "Sapphire.PropertyEditor.RadioButtonGroup.Horizontal" ) )
                    {
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final Property property = context.find( Property.class );
           
            if( property != null && property.definition() instanceof ListProperty &&
                property.service( PossibleTypesService.class ).types().size() == 1 )
            {
                final ElementType memberType = property.definition().getType();
                final SortedSet<PropertyDef> properties = memberType.properties();
               
                if( properties.size() == 1 )
                {
                    final PropertyDef memberProperty = properties.first();
View Full Code Here

    {
        DeclarativeVersionCompatibilityService service = property.service( DeclarativeVersionCompatibilityService.class );
       
        if( service == null )
        {
            final Property parent = property.element().parent();
           
            if( parent != null )
            {
                service = findDeclarativeVersionCompatibilityService( parent );
            }
View Full Code Here

        this.enumValues = (Enum<?>[]) property().definition().getTypeClass().getEnumConstants();

        this.buttonsGroup = (RadioButtonsGroup) control;
       
        final PropertyEditorPart part = propertyEditorPresentation.part();
        final Property property = part.property();
        final EnumValueType enumValueType = new EnumValueType( this.enumValues[ 0 ].getDeclaringClass() );

        for( final Enum<?> enumItem : this.enumValues )
        {
            final String enumItemStr = property.service( MasterConversionService.class ).convert( enumItem, String.class );
            final String auxText = part.getRenderingHint( PropertyEditorDef.HINT_AUX_TEXT + "." + enumItemStr, null );
            final ValueImageService imageService = property.service( ValueImageService.class );
            final ImageData imageData = imageService.provide( enumItemStr );
            final Image image = propertyEditorPresentation.resources().image( imageData );
            final Button button = this.buttonsGroup.addRadioButton( enumValueType.getLabel( enumItem, false, CapitalizationType.FIRST_WORD_ONLY, true ), auxText, image );
            button.setData( enumItem );
        }
View Full Code Here

    private Listener propertyListener;
   
    @Override
    protected void initEnablementService()
    {
        final Property property = context( Property.class );
       
        this.versionCompatibilityService = property.service( MasterVersionCompatibilityService.class );
       
        this.versionCompatibilityServiceListener = new Listener()
        {
            @Override
            public void handle( final Event event )
            {
                refresh();
            }
        };
       
        this.versionCompatibilityService.attach( this.versionCompatibilityServiceListener );
       
        this.propertyListener = new FilteredListener<PropertyContentEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyContentEvent event )
            {
                refresh();
            }
        };
       
        if( property.definition() instanceof ImpliedElementProperty )
        {
            property.element().attach( this.propertyListener, property.name() + "/*" );
        }
        else
        {
            property.element().attach( this.propertyListener, property.name() );
        }
    }
View Full Code Here

    @Override
    public void dispose()
    {
        super.dispose();
       
        final Property property = context( Property.class );
       
        this.versionCompatibilityService.detach( this.versionCompatibilityServiceListener );
       
        if( property.definition() instanceof ImpliedElementProperty )
        {
            property.element().detach( this.propertyListener, property.name() + "/*" );
        }
        else
        {
            property.element().detach( this.propertyListener, property.name() );
        }
    }
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final Property property = context.find( Property.class );
            return ( property != null && property.service( RequiredConstraintService.class ) != null );
        }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.Property

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.