Package org.openquark.cal.compiler.ScopedEntityNamingPolicy

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


        if (gem instanceof FunctionalAgentGem) {
            ModuleTypeInfo currentModuleTypeInfo = tableTopExplorerOwner.getCurrentModuleTypeInfo();
            if (currentModuleTypeInfo == null) {
                return null;
            }
            ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(currentModuleTypeInfo);
            FunctionalAgentGem functionalAgentGem = (FunctionalAgentGem) gem;
            return functionalAgentGem.getGemEntity().getAdaptedName(namingPolicy);

        } else if (gem instanceof CodeGem) {
            return ((CodeGem)gem).getUnqualifiedName();
View Full Code Here


    @Override
    public void setInitialValue() {
       
        IntellicutAdapter adapter = new IntellicutAdapter();
       
        adapter.setNamingPolicy(new UnqualifiedUnlessAmbiguous(valueEditorManager.getPerspective().getWorkingModuleTypeInfo()));
       
        intellicutPanel = new IntellicutPanel(this, adapter, null, IntellicutMode.NOTHING);
       
        intellicutPanel.loadListModel();
        intellicutPanel.setBorder(null);
View Full Code Here

    /**
     * @param typeExpr the expression to get the name for
     * @return the display name of the type expression
     */
    public String getTypeName(TypeExpr typeExpr) {
        ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(getCurrentModule().getTypeInfo());
        return typeExpr.toString(namingPolicy);
    }
View Full Code Here

                // data constructor name as the preferred width.

                baseline = "()";
               
                DataConstructor[] visibleDataConstructors = getPerspective().getDataConstructorsForType(typeConsName);
                ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(getPerspective().getWorkingModuleTypeInfo());
               
                if (visibleDataConstructors == null || visibleDataConstructors.length == 0) {

                    // Include non-visible constructors if there are no visible ones.
                   
View Full Code Here

        ValueEditorListener childListener = new ChildValueEditorListener();
        KeyAdapter editorPanelKeyListener = new EditorPanelKeyListener();
       
        boolean haveAddedPanel = false;
        FontMetrics fontMetrics = getFontMetrics(getFont().deriveFont(Font.BOLD));
        ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(valueEditorManager.getPerspective().getWorkingModuleTypeInfo());

        // Remove components in case this is called twice.
        contentPanel.removeAll();

        // Create an editor panel for each supported data constructor.
View Full Code Here

        }
       
        this.parentEditor = parentEditor;
        this.valueNode = valueNode;
       
        namingPolicy = new UnqualifiedUnlessAmbiguous(parentEditor.valueEditorManager.getPerspective().getWorkingModuleTypeInfo());
       
        setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        setBackground(NORMAL_BACKGROUND_COLOR);
        setBorder(NORMAL_BORDER);
        setCursor(Cursor.getDefaultCursor());
View Full Code Here

       
        setLayout(new BorderLayout());
        setResizable(true);

        IntellicutAdapter adapter = new IntellicutAdapter();
        adapter.setNamingPolicy(new UnqualifiedUnlessAmbiguous(valueEditorManager.getPerspective().getWorkingModuleTypeInfo()));
       
        intellicutPanel = new IntellicutPanel(this, adapter, null, IntellicutMode.NOTHING);
        intellicutPanel.loadListModel();
        intellicutPanel.setBorder(null);
        intellicutPanel.setMoveable(false);
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

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.