Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.PropertyDef


    protected ReferenceValue<?, ?> resolveEndpointReferenceValue(Element modelElement, ModelPath endpointPath)
    {
        if (endpointPath.length() == 1)
        {
            String propertyName = ((ModelPath.PropertySegment)endpointPath.head()).getPropertyName();
            PropertyDef modelProperty = resolve(modelElement, propertyName);
            if (!(modelProperty instanceof ValueProperty))
            {
                throw new RuntimeException( "Property " + propertyName + " not a ValueProperty");
            }
            ValueProperty property = (ValueProperty)modelProperty;
View Full Code Here


            String propertyName, Object value)
    {
        if (propertyName != null)
        {
            final ElementType type = modelElement.type();
            final PropertyDef property = type.property( propertyName );
            if( property == null )
            {
                throw new RuntimeException( "Could not find property " + propertyName + " in " + type.getQualifiedName() );
            }
            if (!(property instanceof ValueProperty))
View Full Code Here

      return null;
    }
   
    protected void handleModelPropertyChange(final PropertyEvent event)
    {
        final PropertyDef property = event.property().definition();
               
        if (property.name().equals(this.endpoint1Property.name()) ||
                property.name().equals(this.endpoint2Property.name()))
        {
            boolean sourceChange = property.name().equals(this.endpoint1Property.name()) ? true : false;
            if (sourceChange)
            {
              this.srcNodeModel = resolveEndpoint(this.modelElement, this.endpoint1Path);
            }
            else
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.hasAnnotation( NamedValues.class ) )
            {
                return new NamedValuesPropertyEditorPresentation( part, parent, composite );
            }
           
            return null;
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 );
            return ( property instanceof ValueProperty || ( property instanceof ElementProperty && ! ( property instanceof ImpliedElementProperty ) ) );
        }
View Full Code Here

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

                catch( Exception e )
                {
                    final ServiceContext context = context();
                    final String contextLabel;
                   
                    final PropertyDef property = context.find( PropertyDef.class );
   
                    if( property != null )
                    {
                        contextLabel = property.getModelElementType().getSimpleName() + "." + property.name();
                    }
                    else
                    {
                        final ElementType type = context.find( ElementType.class );
                       
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();
                   
                    if( memberProperty instanceof ValueProperty &&
                        memberProperty.service( PossibleValuesService.class ) != null )
                    {
                        return true;
                    }
                }
            }
View Full Code Here

   
    @Override
    protected void initValidationService()
    {
        final Element element = context( Element.class );
        final PropertyDef property = context( PropertyDef.class );
       
        final ListFactory<Validation> annotations = ListFactory.start();
       
        if( property == null )
        {
            final ElementType type = element.type();
           
            annotations.add( type.getAnnotations( Validation.class ) );
           
            for( final Validations v : type.getAnnotations( Validations.class ) )
            {
                annotations.add( v.value() );
            }
        }
        else
        {
            annotations.add( property.getAnnotations( Validation.class ) );
           
            for( final Validations v : property.getAnnotations( Validations.class ) )
            {
                annotations.add( v.value() );
            }
        }
       
View Full Code Here

                new ITableLabelProvider()
                {
                    public String getColumnText( final Object element,
                                                 final int columnIndex )
                    {
                        final PropertyDef property = ( (Property) element ).definition();
                        return property.getLabel( true, CapitalizationType.FIRST_WORD_ONLY, false );
                    }

                    public Image getColumnImage( final Object element,
                                                 final int columnIndex )
                    {
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.