Package org.eclipse.sapphire.modeling

Examples of org.eclipse.sapphire.modeling.Status


    }

    @Override
    public void contribute( final PropertyEditorAssistContext context )
    {
        final Status validation = this.part.validation();
       
        if( validation.children().isEmpty() )
        {
            contribute( context, validation );
        }
        else
        {
            for( Status child : validation.children() )
            {
                contribute( context, child );
            }
        }
    }
View Full Code Here


  {
    refreshAssistContext();
   
    Image image = null;
   
    Status status = part().content();
    ValidationMarkerSize size = getSize();
    if (part().visible())
    {
      if (status.severity() == Status.Severity.WARNING)
      {
        if (size == ValidationMarkerSize.SMALL)
        {
          image = imageCache.image(IMG_WARNING_SMALL);
        }
        else
        {
          image = imageCache.image(IMG_WARNING);         
        }
      }
      else if (status.severity() == Status.Severity.ERROR)
      {
        if (size == ValidationMarkerSize.SMALL)
        {
          image = imageCache.image(IMG_ERROR_SMALL);
        }
View Full Code Here

    DiagramNodePart nodePart = markerPart.nearest(DiagramNodePart.class);
    ValidationMarkerSize size = markerPart.getSize();
    Image image = null;
       
    Element model = nodePart.getModelElement();   
    Status status = model.validation();
    if (status.severity() != Status.Severity.OK)
    {
      if (status.severity() == Status.Severity.WARNING)
      {
        if (size == ValidationMarkerSize.SMALL)
        {
          image = nodePart.getSwtResourceCache().image(IMG_WARNING_SMALL);
        }
        else
        {
          image = nodePart.getSwtResourceCache().image(IMG_WARNING);         
        }
      }
      else if (status.severity() == Status.Severity.ERROR)
      {
        if (size == ValidationMarkerSize.SMALL)
        {
          image = nodePart.getSwtResourceCache().image(IMG_ERROR_SMALL);
        }
View Full Code Here

    }
   
    @Override
    protected Status computeValidation()
    {
        Status state = super.computeValidation();
       
        if( this.property != null )
        {
            final Status.CompositeStatusFactory factory = Status.factoryForComposite();
            factory.merge( ( (ElementHandle<?>) this.property ).validation() );
View Full Code Here

        x.setId( "123" );
       
        final TestChildElement y = children.insert();
        y.setId( "123" );
       
        final Status status = root.validation();
       
        assertEquals( "Multiple occurrence of \"123\" were found", status.message() );
        assertEquals( 0, status.children().size() );
    }
View Full Code Here

       
        final Runnable messageUpdateOperation = new Runnable()
        {
            public void run()
            {
                final Status st = form.part().validation();
               
                if( st.severity() == Status.Severity.ERROR )
                {
                    setMessage( st.message(), ERROR );
                    setValid( false );
                }
                else if( st.severity() == Status.Severity.WARNING )
                {
                    setMessage( st.message(), WARNING );
                    setValid( true );
                }
                else
                {
                    setMessage( null );
View Full Code Here

            );
           
            return;
        }
       
        final Status newValidationState = computeValidation();
       
        if( newValidationState == null )
        {
            throw new IllegalStateException();
        }
View Full Code Here

                }
                else
                {
                    this.current = this.base;
                   
                    final Status st = validation();
                    final Status.Severity severity = st.severity();

                    if( severity == Status.Severity.ERROR )
                    {
                        if( this.error == null )
                        {
View Full Code Here

            if( this.def == null )
            {
                throw new IllegalStateException();
            }
           
            final Status validation = this.def.validation();
           
            if( validation.severity() == Status.Severity.ERROR )
            {
                throw new InvalidDefinitionException( validation );
            }
           
           return this.def;
View Full Code Here

        {
            final FunctionResult result = ExpressionLanguageParser.parse( expr ).evaluate( context );
           
            try
            {
                final Status status = result.status();
                assertEquals( Status.Severity.ERROR, status.severity() );
                assertEquals( expected, status.message() );
            }
            finally
            {
                result.dispose();
            }
View Full Code Here

TOP

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

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.