Package org.openquark.cal.services

Examples of org.openquark.cal.services.GemViewer


            /**
             * Returns a list of the names of the gems which have the specified return type and no inputs.
             */
            private List <String> fetchGemsOfType(final TypeExpr returnTypeExpr) {
                GemViewer gemViewer = new GemViewer();
               
                final ModuleTypeInfo moduleTypeInfo = perspective.getWorkingModuleTypeInfo();

                // Create a filter which will find all gems which return the specified type
                // and take no inputs.
                // TODO: add support for gems which do take inputs...
                GemFilter filter = new GemFilter() {
                    @Override
                    public boolean select(GemEntity gemEntity) {
                        TypeExpr gemType = gemEntity.getTypeExpr();
                        return TypeExpr.canPatternMatch(gemType, returnTypeExpr, moduleTypeInfo);
                    }
                };
                gemViewer.addFilter(filter);

                Perspective newPerspective = new Perspective(perspective.getWorkspace(), perspective.getWorkingModule());
                newPerspective.setGemEntityViewer(gemViewer);

                Set<GemEntity> matchingGems = newPerspective.getVisibleGemEntities();
View Full Code Here


            /**
             * Returns a list of the names of the gems which have the specified return type and no inputs.
             */
            private List <String> fetchGemsOfType(final TypeExpr returnTypeExpr) {
                GemViewer gemViewer = new GemViewer();
               
                final ModuleTypeInfo moduleTypeInfo = perspective.getWorkingModuleTypeInfo();

                // Create a filter which will find all gems which return the specified type
                // and take no inputs.
                // TODO: add support for gems which do take inputs...
                GemFilter filter = new GemFilter() {
                    public boolean select(GemEntity gemEntity) {
                        TypeExpr gemType = gemEntity.getTypeExpr();
                        return TypeExpr.canPatternMatch(gemType, returnTypeExpr, moduleTypeInfo);
                    }
                };
                gemViewer.addFilter(filter);

                Perspective newPerspective = new Perspective(perspective.getWorkspace(), perspective.getWorkingModule());
                newPerspective.setGemEntityViewer(gemViewer);

                Set<GemEntity> matchingGems = newPerspective.getVisibleGemEntities();
View Full Code Here

        @Override
        protected Set<GemEntity> getDataObjects() {
           
            MetaModule targetMetaModule = workspace.getMetaModule(typeCheckInfo.getModuleName());
           
            GemViewer gemViewer = new GemViewer();
            gemViewer.addFilter(new UnorderedTypeMatchFilter(inputExpr, outputExpr, targetMetaModule.getTypeInfo(), true));

            Perspective perspective = new Perspective(workspace, targetMetaModule);
            perspective.setGemEntityViewer(gemViewer);
           
            return getVisibleGemsFromPerspective(perspective);  
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.GemViewer

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.