Package org.openquark.cal.compiler.ScopedEntityNamingPolicy

Examples of org.openquark.cal.compiler.ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous


    public void categorizeByGemType(BrowserTreeNode selectedNode) { 

        // Categorize by type expr
        GemCategorizer<String> categorizer = new GemCategorizer<String>() {

            private final ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(perspective.getWorkingModuleTypeInfo());
           
            @Override
            public List<GemCategory.CategoryKey<String>> getCategoryKeyList(GemEntity gemEntity) {
                return Collections.singletonList(new GemCategory.CategoryKey<String>(gemEntity.getTypeExpr().toString(namingPolicy)));
            }
View Full Code Here


    public void categorizeByOutput(BrowserTreeNode selectedNode) { 

        // Categorize by output
        GemCategorizer<String> categorizer = new GemCategorizer<String>() {
           
            private final ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(perspective.getWorkingModuleTypeInfo());
           
            @Override
            public List<GemCategory.CategoryKey<String>> getCategoryKeyList(GemEntity gemEntity) {
                return Collections.singletonList(new GemCategory.CategoryKey<String>(gemEntity.getTypeExpr().getResultType().toString(namingPolicy)));
            }
View Full Code Here

        GemCategorizer<String> categorizer = new GemCategorizer<String>() {
           
            // the category key to use for gems with no inputs
            private final GemCategory.CategoryKey<String> noInputsKey = new GemCategory.CategoryKey<String>(BrowserMessages.getString("GB_NoInputs"));

            private final ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(perspective.getWorkingModuleTypeInfo());
           
            // Each gem belongs to the category of each of its argument types
            @Override
            public List<GemCategory.CategoryKey<String>> getCategoryKeyList(GemEntity gemEntity) {
                int arity = gemEntity.getTypeExpr().getArity();
View Full Code Here

            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
               
                NavAddress address = NavAddress.getAddress((CALFeatureName) value);
                NavAddressMethod method = address.getMethod();
                NavFrameOwner owner = getEditorSection().getEditorPanel().getNavigatorOwner();
                ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(owner.getPerspective().getWorkingModuleTypeInfo());
               
                String text = NavAddressHelper.getDisplayText(owner, address, namingPolicy);
                Icon icon = null;
               
                if (method == NavAddress.MODULE_METHOD) {
View Full Code Here

    void doRevert() {
       
        // We want to use the unqualified names if possible
        NavFrameOwner owner = getEditorPanel().getNavigatorOwner();
        ModuleTypeInfo moduleInfo = owner.getPerspective().getWorkingModuleTypeInfo();
        ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(moduleInfo);

        // Determine the information needed to display argument information
        ArgumentMetadata[] arguments = getArgumentsFromMetadata();
        ArgumentMetadata[] adjusted = getArgumentsFromMetadata();
        String[] typeStrings = NavAddressHelper.getTypeStrings(owner, getAddress(), namingPolicy);
View Full Code Here

        if (getParent() instanceof GemDrawer) {
            // If this node is inside its module's folder, just show the unqualified name.
            return gemEntity.getAdaptedName(ScopedEntityNamingPolicy.UNQUALIFIED);
       
        } else {
            ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(currentModuleTypeInfo);
            return gemEntity.getAdaptedName(namingPolicy);
        }
    }
View Full Code Here

       
        QualifiedName qualifiedName = QualifiedName.make(moduleName, unqualifiedName);
       
        ScopedEntity entity = CodeAnalyser.getVisibleModuleEntity(qualifiedName, type, workingModuleTypeInfo);
        if (entity != null) {
            ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(workingModuleTypeInfo);
            return ToolTipHelpers.getEntityToolTip(entity, namingPolicy, workspace, parent);

        } else {
            // Entity could not be found
            return GemCutter.getResourceString("CEP_UnknownSymbol");
View Full Code Here

         */
        @Override
        protected Set<GemEntity> getDataObjects() {

            if (moduleResolutions == null) {
                setNamingPolicy(new UnqualifiedUnlessAmbiguous(perspective.getWorkingModuleTypeInfo()));
                return getVisibleGemsFromPerspective(perspective);
               
            } else {
//                setNamingPolicy(ScopedEntityNamingPolicy.UNQUALIFIED);
                ModuleName[] matches = moduleResolutions.getPotentialMatches();
View Full Code Here

       
        for (int n = 0; n < count; n++) {
            instances.add(module.getTypeInfo().getNthClassInstance(n));
        }

        ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(module.getTypeInfo());

        for (final ClassInstance instance : instances) {
            NavAddress address = NavAddress.getAddress(instance);
            buffer.append("&nbsp;&nbsp;" + getLinkHtml(address, instance.getNameWithContext(namingPolicy)));
            buffer.append("<br>");
View Full Code Here

    private static String getTypeConstructorMetadataHtml(NavFrameOwner owner, TypeConstructorMetadata metadata) {
       
        TypeConstructor typeCons = (TypeConstructor) owner.getPerspective().getWorkspace().getScopedEntity(metadata.getFeatureName());
        StringBuilder buffer = new StringBuilder();
       
        ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(owner.getPerspective().getWorkingModuleTypeInfo());
       
        // list the data constructors for this type
        buffer.append("<h2>" + getAnchorHtml(CONSTRUCTORS_ANCHOR, NavigatorMessages.getString("NAV_Constructors_Header")) + "</h2>");
        int count = typeCons.getNDataConstructors();
       
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous

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.