Package org.eclipse.sapphire.ui

Examples of org.eclipse.sapphire.ui.SapphirePart$ImageChangedEvent


            private Listener listener;
           
            @Override
            protected Object evaluate()
            {
                SapphirePart p = null;
               
                try
                {
                    p = operand( 0, SapphirePart.class, false );
                }
                finally
                {
                    if( this.part != p )
                    {
                        if( this.part != null )
                        {
                            this.part.detach( this.listener );
                        }
                       
                        this.part = p;
                  
                        if( this.part != null )
                        {
                            if( this.listener == null )
                            {
                                this.listener = new FilteredListener<PartValidationEvent>()
                                {
                                    @Override
                                    protected void handleTypedEvent( final PartValidationEvent event )
                                    {
                                        refresh();
                                    }
                                };
                            }
                           
                            this.part.attach( this.listener );
                        }
                    }
                }
               
                if( p == null )
                {
                    throw new IllegalStateException();
                }
               
                return p.validation();
            }
           
            @Override
            public void dispose()
            {
View Full Code Here


    }

    @Override
    public FunctionResult evaluate( final FunctionContext context )
    {
        final SapphirePart part;
       
        if( context instanceof PartFunctionContext )
        {
            part = ( (PartFunctionContext) context ).part();
        }
View Full Code Here

        final TestElement element = TestElement.TYPE.instantiate();
       
        try
        {
            final DefinitionLoader.Reference<DialogDef> definition = DefinitionLoader.sdef( PartValidationFunctionTests.class ).dialog();
            final SapphirePart part = new DialogPart();
           
            try
            {
                part.init( null, element, definition.resolve(), Collections.<String,String>emptyMap() );
                part.initialize();
               
                final FunctionResult fr = ExpressionLanguageParser.parse( "${ Part.Validation }" ).evaluate( new PartFunctionContext( part, element ) );
               
                try
                {
                    assertInstanceOf( fr.value(), Status.class );
                    assertEquals( Status.Severity.ERROR, ( (Status) fr.value() ).severity() );
                   
                    element.setValue( "abc" );
                   
                    assertInstanceOf( fr.value(), Status.class );
                    assertEquals( Status.Severity.OK, ( (Status) fr.value() ).severity() );
                }
                finally
                {
                    fr.dispose();
                }
               
            }
            finally
            {
                part.dispose();
            }
        }
        finally
        {
            element.dispose();
View Full Code Here

        final Element element = Element.TYPE.instantiate();
       
        try
        {
            final DefinitionLoader.Reference<DialogDef> definition = DefinitionLoader.sdef( PartFunctionTests.class ).dialog();
            final SapphirePart part = new DialogPart();
           
            try
            {
                part.init( null, element, definition.resolve(), Collections.<String,String>emptyMap() );
                part.initialize();
               
                testForExpectedValue( new PartFunctionContext( part, element ), "${ Part }", part );
            }
            finally
            {
                part.dispose();
            }
        }
        finally
        {
            element.dispose();
View Full Code Here

      {
        this.containerParent = nodePart;
      }
      else
      {
        SapphirePart part = this;
        SapphirePart parentPart = (SapphirePart)parent();
        while (!(parentPart instanceof DiagramNodePart || parentPart.getLocalModelElement() != getLocalModelElement())) {
          part = parentPart;
          parentPart = (SapphirePart)parentPart.parent();
        }
        this.containerParent = part;       
      }
    }
    return this.containerParent;
View Full Code Here

                @Override
                public void handle( final org.eclipse.sapphire.Event event )
                {
                    if( event instanceof PartEvent )
                    {
                        final SapphirePart part = ( (PartEvent) event ).part();
                       
                        if( part instanceof MasterDetailsContentNodePart )
                        {
                            final MasterDetailsContentNodePart node = (MasterDetailsContentNodePart) part;
                           
View Full Code Here

   
    @Override
    protected Object run( final Presentation context )
    {
        final FormComponentPresentation p = (FormComponentPresentation) context;
        final SapphirePart part = (SapphirePart) getPart();

        final Set<Property> properties = new LinkedHashSet<Property>();
        collectProperties( part, properties );

        for( Iterator<Property> itr = properties.iterator(); itr.hasNext(); )
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.SapphirePart$ImageChangedEvent

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.