Package org.eclipse.sapphire.modeling.annotations

Examples of org.eclipse.sapphire.modeling.annotations.NamedValues


        this.rootComposite.setLayout( glayout( 1, 0, 0 ) );
       
        final int baseIndent = part.getMarginLeft();
        this.rootComposite.setLayoutData( gdvindent( gdhindent( gdhspan( gdhfill(), 2 ), baseIndent ), 5 ) );
       
        final NamedValues namedValuesAnnotation = property.getAnnotation( NamedValues.class );
        final NamedValue[] namedValueAnnotations = namedValuesAnnotation.namedValues();
       
        this.namedValues = new NamedValueLocal[ namedValueAnnotations.length ];
       
        for( int i = 0, n = namedValueAnnotations.length; i < n; i++ )
        {
            final NamedValue x = namedValueAnnotations[ i ];
           
            final String namedValueLabel
                = property.getLocalizationService().text( x.label(), CapitalizationType.FIRST_WORD_ONLY, true );
           
            this.namedValues[ i ] = new NamedValueLocal( x.value(), namedValueLabel );
        }
       
        this.updating = false;
       
        this.defaultArbitraryValue = namedValuesAnnotation.defaultArbitraryValue();
        this.defaultArbitraryValue = property.encodeKeywords( this.defaultArbitraryValue );
       
        final Composite composite = new Composite( this.rootComposite, SWT.NONE );
        composite.setLayoutData( gdhfill() );
        composite.setLayout( glspacing( glayout( 2, 0, 0 ), 2 ) );
       
        final PropertyEditorAssistDecorator decorator = new PropertyEditorAssistDecorator( part, composite );
       
        decorator.control().setLayoutData( gdvalign( gd(), SWT.CENTER ) );
        decorator.addEditorControl( this.rootComposite );
        decorator.addEditorControl( composite );
       
        this.overallLabelControl = new Label( composite, SWT.WRAP );
        this.overallLabelControl.setLayoutData( gd() );
        this.overallLabelControl.setText( property.getLabel( true, CapitalizationType.FIRST_WORD_ONLY, true ) );
        decorator.addEditorControl( this.overallLabelControl );
       
        final SelectionListener selectionListener = new SelectionAdapter()
        {
            @Override
            public void widgetSelected( final SelectionEvent event )
            {
                handleRadioButtonSelectedEvent( event );
            }
        };
       
        final Composite radioButtonsComposite = new Composite( this.rootComposite, SWT.NONE );
        radioButtonsComposite.setLayoutData( gdhindent( gdhfill(), 20 ) );
        radioButtonsComposite.setLayout( glayout( 2, 0, 0, 0, 0 ) );
        decorator.addEditorControl( radioButtonsComposite );
       
        this.radioButtonGroup = new ArrayList<Button>();
       
        final String arbitraryValueLabel
            = property.getLocalizationService().text( namedValuesAnnotation.arbitraryValueLabel(), CapitalizationType.FIRST_WORD_ONLY, true ) + ":";
   
        this.arbitraryValueRadioButton = createRadioButton( radioButtonsComposite, arbitraryValueLabel );
        this.arbitraryValueRadioButton.setLayoutData( gd() );
        this.arbitraryValueRadioButton.addSelectionListener( selectionListener );
        this.radioButtonGroup.add( this.arbitraryValueRadioButton );
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.annotations.NamedValues

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.