Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Property$SuspendFilter


            {
                this.element = this.element.parent().element();
            }
            else if( segment instanceof ModelPath.PropertySegment )
            {
                final Property property = this.element.property( ( (ModelPath.PropertySegment) segment ).getPropertyName() );
               
                if( property != null && property.definition() instanceof ImpliedElementProperty )
                {
                    this.element = ( (ElementHandle<?>) property ).content();
                }
                else
                {
View Full Code Here


    protected void createContents( final Composite parent )
    {
        // Initialize
       
        final PropertyEditorPart part = part();
        final Property property = part.property();
       
        this.memberType = property.definition().getType();
       
        final SortedSet<PropertyDef> allMemberProperties = this.memberType.properties();
       
        if( allMemberProperties.size() == 1 )
        {
            final PropertyDef prop = allMemberProperties.first();
           
            if( prop instanceof ValueProperty )
            {
                this.memberProperty = (ValueProperty) prop;
            }
            else
            {
                throw new IllegalStateException();
            }
        }
        else
        {
            throw new IllegalStateException();
        }
       
        this.possibleValuesService = property.service( PossibleValuesService.class );
       
        this.possibleValuesServiceListener = new Listener()
        {
            @Override
            public void handle( final Event event )
View Full Code Here

                    xmlElement = ( (XmlResource) resource ).getXmlElement();
                }
               
                while( xmlElement == null && modElement != null )
                {
                    final Property parent = modElement.parent();
                   
                    if( parent == null )
                    {
                        modElement = null;
                    }
                    else
                    {
                        modElement = parent.element();
                        resource = modElement.resource();
                       
                        if( resource != null )
                        {
                            xmlElement = ( (XmlResource) resource ).getXmlElement();
View Full Code Here

    public static final class EnumFactory extends PropertyEditorPresentationFactory
    {
        @Override
        public PropertyEditorPresentation create( final PropertyEditorPart part, final SwtPresentation parent, final Composite composite )
        {
            final Property property = part.property();
           
            if( property.definition() instanceof ListProperty &&
                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

    }

    @Override
    protected String browse( final Presentation context )
    {
        final Property property = property();
       
        final DirectoryDialog dialog = new DirectoryDialog( ( (FormComponentPresentation) context ).shell() );
        dialog.setText( property.definition().getLabel( true, CapitalizationType.FIRST_WORD_ONLY, false ) );
        dialog.setMessage( createBrowseDialogMessage( property.definition().getLabel( true, CapitalizationType.NO_CAPS, false ) ) );
       
        final Value<?> value = (Value<?>) property;
        final Path path = (Path) value.content();
       
        if( path != null )
View Full Code Here

                            final Control control )
    {
        this.propertyEditorPresentation = propertyEditorPresentation;
        this.control = control;

        final Property property = propertyEditorPresentation.property();
       
        final Listener propertyChangeListener = new FilteredListener<PropertyEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyEvent event )
            {
                updateTarget();
            }
        };
       
        property.attach( propertyChangeListener );
       
        this.control.addDisposeListener
        (
            new DisposeListener()
            {
                public void widgetDisposed( final DisposeEvent event )
                {
                    property.detach( propertyChangeListener );
                }
            }
        );
       
        initialize( this.propertyEditorPresentation, control );
View Full Code Here

    @Test
   
    public void testVersionCompatibilityEnablementServiceForList() throws Exception
    {
        final RootElement root = RootElement.TYPE.instantiate();
        final Property property = root.property( RootElement.PROP_CHILDREN );
       
        assertFalse( property.enabled() );
       
        root.setVersion( "1.0" );
        assertFalse( property.enabled() );
       
        root.setVersion( "3.0" );
        assertTrue( property.enabled() );
       
        root.setVersion( "1.0" );
        assertFalse( property.enabled() );
    }
View Full Code Here

    }
   
    @Override
    protected String browse( final Presentation context )
    {
        final Property property = property();
       
        final FileDialog dialog = new FileDialog( ( (FormComponentPresentation) context ).shell() );
        dialog.setText( property.definition().getLabel( true, CapitalizationType.FIRST_WORD_ONLY, false ) );
       
        final Value<?> value = (Value<?>) property;
        final Path path = (Path) value.content();
       
        if( path != null && path.segmentCount() > 1 )
View Full Code Here

{
    @Override
    protected boolean check( final MasterDetailsContentNodePart node )
    {
        final Element element = node.getModelElement();
        final Property property = element.parent();

        if( property != null && ! property.definition().isReadOnly() )
        {
            if( super.check( node ) )
            {
                return true;
            }
View Full Code Here

        final MasterDetailsContentNodePart node = (MasterDetailsContentNodePart) getPart();
        final List<SapphireActionHandler> handlers = new ArrayList<SapphireActionHandler>();
       
        for( MasterDetailsContentNodePart.NodeFactory factory : node.factories() )
        {
            final Property property = factory.property();
           
            if( factory.visible() && ! property.definition().isReadOnly() )
            {
                final PossibleTypesService possibleTypesService = property.service( PossibleTypesService.class );
   
                if( property instanceof ElementList )
                {
                    for( final ElementType memberType : possibleTypesService.types() )
                    {
                        final ListPropertyActionHandler handler = new ListPropertyActionHandler( (ElementList<?>) property, memberType );
                        handlers.add( handler );
                    }
                }
                else if( property instanceof ElementHandle && ! ( property.definition() instanceof ImpliedElementProperty ) )
                {
                    for( final ElementType memberType : possibleTypesService.types() )
                    {
                        final ElementPropertyActionHandler handler = new ElementPropertyActionHandler( (ElementHandle<?>) property, memberType );
                        handlers.add( handler );
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.Property$SuspendFilter

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.