Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.PropertyDef


    }
   
    @Override
    protected PropertyBinding createBinding( final Property property )
    {
        final PropertyDef pdef = property.definition();
       
        if( pdef == IEvent.PROP_SUBJECT )
        {
            return new ValuePropertyBinding()
            {
View Full Code Here


        out.println( "  </tr>" );
       
        for( Map.Entry<String,PropertyDef> entry : properties.entrySet() )
        {
            final String xmlPath = entry.getKey();
            final PropertyDef property = entry.getValue();
           
            final String cardinality;
           
            if( property instanceof ValueProperty )
            {
                if( property.hasAnnotation( Required.class ) )
                {
                    cardinality = "1";
                }
                else
                {
                    cardinality = "0 or 1";
                }
            }
            else if( property instanceof ElementProperty )
            {
                cardinality = "0 or 1";
            }
            else if( property instanceof ListProperty )
            {
                cardinality = "0 or more";
            }
            else
            {
                throw new IllegalStateException();
            }
           
            out.println( "  <tr>" );

            out.println( td( xmlPath ) );
            out.println( td( cardinality ) );
           
            out.println( "    <td>" );
           
            if( property.hasAnnotation( Documentation.class ) )
            {
                documentation( out, property.getAnnotation( Documentation.class ) );
            }
            else
            {
                out.println( "&nbsp;" );
            }
           
            if( property instanceof ElementProperty || property instanceof ListProperty )
            {
                boolean skip = false;
               
                final ElementType childType = property.service( PossibleTypesService.class ).types().first();
                final SortedSet<PropertyDef> childTypeProperties = childType.properties();
               
                if( childTypeProperties.size() == 1 )
                {
                    final PropertyDef childTypeProperty = childTypeProperties.first();
                   
                    if( childTypeProperty instanceof ValueProperty )
                    {
                        if( childTypeProperty.hasAnnotation( XmlBinding.class ) )
                        {
                            final XmlBinding b = childTypeProperty.getAnnotation( XmlBinding.class );
                           
                            if( b != null && b.path().length() == 0 )
                            {
                                skip = true;
                            }
                        }
                        else if( childTypeProperty.hasAnnotation( XmlValueBinding.class ) )
                        {
                            final XmlValueBinding b = childTypeProperty.getAnnotation( XmlValueBinding.class );
                           
                            if( b != null && b.path().length() == 0 )
                            {
                                skip = true;
                            }
View Full Code Here

        final Listener listener = new FilteredListener<PropertyEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyEvent event )
            {
                final PropertyDef property = event.property().definition();
                final ICalendar calendar = (ICalendar) element();
               
                if( property == org.eclipse.sapphire.samples.calendar.ICalendar.PROP_EVENTS )
                {
                    calendar.getEvents().refresh();
View Full Code Here

        this.listener = new FilteredListener<PropertyEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyEvent event )
            {
                final PropertyDef property = event.property().definition();
                final IAttendee attendee = (IAttendee) element();
               
                if( property == org.eclipse.sapphire.samples.calendar.IAttendee.PROP_NAME )
                {
                    attendee.getName().refresh();
View Full Code Here

    }
   
    @Override
    protected PropertyBinding createBinding( final Property property )
    {
        final PropertyDef pdef = property.definition();
       
        if( pdef == IAttendee.PROP_NAME )
        {
            return new ValuePropertyBinding()
            {
View Full Code Here

        }

        @Override
        protected PropertyBinding createBinding( final Property property )
        {
            final PropertyDef pdef = property.definition();
           
            PropertyBinding binding = null;
           
            if( pdef == Manufacturer.PROP_NAME )
            {
View Full Code Here

        }

        @Override
        protected PropertyBinding createBinding( final Property property )
        {
            final PropertyDef pdef = property.definition();
           
            PropertyBinding binding = null;
           
            if( pdef == Category.PROP_NAME )
            {
View Full Code Here

        final String columnWidthsHint = part.getRenderingHint( PropertyEditorDef.HINT_COLUMN_WIDTHS, "" );
        final StringTokenizer columnWidthsHintTokenizer = new StringTokenizer( columnWidthsHint, "," );
       
        for( final ModelPath childPropertyPath : part.getChildProperties() )
        {
            final PropertyDef childProperty = property.definition().getType().property( childPropertyPath );
            final PropertyEditorDef childPropertyEditorDef = part.definition().getChildPropertyEditor( childPropertyPath );
            final TableViewerColumn tableViewerColumn = new TableViewerColumn( this.tableViewer, SWT.NONE );
           
            if( childPropertyEditorDef == null )
            {
                final String label = childProperty.getLabel( false, CapitalizationType.TITLE_STYLE, false );
                tableViewerColumn.getColumn().setText( label );
            }
            else
            {
                final MutableReference<FunctionResult> labelFunctionResultRef = new MutableReference<FunctionResult>();
               
                final Runnable updateLabelOp = new Runnable()
                {
                    public void run()
                    {
                        String label = (String) labelFunctionResultRef.get().value();
                        label = LabelTransformer.transform( label, CapitalizationType.TITLE_STYLE, false );
                        tableViewerColumn.getColumn().setText( label );
                    }
                };
               
                final FunctionResult labelFunctionResult = part.initExpression
                (
                    childPropertyEditorDef.getLabel().content(),
                    String.class,
                    Literal.create( childProperty.getLabel( false, CapitalizationType.NO_CAPS, true ) ),
                    updateLabelOp
                );
               
                labelFunctionResultRef.set( labelFunctionResult );
               
View Full Code Here

    private ColumnHandler createColumnHandler( final List<ColumnHandler> allColumnHandlers,
                                               final ModelPath childPropertyPath,
                                               final boolean showImages,
                                               final PropertyEditorDef childPropertyEditorDef )
    {
        final PropertyDef childProperty = property().definition().getType().property( childPropertyPath );
        final ColumnHandler columnHandler;
       
        if( childProperty.isOfType( Boolean.class ) )
        {
            columnHandler = new BooleanPropertyColumnHandler( this.tableViewer, this.selectionProvider, part(),
                                                              allColumnHandlers, childPropertyPath, showImages );
        }
        else
        {
            PopUpListFieldStyle popUpListFieldPresentationStyle = null;
           
            if( childProperty.isOfType( Enum.class ) )
            {
                popUpListFieldPresentationStyle = PopUpListFieldStyle.STRICT;
            }
            else if( childPropertyEditorDef != null )
            {
                final String style = childPropertyEditorDef.getStyle().text();
               
                if( style != null )
                {
                    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
View Full Code Here

               
                final List<PropertyDef> columns = new ArrayList<PropertyDef>();
               
                for( ExtensionSummarySectionColumnDef cdef : this.def.getColumns() )
                {
                    final PropertyDef cprop = extType.property( cdef.getName().text() );
                   
                    if( cprop != null )
                    {
                        columns.add( cprop );
                    }
                }
               
                if( columns.isEmpty() )
                {
                    columns.addAll( getDefaultColumns() );
                }
               
                for( Iterator<PropertyDef> itr = columns.iterator(); itr.hasNext(); )
                {
                    final PropertyDef cprop = itr.next();
                    boolean empty = true;
                   
                    if( cprop instanceof ValueProperty )
                    {
                        final ValueProperty cvprop = (ValueProperty) cprop;
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.PropertyDef

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.