Package org.eclipse.sapphire.modeling.el

Examples of org.eclipse.sapphire.modeling.el.Function


                        broadcast( new PartVisibilityEvent( null ) );
                    }
                }
            );
           
            this.visibleWhenFunctionForNodes = new Function()
            {
                @Override
                public String name()
                {
                    return "NodeFactoryVisible";
View Full Code Here


    }
   
    @Override
    protected Function initVisibleWhenFunction()
    {
        final Function function = new Function()
        {
            @Override
            public String name()
            {
                return "VisibleIfChildrenVisible";
            }

            @Override
            public FunctionResult evaluate( final FunctionContext context )
            {
                return new FunctionResult( this, context )
                {
                    @Override
                    protected void init()
                    {
                        final Listener pageVisibilityListener = new FilteredListener<PartVisibilityEvent>()
                        {
                            @Override
                            protected void handleTypedEvent( final PartVisibilityEvent event )
                            {
                                refresh();
                            }
                        };
                       
                        PageBookPart.this.attach
                        (
                            new FilteredListener<PageChangedEvent>()
                            {
                                @Override
                                protected void handleTypedEvent( final PageChangedEvent event )
                                {
                                    final FormPart page = getCurrentPage();
                                   
                                    if( page != null )
                                    {
                                        page.attach( pageVisibilityListener );
                                    }
                                   
                                    refresh();
                                }
                            }
                        );
                       
                        final FormPart page = getCurrentPage();
                       
                        if( page != null )
                        {
                            page.attach( pageVisibilityListener );
                        }
                    }

                    @Override
                    protected Object evaluate()
                    {
                        boolean visible = false;
                       
                        final FormPart page = getCurrentPage();
                       
                        if( page != null )
                        {
                            visible = page.visible();
                        }
                       
                        return visible;
                    }
                };
            }
        };
       
        function.init();
       
        final Function base = super.initVisibleWhenFunction();
       
        if( base == null )
        {
            return function;
        }
View Full Code Here

                 */
               
                return AndFunction.create
                (
                    super.initVisibleWhenFunction(),
                    new Function()
                    {
                        @Override
                        public String name()
                        {
                            return "NecessarySeparator";
View Full Code Here

    }
   
    @Override
    protected Function initVisibleWhenFunction()
    {
        final Function function = new Function()
        {
            @Override
            public String name()
            {
                return "VisibleIfListEditorVisible";
            }

            @Override
            public FunctionResult evaluate( final FunctionContext context )
            {
                return new FunctionResult( this, context )
                {
                    private Listener listPropertyEditorListener;
                   
                    @Override
                    protected void init()
                    {
                        this.listPropertyEditorListener = new FilteredListener<PartVisibilityEvent>()
                        {
                            @Override
                            protected void handleTypedEvent( final PartVisibilityEvent event )
                            {
                                refresh();
                            }
                        };
                       
                        DetailSectionPart.this.listPropertyEditorPart.attach( this.listPropertyEditorListener );
                    }

                    @Override
                    protected Object evaluate()
                    {
                        return DetailSectionPart.this.listPropertyEditorPart.visible();
                    }

                    @Override
                    public void dispose()
                    {
                        DetailSectionPart.this.listPropertyEditorPart.detach( this.listPropertyEditorListener );
                        this.listPropertyEditorListener = null;
                       
                        super.dispose();
                    }
                };
            }
        };
       
        function.init();
       
        final Function base = super.initVisibleWhenFunction();
       
        if( base == null )
        {
            return function;
        }
View Full Code Here

       
        this.def = (HtmlPanelDef) this.definition;

        if( this.def.getContentSourceType().content() == HtmlContentSourceType.EMBEDDED )
        {
            Function contentFunction = this.def.getContent().content();
           
            if( this.def.getFragment().content() == true )
            {
                contentFunction = ConcatFunction.create( FRAGMENT_HEADER, contentFunction );
                contentFunction = ConcatFunction.create( contentFunction, FRAGMENT_FOOTER );
View Full Code Here

        );
       
        // Image
       
        final Literal defaultImageLiteral = Literal.create( ( this.definition.getChildNodes().isEmpty() ? IMG_LEAF_NODE : IMG_CONTAINER_NODE ) );
        final Function imageFunction = this.definition.getImage().content();
       
        this.imageManager = new ImageManager( imageFunction, defaultImageLiteral );
       
        // Decorations
       
View Full Code Here

            super.initVisibleWhenFunction(),
            createVersionCompatibleFunction( this.modelElementProperty ),
            (
                this.nodeFactoryVisibleFunction != null ?
                this.nodeFactoryVisibleFunction :
                new Function()
                {
                    @Override
                    public String name()
                    {
                        return "VisibleIfChildrenVisible";
View Full Code Here

    protected Function initVisibleWhenFunction()
    {
        return AndFunction.create
        (
            super.initVisibleWhenFunction(),
            new Function()
            {
                @Override
                public String name()
                {
                    return "VisibleIfActionHandlerExists";
View Full Code Here

    protected Function initVisibleWhenFunction()
    {
        return AndFunction.create
        (
            super.initVisibleWhenFunction(),
            new Function()
            {
                @Override
                public String name()
                {
                    return "VisibleIfChildrenVisible";
View Full Code Here

                                                final Function function,
                                                final Class<?> expectedType,
                                                final Function defaultValue,
                                                final Runnable refreshOp )
    {
        Function f = ( function == null ? Literal.NULL : function );
        f = FailSafeFunction.create( f, Literal.create( expectedType ), defaultValue );
       
        final FunctionResult fr = f.evaluate( new PartFunctionContext( this, element ) );
       
        if( refreshOp != null )
        {
            fr.attach
            (
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.el.Function

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.