Package org.eclipse.sapphire.ui.assist.internal

Examples of org.eclipse.sapphire.ui.assist.internal.PropertyEditorAssistDecorator


        final boolean isActionsToolBarNeeded = toolBarActionsPresentation.hasActions();
       
        final Composite composite = createMainComposite( parent );
        composite.setLayout( glspacing( glayout( ( isActionsToolBarNeeded ? 3 : 2 ), 0, 0 ), 2 ) );
       
        final PropertyEditorAssistDecorator decorator = createDecorator( composite );
        decorator.addEditorControl( composite );
        decorator.control().setLayoutData( gdvalign( gd(), SWT.TOP ) );

        final Combo combo = new Combo( composite, SWT.SINGLE | SWT.BORDER | ( this.style == PopUpListFieldStyle.STRICT ? SWT.READ_ONLY : SWT.NONE ) );
        combo.setLayoutData( gdhfill() );
        combo.setVisibleItemCount( 10 );

        decorator.addEditorControl( combo, true );
        addControl( combo );
        this.combo = combo;
       
        if( isActionsToolBarNeeded )
        {
            final ToolBar toolbar = new ToolBar( composite, SWT.FLAT | SWT.HORIZONTAL );
            toolbar.setLayoutData( gdhindent( gdvfill(), 3 ) );
            toolBarActionsPresentation.setToolBar( toolbar );
            toolBarActionsPresentation.render();
            addControl( toolbar );
            decorator.addEditorControl( toolbar );
        }
       
        final PossibleValuesService possibleValuesService = property.service( PossibleValuesService.class );
        final ValueNormalizationService valueNormalizationService = property.service( ValueNormalizationService.class );
       
View Full Code Here


    }

    @Override
    protected void createContents( final Composite parent )
    {
        PropertyEditorAssistDecorator decorator = null;
       
        if( this.orientation == Orientation.VERTICAL )
        {
            final Composite composite = createMainComposite( parent );
            composite.setLayout( glspacing( glayout( 2, 0, 0 ), 2, 5 ) );

            decorator = createDecorator( composite );
            decorator.addEditorControl( composite );
            decorator.control().setLayoutData( gdvindent( gdvalign( gd(), SWT.TOP ), 4 ) );
           
            this.control = new RadioButtonsGroup( composite, true );
            this.control.setLayoutData( gdhfill() );
        }
        else
        {
            final Composite composite = createMainComposite( parent );
            composite.setLayout( glspacing( glayout( 2, 0, 0 ), 2 ) );
           
            decorator = createDecorator( composite );
            decorator.addEditorControl( composite );
           
            decorator.control().setLayoutData( gdvalign( gd(), SWT.CENTER ) );

            this.control = new RadioButtonsGroup( composite, false );
            this.control.setLayoutData( gdhfill() );
        }
   
        this.binding = new RadioButtonGroupBinding( this, this.control );           
   
        this.control.setData( DATA_BINDING, this.binding );
        decorator.addEditorControl( this.control, true );
   
        addControl( this.control );
    }
View Full Code Here

        final Composite textFieldComposite = new Composite( composite, SWT.NONE );
        textFieldComposite.setLayoutData( gdwhint( gd(), 60 ) );
        textFieldComposite.setLayout( glspacing( glayout( 2, 0, 0 ), 2 ) );

        final PropertyEditorAssistDecorator decorator = createDecorator( textFieldComposite );
        decorator.control().setLayoutData( gdvalign( gd(), SWT.TOP ) );
       
        this.textField = new Text( textFieldComposite, SWT.BORDER );
        this.textField.setLayoutData( gdhfill() );
       
        this.textField.addModifyListener
        (
            new ModifyListener()
            {
                public void modifyText( final ModifyEvent event )
                {
                    setPropertyValue( ScalePropertyEditorPresentation.this.textField.getText() );
                }
            }
        );
       
        final TextOverlayPainter.Controller textOverlayPainterController = new TextOverlayPainter.Controller()
        {
            @Override
            public String overlay()
            {
                return property().getDefaultText();
            }
        };
       
        TextOverlayPainter.install( this.textField, textOverlayPainterController );
       
        this.scale = new Scale( composite, SWT.HORIZONTAL );
        this.scale.setLayoutData( gdhfill() );
        this.scale.setMinimum( this.minimum );
        this.scale.setMaximum( this.maximum );
        this.scale.setIncrement( 1 );
        this.scale.setPageIncrement( 1 );
       
        this.scale.addSelectionListener
        (
            new SelectionAdapter()
            {
                @Override
                public void widgetSelected( final SelectionEvent event )
                {
                    final int value = ScalePropertyEditorPresentation.this.scale.getSelection() - ScalePropertyEditorPresentation.this.offset;
                    setPropertyValue( String.valueOf( value ) );
                }
            }
        );

        decorator.addEditorControl( composite );
       
        addControl( this.textField );
        addControl( this.scale );
    }
View Full Code Here

       
        final boolean isDeprecated = property().definition().hasAnnotation( Deprecated.class );
       
        composite.setLayout( glspacing( glayout( ( isDeprecated ? 3 : 2 ), 0, 0 ), 2 ) );

        final PropertyEditorAssistDecorator decorator = createDecorator( composite );
        decorator.control().setLayoutData( gdvalign( gd(), SWT.CENTER ) );
       
        this.checkbox = new Button( composite, SWT.CHECK );
        this.checkbox.setLayoutData( gd() );
       
        if( checkboxLayout != CheckboxLayout.LEADING_LABEL )
        {
            final Runnable updateLabelOp = new Runnable()
            {
                public void run()
                {
                    CheckBoxPropertyEditorPresentation.this.checkbox.setText( part.label( CapitalizationType.FIRST_WORD_ONLY, true ) );
                }
            };
           
            attachPartListener
            (
                new FilteredListener<LabelChangedEvent>()
                {
                    @Override
                    protected void handleTypedEvent( final LabelChangedEvent event )
                    {
                        updateLabelOp.run();
                        layout();
                    }
                }
            );
           
            updateLabelOp.run();
        }
       
        if( isDeprecated )
        {
            final Control deprecationMarker = createDeprecationMarker( composite );
            deprecationMarker.setLayoutData( gdhindent( gdhfill(), 3 ) );
        }
       
        this.checkbox.getAccessible().addAccessibleListener
        (
            new AccessibleAdapter()
            {
                @Override
                public void getName( final AccessibleEvent event )
                {
                    event.result = property().definition().getLabel( true, CapitalizationType.NO_CAPS, true );
                }
            }
        );
       
        this.checkbox.addSelectionListener
        (
            new SelectionAdapter()
            {
                public void widgetSelected( final SelectionEvent event )
                {
                    final boolean value = CheckBoxPropertyEditorPresentation.this.checkbox.getSelection();
                    setPropertyValue( String.valueOf( value ) );
                }
            }
        );
       
        decorator.addEditorControl( composite );
       
        addControl( this.checkbox );
    }
View Full Code Here

        rootComposite.layout( true, true );
    }
   
    protected final PropertyEditorAssistDecorator createDecorator( final Composite parent )
    {
        this.decorator = new PropertyEditorAssistDecorator( part(), parent );
        return this.decorator;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.assist.internal.PropertyEditorAssistDecorator

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.