Package org.eclipse.sapphire.sdk.extensibility

Examples of org.eclipse.sapphire.sdk.extensibility.ServiceDef


                    @Override
                    public boolean allows( final Element element )
                    {
                        if( element instanceof ServiceDef )
                        {
                            final ServiceDef def = (ServiceDef) element;
                            final String id = def.getId().text();
                            final JavaType type = def.getImplementation().target();
                            final Class<?> cl = ( type == null ? null : (Class<?>) type.artifact() );
                           
                            if( id != null && id.startsWith( "Sapphire." ) &&
                                cl != null && ConversionService.class.isAssignableFrom( cl ) )
                            {
                                return true;
                            }
                        }

                        return false;
                    }
                };

                final String functions = op.execute( getExtensions(), filter );

                content = loadResource( "html/services/ConversionService.html" );
                content = content.replace( "##servicess##", functions );
            }
            else if( href.startsWith( "html/services/FactsService.html" ) )
            {
                final ExtensionSummaryExportOp op = ExtensionSummaryExportOp.TYPE.instantiate();
                op.setCreateFinishedDocument( false );

                final ExtensionSummarySectionDef section = op.getSections().insert();
                section.setExtensionType( SapphireExtensionDef.PROP_SERVICES.name() );
                section.setIncludeSectionHeader( false );

                final ExtensionSummarySectionColumnDef idColumn = section.getColumns().insert();
                idColumn.setName( ServiceDef.PROP_ID.name() );

                final ExtensionSummarySectionColumnDef descColumn = section.getColumns().insert();
                descColumn.setName( ServiceDef.PROP_DESCRIPTION.name() );
               
                final Filter<Element> filter = new Filter<Element>()
                {
                    @Override
                    public boolean allows( final Element element )
                    {
                        if( element instanceof ServiceDef )
                        {
                            final ServiceDef def = (ServiceDef) element;
                            final String id = def.getId().text();
                            final JavaType type = def.getImplementation().target();
                            final Class<?> cl = ( type == null ? null : (Class<?>) type.artifact() );
                           
                            if( id != null && id.startsWith( "Sapphire." ) &&
                                cl != null && FactsService.class.isAssignableFrom( cl ) )
                            {
View Full Code Here


                new Comparator<Element>()
                {
                    public int compare( final Element a,
                                        final Element b )
                    {
                        final ServiceDef x = (ServiceDef) a;
                        final ServiceDef y = (ServiceDef) b;
                       
                        return comp( x.getId().content(), y.getId().content() );
                    }
                }
            );
        }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.sdk.extensibility.ServiceDef

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.