Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.PossibleValues


   
    public void testFromPossibleValuesAnnotation()
    {
        final TestElement item = TestElement.TYPE.instantiate();

        final PossibleValues possibleValuesAnnotation = TestElement.PROP_COLORS.getAnnotation( PossibleValues.class );
        assertNotNull( possibleValuesAnnotation );

        final String[] values = possibleValuesAnnotation.values();
        assertNotNull( values );

        final ContentProposalService contentProposalService = item.property( TestElement.PROP_COLORS ).service( ContentProposalService.class );
        assertNotNull( contentProposalService );
View Full Code Here


                {
                    if( style.startsWith( "Sapphire.PropertyEditor.PopUpListField" ) )
                    {
                        if( style.equals( "Sapphire.PropertyEditor.PopUpListField" ) )
                        {
                            final PossibleValues possibleValuesAnnotation = childProperty.getAnnotation( PossibleValues.class );
                           
                            if( possibleValuesAnnotation != null )
                            {
                                popUpListFieldPresentationStyle
                                    = ( possibleValuesAnnotation.invalidValueSeverity() == Severity.ERROR
                                        ? PopUpListFieldStyle.STRICT : PopUpListFieldStyle.EDITABLE );
                            }
                            else
                            {
                                popUpListFieldPresentationStyle = PopUpListFieldStyle.EDITABLE;
View Full Code Here

                        {
                            popUpListFieldPresentationStyle = PopUpListFieldStyle.STRICT;
                        }
                        else
                        {
                            final PossibleValues possibleValuesAnnotation = property.definition().getAnnotation( PossibleValues.class );
                           
                            if( possibleValuesAnnotation != null )
                            {
                                popUpListFieldPresentationStyle
                                    = ( possibleValuesAnnotation.invalidValueSeverity() == Severity.ERROR
                                        ? PopUpListFieldStyle.STRICT : PopUpListFieldStyle.EDITABLE );
                            }
                            else
                            {
                                popUpListFieldPresentationStyle = PopUpListFieldStyle.EDITABLE;
View Full Code Here

    protected void initPossibleValuesService()
    {
        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 )
        {
            this.invalidValueMessage = invalidValueMessage;
        }
       
        this.invalidValueSeverity = a.invalidValueSeverity();
        this.ordered = a.ordered();
       
        this.listener = new FilteredListener<PropertyContentEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyContentEvent event )
View Full Code Here

        {
            final Property property = context.find( Property.class );
           
            if( property instanceof Value || property instanceof ElementList )
            {
                final PossibleValues possibleValuesAnnotation = property.definition().getAnnotation( PossibleValues.class );
               
                if( possibleValuesAnnotation != null && possibleValuesAnnotation.property().length() > 0 )
                {
                    return true;
                }
            }
           
View Full Code Here

    private String[] values;
   
    @Override
    protected void initPossibleValuesService()
    {
        final PossibleValues a = context( PropertyDef.class ).getAnnotation( PossibleValues.class );
       
        this.values = a.values();
       
        final String invalidValueMessage = a.invalidValueMessage();
       
        if( invalidValueMessage.length() > 0 )
        {
            this.invalidValueMessage = invalidValueMessage;
        }
       
        this.invalidValueSeverity = a.invalidValueSeverity();
        this.ordered = a.ordered();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.PossibleValues

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.