Package org.eclipse.sapphire.modeling

Examples of org.eclipse.sapphire.modeling.EnumValueType


    @Override
    protected void init()
    {
        super.init();
       
        this.enumType = new EnumValueType( context( ValueProperty.class ).getTypeClass() );
    }
View Full Code Here


    }

    @Override
    public String convert( final Enum enm )
    {
        final EnumValueType enumValueType = new EnumValueType( enm.getClass() );
        final EnumSerialization enumStringBindingAnnotation = enumValueType.getAnnotation( enm, EnumSerialization.class );
       
        final String result;
       
        if( enumStringBindingAnnotation == null )
        {
View Full Code Here

        this.buttonsGroup = (RadioButtonsGroup) control;
       
        final PropertyEditorPart part = propertyEditorPresentation.part();
        final Property property = part.property();
        final EnumValueType enumValueType = new EnumValueType( this.enumValues[ 0 ].getDeclaringClass() );

        for( final Enum<?> enumItem : this.enumValues )
        {
            final String enumItemStr = property.service( MasterConversionService.class ).convert( enumItem, String.class );
            final String auxText = part.getRenderingHint( PropertyEditorDef.HINT_AUX_TEXT + "." + enumItemStr, null );
            final ValueImageService imageService = property.service( ValueImageService.class );
            final ImageData imageData = imageService.provide( enumItemStr );
            final Image image = propertyEditorPresentation.resources().image( imageData );
            final Button button = this.buttonsGroup.addRadioButton( enumValueType.getLabel( enumItem, false, CapitalizationType.FIRST_WORD_ONLY, true ), auxText, image );
            button.setData( enumItem );
        }
       
        this.buttonsGroup.addSelectionListener
        (
View Full Code Here

        T result = null;
       
        if( object instanceof String && Enum.class.isAssignableFrom( type ) && type != Enum.class )
        {
            final String string = (String) object;
            final EnumValueType enumValueType = new EnumValueType( type );
           
            for( Enum<?> enumItem : enumValueType.getItems() )
            {
                final EnumSerialization enumSerializationAnnotation = enumValueType.getAnnotation( enumItem, EnumSerialization.class );
               
                if( enumSerializationAnnotation == null )
                {
                    if( enumItem.name().equalsIgnoreCase( string ) )
                    {
View Full Code Here

    @Override
    protected void initPossibleValuesService()
    {
        final ValueProperty property = context( ValueProperty.class );
       
        final EnumValueType enumType = new EnumValueType( property.getTypeClass() );
        final MasterConversionService masterConversionService = property.service( MasterConversionService.class );
       
        for( Enum<?> item : enumType.getItems() )
        {
            this.values.add( masterConversionService.convert( item, String.class ) );
        }
    }
View Full Code Here

    @Override
    protected void init()
    {
        super.init();
       
        this.enumType = new EnumValueType( context( ValueProperty.class ).getTypeClass() );
    }
View Full Code Here

TOP

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

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.