Package org.eclipse.sapphire.modeling

Examples of org.eclipse.sapphire.modeling.ModelPath


                }
                else if( head instanceof PropertySegment )
                {
                    final String name = ( (PropertySegment) head ).getPropertyName();
                    final Property property = this.propertiesByName.get( name.toLowerCase() );
                    final ModelPath tail = path.tail();
                   
                    if( property instanceof ElementHandle )
                    {
                        final Element element = ( (ElementHandle<?>) property ).content();
                       
                        if( element != null )
                        {
                            return element.visit( tail, visitor );
                        }
                    }
                    else if( property instanceof ElementList )
                    {
                        for( Element element : (ElementList<?>) property )
                        {
                            if( ! element.visit( tail, visitor ) )
                            {
                                return false;
                            }
                        }
                    }
                   
                    return true;
                }
                else if( head instanceof TypeFilterSegment )
                {
                    final String t = type().getSimpleName();
                    boolean match = false;
                   
                    for( String type : ( (TypeFilterSegment) head ).getTypes() )
                    {
                        if( type.equalsIgnoreCase( t ) )
                        {
                            match = true;
                            break;
                        }
                    }
                   
                    if( match )
                    {
                        return visit( path.tail(), visitor );
                    }
                   
                    return true;
                }
                else if( head instanceof AllSiblingsSegment )
                {
                    final Property parent = parent();
                   
                    if( parent instanceof ElementList )
                    {
                        final ModelPath p = ( new ModelPath( parent.name() ) ).append( path.tail() );
                        return parent.element().visit( p, visitor );
                    }
                }
            }
View Full Code Here


    public final void attach( final Listener listener,
                              final String path )
    {
        assertNotDisposed();

        attach( listener, new ModelPath( path ) );
    }
View Full Code Here

            if( parent == null || ! ( parent.definition() instanceof ListProperty ) )
            {
                throw createIllegalPathException( path );
            }
           
            final ModelPath p = ( new ModelPath( parent.name() ) ).append( path.tail() );
            parent.element().attach( listener, p );
        }
        else if( head instanceof TypeFilterSegment )
        {
            final String t = this.type.getSimpleName();
View Full Code Here

        if( disposed() )
        {
            return;
        }
       
        detach( listener, new ModelPath( path ) );
    }
View Full Code Here

            if( parent == null || ! ( parent.definition() instanceof ListProperty ) )
            {
                throw createIllegalPathException( path );
            }
           
            final ModelPath p = ( new ModelPath( parent.name() ) ).append( path.tail() );
            parent.element().detach( listener, p );
        }
        else if( head instanceof TypeFilterSegment )
        {
            final String t = this.type.getSimpleName();
View Full Code Here

        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 )
        {
View Full Code Here

       
        synchronized( root() )
        {
            assertNotDisposed();
   
            attach( listener, new ModelPath( path ) );
        }
    }
View Full Code Here

            throw new IllegalArgumentException();
        }
       
        synchronized( root() )
        {
            detach( listener, new ModelPath( path ) );
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.ModelPath

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.