Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Property


        else
        {
            ModelPath.Segment head = endpointPath.head();
            if( head instanceof ParentElementSegment )
            {
                final Property parent = modelElement.parent();               
                if( parent == null )
                {
                    throw new RuntimeException("Invalid model path: " + endpointPath);
                }
                return resolveEndpointReferenceValue(parent.element(), endpointPath.tail());               
            }
            else
            {
                throw new RuntimeException("Invalid model path: " + endpointPath);
            }
View Full Code Here


        }
        else
        {
            if (propertyPath.head() instanceof ModelPath.ParentElementSegment)
            {
                final Property parent = modelElement.parent();
                setModelProperty(parent.element(), propertyPath.tail(), value);
            }
        }
    }
View Full Code Here

                else
                {
                    element = cast( operand( 0 ), Element.class );
                }
               
                final Property parent = element.parent();
               
                return ( parent == null ? null : parent.element() );
            }
        };
    }
View Full Code Here

            // the exception will be thrown again.
        }
       
        if( obj instanceof Property )
        {
            final Property property = (Property) obj;
           
            property.attach( this.listener );
           
            if( this.properties == null )
            {
                this.properties = new HashSet<Property>( 1 );
            }
View Full Code Here

public abstract class PossibleValuesListPresentationFactory extends PropertyEditorPresentationFactory
{
    protected boolean check( final PropertyEditorPart part )
    {
        final Property property = part.property();
       
        if( property instanceof ElementList &&
            property.service( PossibleValuesService.class ) != null &&
            property.service( PossibleTypesService.class ).types().size() == 1 )
        {
            final SortedSet<PropertyDef> properties = property.definition().getType().properties();
           
            if( properties.size() == 1 )
            {
                final PropertyDef memberProperty = properties.first();
               
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

            (
                new ICheckStateListener()
                {
                    public void checkStateChanged( final CheckStateChangedEvent event )
                    {
                        final Property property = (Property) event.getElement();
                       
                        if( event.getChecked() == true )
                        {
                            PromptDialog.this.selectedProperties.add( property );
                        }
View Full Code Here

    private FileExtensionsService fileExtensionsService;
   
    @Override
    protected void initValidationService()
    {
        final Property property = context( Property.class );
       
        this.resourceMustExist = property.definition().hasAnnotation( MustExist.class );
       
        final ValidFileSystemResourceType validResourceTypeAnnotation = property.definition().getAnnotation( ValidFileSystemResourceType.class );
        this.validResourceType = ( validResourceTypeAnnotation != null ? validResourceTypeAnnotation.value() : null );
       
        this.fileExtensionsService = property.service( FileExtensionsService.class );
       
        if( this.fileExtensionsService != null )
        {
            this.fileExtensionsService.attach
            (
View Full Code Here

    private boolean refreshing;
   
    @Override
    protected void initPossibleValuesService()
    {
        final Property parent = context( Element.class ).parent();
       
        this.base = parent.service( PossibleValuesService.class );
       
        this.listener = new Listener()
        {
            @Override
            public void handle( final Event event )
View Full Code Here

        {
            final String style = part.definition().getStyle().content();
           
            if( style != null && style.startsWith( "Sapphire.PropertyEditor.PopUpListField" ) )
            {
                final Property property = part.property();
               
                if( property.definition() instanceof ValueProperty && property.service( PossibleValuesService.class ) != null )
                {
                    PopUpListFieldStyle popUpListFieldPresentationStyle = null;
                   
                    if( style.equals( "Sapphire.PropertyEditor.PopUpListField" ) )
                    {
                        if( Enum.class.isAssignableFrom( property.definition().getTypeClass() ) )
                        {
                            popUpListFieldPresentationStyle = PopUpListFieldStyle.STRICT;
                        }
                        else
                        {
                            final PossibleValues possibleValuesAnnotation = property.definition().getAnnotation( PossibleValues.class );
                           
                            if( possibleValuesAnnotation != null )
                            {
                                popUpListFieldPresentationStyle
                                    = ( possibleValuesAnnotation.invalidValueSeverity() == Severity.ERROR
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.