Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ScopedEntityNamingPolicy


        } else if (argStatus == Argument.Status.TYPE_CLASH) {
            return GemCutter.getResourceString("CGE_Type_Clash");
        }

        ScopedEntityNamingPolicy namingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(perspective.getWorkingModuleTypeInfo());

        // Must be in natural state. Check for (transiently) null type..
        if (argType == null) {
            return "null";
        }
View Full Code Here


        if (argumentExplorer == null) {
            // Create an owner for the argument explorer.
            ArgumentExplorerOwner owner = new ArgumentExplorerOwner() {

                public String getHTMLFormattedMetadata(PartInput input) {
                    ScopedEntityNamingPolicy namingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(getTableTop().getCurrentModuleTypeInfo());
                    return ToolTipHelpers.getPartToolTip(input, tableTop.getGemGraph(), namingPolicy, argumentExplorer);
                }

                public void retargetInputArgument(PartInput argument, CollectorGem newTarget, int addIndex) {
                    getTableTop().handleRetargetInputArgumentGesture(argument, newTarget, addIndex);
                }

                public ValueEditorManager getValueEditorManager() {
                    return valueEditorManager;
                }
               

                public String getTypeString(final TypeExpr typeExpr) {
                    final ScopedEntityNamingPolicy namingPolicy;
                    final ModuleTypeInfo currentModuleTypeInfo = tableTop.getCurrentModuleTypeInfo();
                    if (currentModuleTypeInfo == null) {
                        namingPolicy = ScopedEntityNamingPolicy.FULLY_QUALIFIED;
                    } else {
                        namingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(currentModuleTypeInfo);
View Full Code Here

        if (path != null) {
            BrowserTreeNode node = (BrowserTreeNode) path.getLastPathComponent();
            
            if (node instanceof GemTreeNode && node.isLeaf ()) {
                BrowserTreeModel browserTreeModel = (BrowserTreeModel) getModel();
                ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(browserTreeModel.getPerspective().getWorkingModuleTypeInfo());
                GemEntity gemEntity = (GemEntity)node.getUserObject()
                return ToolTipHelpers.getEntityToolTip(gemEntity, namingPolicy, this);
               
            } else if (node instanceof GemDrawer) {
               
View Full Code Here

                setForeground(NON_VISIBLE_COLOR);
            }
           
            // Update the text if we are supposed to show type signatures
            if (browserTree.getDisplayTypeExpr()) {
                ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(browserTreeModel.getPerspective().getWorkingModuleTypeInfo());
                displayString += NAME_TYPE_PAD + gemEntity.getTypeExpr().toString(namingPolicy);
            }

        } else {
View Full Code Here

            // If required draw type signatures next to gem names in a different font.
           
            stylizedName = getAttributedString();
           
            GemEntity gemEntity = (GemEntity) treeNode.getUserObject();               
            ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(browserTreeModel.getPerspective().getWorkingModuleTypeInfo());
            int nameLength = treeNode.getDisplayedString().length() + NAME_TYPE_PAD.length();
            int typeLength = gemEntity.getTypeExpr().toString(namingPolicy).length();
           
            // Make the type name appear in italic and in a smaller size
            stylizedName.addAttribute(TextAttribute.FONT, getFont().deriveFont(Font.ITALIC), nameLength, nameLength + typeLength);
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

        } else if (gem instanceof RecordCreationGem) {
            return ((RecordCreationGem)gem).getDisplayName();

        } else if (gem instanceof FunctionalAgentGem) {
            ModuleTypeInfo moduleTypeInfo = displayContext.getContextModuleTypeInfo();
            ScopedEntityNamingPolicy namingPolicy = moduleTypeInfo == null ?
                                                    namingPolicy = ScopedEntityNamingPolicy.FULLY_QUALIFIED :
                                                    new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(moduleTypeInfo);
            return ((FunctionalAgentGem)gem).getGemEntity().getAdaptedName(namingPolicy);     
       
        } else if (gem instanceof ReflectorGem) {
View Full Code Here

TOP

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

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.